Reference no: EM131097933
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](https://secure.expertsmind.com/CMSImages/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
Identify one ethical dilemma and explain how a deontological
: Identify one ethical dilemma and explain how a deontological ethicist, consequentiality, and a virtue ethics philosopher would deal with this dilemma.
|
Common-size statement value of inventory
: A firm has sales of $1,230, net income of $181, net fixed assets of $548, and current assets of $272. The firm has $90 in inventory. What is the common-size statement value of inventory?
|
Most significant costs for for-profit colleges
: Identify three of the most significant costs for for-profit colleges and discuss (in the short run) how the magnitude of each cost type affects (i) profits, (ii) equilibrium enrollment and (iii) for-profit colleges’ decisions about whether to enter o..
|
Strategic plan or a financial plan
: When considering either a strategic plan or a financial plan, do you need to consider this concept? Why could it be helpful?
|
Examine the case where roller coaster is defined as function
: E19: Numerical Methods for Engineering Applications Spring 2016 - PROJECT 5. 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 paramet..
|
Question regarding the net working capital
: A firm has net working capital of $358, net fixed assets of $2,374, sales of $6,000, and current liabilities of $800. How many dollars worth of sales are generated from every $1 in total assets?
|
Question regarding the market risk premium
: A share of stock with a beta of .83 now sells for $61. Investors expect the stock to pay a year-end dividend of $3. The T-bill rate is 6%, and the market risk premium is 9%.
|
Discuss some of the benefits of using group policy
: Pick on of the policy that is available in Windows 2012 Server and explain it. Why do you think this policy is an important one to implement in an organization? Discuss some of the benefits and disadvantages of using group policy in an organizati..
|
Investors expectation of the price
: If the stock is perceived to be fairly priced today, what must be investors' expectation of the price of the stock at the end of the year? (Do not round intermediate calculations. Round your answer to 3 decimal places.)
|