Math 272 - Roller Coaster Project

Math 272 - Roller Coaster Project - Animation
Goal
To use the differential equation model for the motion of the roller coaster car, and our earlier ballistics work, to create an
animation of the car as it runs on the track and then launches into the air.
This phase will use the track defined in AnimationCoordinates.csv, which holds x and y positions of the track supports
in two columns.
The AnimationScript.m provided on the Projects page will load the support locations and plot the track; it also sets the
value of m (car mass), µ (friction coefficient), and the motor force and motor time span.
Deliverables
The Animation Deliverable is a .zip archive containing MATLAB .m files and any other supporting files (graphics/text/Excel
files); one of the .m files must be a script that, when run, will present the animation on the screen.
You are encouraged to test your animation, and to verify whether all the necessary files have been included in the .zip
archive, by unzipping your archive in a new/empty directory and trying to run the main animation script. Please do this at
least once before your final submission to avoid delays in grading your animation.
Reminder: unlike Phases 1 and 2, you will only submit the Animation for grading once. The grading system is explained
later in this document. Re-submissions will be allowed only in the case of technical issues (e.g. files missing from the
submission.)
Minimum Requirements
The animation must have or show:
• The track visible at all times, but with the supports invisible;
• A consistent viewing window used throughout the whole animation;
• Consistent time steps between the frames, both during the on-track and in-air motion;
• A smooth transition from the on-track to in-air portions of the animation;
• Text indicating velocity and angle of the launch at the launch point, appearing at the moment of launch;
• Text indicating the impact location, appearing at the moment of impact.
• A visual indication of when the motor force is acting on the car.
1
Optional Extensions
Additional details that could be added to the animation include (but are not limited to)
• Informative text appearing at specific events;
• Additional detail on the car;
• Some indication of the velocity, beyond the motion implied by the animation.
• Additional graphics for the application of the motor force.
• A stopwatch indicating the current time in the simulation.
Phase 3 Details
You must read the Background document on this project before beginning, and have completed Phase 2.
The animation should be constructed in two steps:
1. first by simulating the motion along the track using ode45 1 , and then
2. separate calculations of the position over time during the post-launch flight.
The transition between the two simulations can be made by using ODE “events” to stop the on-track simulation at the
end of the track (see Week 9, Lecture 3).
At the end of the on-track simulation, your matrix w will have as its last line the final track (x, y) and (x0 , y 0 ) values;
these now represent the launch position and launch velocities. That information defines a parabolic trajectory, which you
can animate using the same-sized time steps you used for the ode45 simulation2 .
Refer to the “MATLAB Exercises” handout from Week 6 for how to create animations in MATLAB.
Additional MATLAB Graphing Tools
You may find the following MATLAB graphing commands useful.
• The following will open a window of fixed size (here, 800×600).
figure(’OuterPosition’,[1, 100, 800, 600]);
% 800x600 is dimension of window;
%(1,100) is location of bottom-left corner, relative to bottom left of screen
Using a fixed window size can be useful, as it allows you to standardize the position of any annotations, font sizes, etc.
and guarantees that when your animation is displayed on another computer the layout will look the same.
• The text and title commands can be used with sprintf to put formatted text on the plot. E.g.
title( sprintf(’Temp = %.2f deg’, T) );
text(2, 4, sprintf(’Beam 2 is under a tension force of = %.1f Newtons’, F(2))
);
• quiver(x, y, u, v) plots an arrow, based at (x, y), with (u, v) as the direction vector.
• plot(x, y, ’Color’, [.8 .8 .8]); plots a graph in light gray. The color is determined using a 3-valued vector for
the [red green blue] color amounts, where the value of each color lies between 0 and 1. e.g. [1 1 1] represents white,
[0 0 0] is black, [1 0 0] is pure red, [.8 .8 .8] is a light gray.
• The command caxis can be used to set the scale for the color assignment in a pcolor plot, much like xlim and ylim
set the scale for the horizontal and vertical range on a graph.
Grading
• Any animation which satisfies the minimum requirements will receive a grade of 7/10.
• Errors in computation will be penalized: the priority for the animation is that it reflect the scientific model correctly.
1 Look
2 You
up tspan within the ode45 Help documentation to see how to get evenly-spaced time steps out of the ODE simulation.
can ignore air resistance during the flight portion of the simulation.
2
• Each missing requirement will result in a penalty, roughly 1/10 per missing feature.
• Adding additional details or elements, or approaching the minimum requirements with more creativity, will make up
the other 3 marks (usually 0.5 or 1 for each additional feature). Think about what you would find both compelling and
informative in an animation for this scenario.
Academic Integrity
Submissions for each group should be unique. If two groups submit identical work, or work that varies only in the simplest
way (e.g. moving the location of text), it will be reviewed for possible breaches of academic integrity. There is significant
room for creativity in this part of the project, and it is expected that some feature will distinguish each group’s work.
3