Examine the case where roller coaster is defined as function

Assignment Help Computer Engineering
Reference no: EM131097933

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

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


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).


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


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.


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).


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

Reference no: EM131097933

Determine a good asymptotic upper bound

Determine a good asymptotic upper bound on the recurrence - write a comment between each pair of lines describing what is true when the program reaches that point in the code.

Transmitting image through raster scan

If we were to transmit this image utilizing the raster scan order, after 15 seconds how many rows of image will the user have received? To what fraction of the image does th

What model should dsi adopt for a cloud-based osds

What model should DSI adopt for a cloud-based OSDS? How should DSI assess the risk of adopting a cloud-based OSDS? What steps should DSI take to provide adequate security for

How many assembly fixtures do we need

Utilization of the sub-assembly stations and the inspection station. Which one is the bottleneck of the process - What is the production rate of auto assemblies per hour and M

The pros and cons of using sessions

What are the advantages and disadvantages of using cookies? What are the advantages and disadvantages of using sessions? Is one more secure than the other and why?

How many cars in every team called chevy and ford

How many cars in every team called Chevy and Ford There are eight cars in every team called Chevy and Ford. One car from each team races its opponent on drag strip.

Identify the cost drivers that affect the development time

Estimate the cost in labor months of developing a complete software system that will be used by mechanical engineers to model thermal effects on engine parts. The program re

Examine the physical data model that you created

Examine the physical data model that you created in question F. Develop a clustering and indexing strategy for this model. Describe how your strategy will improve the perfor


Write a Review

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd