Ask Computer Engineering Expert

E19: Numerical Methods for Engineering Applications Spring 2016 - PROJECT 5

Project: Numerical approximation of ODE's - Roller Coaster Simulation

OVERVIEW

In this project, you will simulate the motion of a roller coaster along a parametrically defined track, in order to investigate Lagrangian mechanics and accuracy of different numerical methods for approximating solutions of ordinary differential equations (ODE's).

BACKGROUND

In class, we examined using Lagrangian mechanics to derive the equations of motion for a dynamical system. We begin by defining q, the vector of n generalized position coordinates for the system (typically one per degree of freedom of the system). The Lagrangian of a conservative (energy-preserving) system is defined to be

L(q, q·) = T(q, q·) - V(q)

where T(q, q·) is the kinetic energy, and V(q) is the potential energy. The Euler-Lagrange equation states that for each element qi of the generalized coordinates,

(d/dt)(∂L/∂q·i) - (∂L/∂qi) = 0

which gives n second-order differential equations in the elements of q.

We then transform the resulting differential equations into a set of 2n equations by defining y to be the state vector of the system consisting of both positions and velocities, with

370_Figure.png

and subsequently numerically solving the ODE system

y· = f(t, y)

where the first n elements of f return the generalized velocities, and the second n elements compute the generalized accelerations computed by the Euler-Lagrange equation.

TASKS

In class, we examined the case where the "roller coaster" is defined as a function f(x), with the single generalized position coordinate q = x. Unfortunately, this parameterization of the problem is ill-equipped to handle vertical loops (a.k.a. loop-de-loops).

Define an alternative parameterization in terms of a single position coordinate q = u, with both the x- and y-coordinates of the roller coaster given by two parametric functions x(u) and y(u), and derive the corresponding equations of motion by forming the Euler-Lagrange equation for the new system and solving for u·· in terms of the parametric functions and their derivatives.

Design a roller coaster by defining the two functions x(u) and y(u). You should use the cubic spline solver you developed in project 2 to define these functions in order to design your track. Note that you will need to be able to evaluate not only the position of each spline, but also their derivatives.

Your roller coaster must include at least two hills and one vertical loop. Assume that both x and y are expressed in meters, and design your roller coaster to have a plausible physical scale. You should set the initial conditions such that the roller coaster has enough energy to get from u = 0 to the end of the roller coaster.

Simulate your roller coaster by using both Euler's method, a second order method such as Heun's method or the midpoint method, and the fourth order RK method given in Homework 10. Simulate each algorithm using a timestep of 0.01s and 0.001s, for a total of six simulation runs.

Your program should be able to generate animations of the simulation result of each method. To prevent excessively large animations, only produce an animated frame for every fourth step when using 0.01s timesteps, and every 40 steps for 0.001s (i.e., your animations should run in realtime at 25 FPS). You should look at the pendulum_2d_demo.py example in the starter code to see an example animation. Feel free to get creative about what you visualize, but at minimum, I'd like to see a plot of the "car" moving along the track with a unit aspect ratio (so that both x and y are drawn to scale).

WHAT TO TURN IN

You should submit all of your source code along with a PDF write-up addressing the following:

  • Show that your solution to the Euler-Lagrange equation is a generalization of the case we derived in class (or in the _test_roller_coaster_func() method in LagrangianMechanics.py. What are the corresponding functions for x(u) and y(u) in the simpler case?
  • For each numerical integration scheme and step size, produce a plot graphing the kinetic energy, potential energy, and total energy (i.e. their sum) over time. You should have 6 plots with three traces each.
  • Noting that the total energy should be constant over time (since the system is conservative), interpret the plots in terms of the effectiveness of each integration scheme and stepsize.
  • Include remarks on any unexpected or surprising behavior of your simulations, as well as any pitfalls you encountered in implementing this project.

Attachment:- Assignment.zip

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91844662

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As