The Roller Coaster Problem

The Problem

The roller coaster problem appears as a project after the end of section 3.7 in the text. If you want, you can read the complete problem description there.

We want to design a 'hill' for a roller coaster according to the following specifications.

This problem will provide us with a nice opportunity to take advantage of the power of the Mathematica computer algebra system running behind the DirectMath front end.

The First Solution

We can model the parabolic crest of the hill as an arbitrary second degree polynomial.

Our job is to solve for the coefficients. Since there are three unknown coefficients here, we will need three equations to solve for the coefficients.

The first equation is pretty easy to write down. It simply says that the parabolic segment meets the straight segment without a gap at (0,0).

f[0] = 0

This leads directly to

c = 0

The second two equations say that the slope of the parabola where it meets the straight segments should match the slopes of the straight segments.

or

2 a (0) + b = 0.8

2 a (100) + b = -1.6

This leads to the solution

b = 0.8

c = 0

The solution also tells us exactly where the parabola meets the second segment.

To get a complete description of the curve, we will also need equations for the two straight segments. A line segment with slope 0.8 passing through (0,0) has equation

y = 0.8 x

A line segment with slope -1.6 passing through (100,-40) has equation

or

y = -1.6 x + 120

This leads to a curve

The plot of this curve is shown below.

Problems with this first solution

The first solution certainly looks fine. As you can see from the plot above, the segments appear to meet up in a nice smooth way. There is actually a problem with this solution, though. Physically, the problem is that as you roll over the transition from the first straight segment into the parabola you will feel a sudden 'jerk' that seems to be lifting you up out of your seat. As you roll over the transition from the parabola to the second straight segment you will feel a second 'jerk' that pushes you down into your seat just as the curve flattens out into a straight line.

Mathematically, the source of this jerk is a discontinuity in the second derivative of the curve. Both of the straight segments are segment with constant slope and a second derivative of 0. The parabolic segment has a second derivative equal to

This sudden jump from a second derivative of 0 to a second derivative of -0.024 and back again causes the noticable 'jerk'.

A second solution

To avoid the problems with the discontinuous second derivative, you have to insert a couple of 'transition segments' between the straight segments and the parabola. For these transition segments we are going to use the next simplest possible mathematical curves after parabolas, cubics. We will assume that between x = 0 and x = 10 the curve has a shape given by the cubic

Between x = 90 and x = 100 the curve has a shape given by the cubic

All together, these three polynomials now contain a total of 11 unknown coefficients that we have to solve for. To solve for these coefficients we will need 11 equations. Coming up with 11 equations is not quite as difficult as it seems, because where these segments meet each other we will want the functions and their first and second derivatives to match.

In preparation for writing the equations, we will need to introduce some functions to model the functions and their first and second derivatives.

Here then is the list of 11 equations. The equations essentially say that at each join the relevant functions and their first and second derivatives are the same. The only thing we can't say for certain is the y value of the point where the last curve meets the second straight segment.

(To make the later calculations work out more cleanly, I have written 0.8 as 8/10 and -1.6 as -16/10.) Evaluating all of these equations leads to

This system of equations has the solution

Next, we will want to write down the full solution and plot it. One last thing we need is equations for the two straight segments at either end. As before, the first straight segment has equation

To get the equation of the second straight segment, we use the fact that the second straight segment is a line with slope -16/10 passing through the point (100,h[100])

This is the same equation as before

Here then is the function made up of these five segments.

Substituting for the constants we solved for earlier turns this into

Here is the plot of this function.

Here is a plot of the first and second solutions side by side. The second solution has a slightly higher peak (by about 4 feet). I have adjusted the vertical and horizontal scales to accentuate the differences between the two curves.

Finally, here is a plot of the second derivative of the second solution.

We have replace the jump discontinuities in the original solution with smoother 'ramps'.