Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 169

Roller Coaster Design

(Adapted from " Design of a Thrilling Roller Coaster," by Patricia W. Hammer, Jessica A. King, and Steve Hammer.)


Siam Park City, Bangkok Dream World, Pathum Thani The boomerang, at Siam Park City

Introduction

The overall objective of this module is to learn how to do some basic, and important, calculus computations in Sage. We will do this via an interesting, real-world application setting, i.e., modeling and designing roller coasters. The basic ideas, data, and strategy used in this exploration are from Hammer et al. ( Design of a Thrilling Roller Coaster).


According to Google reviews, Dream World in Pathum Thani ranks higher than Siam Park City in Bangkok. But, is that because one has better roller coasters than the other?! Is there a way to mathematically determine -- or, even better -- to mathematically design the best roller coasters? In this module we will explore certain aspects of this question.

Model 0: A simple case

We will start with the case of a roller coaster with a single drop (i.e., a single peak and valley).


The photo on the left below is of the Colossus coaster at Six Flags Mountain in Valencia, California. (Image from www.ultimaterollercoaster.com.) We want to model the shape of the track in the form of a function y=f(x)y=f(x), with xx, yy denoting the horizontal and vertical distance (in feet) from some reference point. The sketch on the right shows an example of coordinate locations of the peak and valley of some hypothetical coaster.

Colossus, Valencia, California.
Image from http://www.ultimaterollercoaster.com
Hypothetical peak / valley example
Strategy

Suppose we use a cubic polynomial, say f(x)f(x), for the shape of the track.

                    f(x)=ax3+bx2+cx+df(x)=ax^3 + bx^2 + cx + d.

                    The four unknown coefficients aa, bb, cc, dd must be determined using 4 conditions we want the track to satisfy. For example:

                    f(5)=50    (peak location)f(5)=0    (0 slope @ peak)f(65)=5    (valley location)f(65)=0    (0 slope @ valley)\begin{array}{l} f(5)=50 ~~~~ \mbox{(peak location)} \\ f^\prime(5)=0 ~~~~ \mbox{(0 slope @ peak)} \\ f(65)=5 ~~~~ \mbox{(valley location)} \\ f^\prime(65)=0 ~~~~ \mbox{(0 slope @ valley)} \end{array}

What system of 4 equations do these conditions yield? How do you solve them?

We want Sage to do all that work for us. But it is still useful to know exactly what Sage will be doing.

# Sage code to find shape of cubic roller coaster track # with given peak and valley coordinates. a, b, c, d = var('a b c d') # Declare the coefficients as variables. f(x) = a*x^3 + b*x^2 + c*x + d # Define a general cubic polynomial for the track shape. df = derivative(f,x) # Ask Sage to find its 1st derivative. # The next command sets up the 4 equations and asks Sage # to solve for a, b, c, d. # A dictionary containing the solutions is retuned in results[0] # results = solve([f(5) == 50, df(5) == 0, f(65) == 5, df(65) == 0], (a, b, c, d), solution_dict=True) # Next, we plot the solution and see what it looks like # plot( ((1/2400)*x^3 + (-7/160)*x^2 + (13/32)*x + 4705/96), (x,0,75)) plot( ((results[0][a])*x^3 + (results[0][b])*x^2 + (results[0][c])*x + results[0][d]), (x,0,75))
But, is this coaster สนุก สุดสุด?!!


Hammer et al. define the thrill of a coaster as follows: "The thrill of a drop is defined to be the angle of steepest descent in the drop (in radians) multiplied by the total vertical distance in the drop. The thrill of the coaster is defined as the sum of the thrills of each drop."

Using this definition, compute the thrill of the drop in the above example. How?
Step 1: Find the maximum value of f|f^\prime| on the interval   (this will be the slope of steepest descent)
Step 2: Angle of steepest descent = arctan (slope of steepest descent)
Step 3: Multiply angle by vertical distance between peak and valley


Again, we want Sage to do most of the work, but we must understand what work needs to be done.
Here's how to do Step 1, from Hammer et al:

"How do we maximize ff^\prime on a closed interval? We determine critical points of ff^\prime and then compare function values of ff^\prime at critical points and endpoints. The critical points of ff^\prime are found by solving f(x)=0f^{\prime\prime}(x)=0 on the restricted xx interval. Finally we evaluate f(x)f^\prime(x) at all critical points and endpoints and choose the maximum value."

# Define f(x): f(x) = (results[0][a])*x^3 + (results[0][b])*x^2 + (results[0][c])*x + results[0][d] fp = derivative(f,x) # Derivative of f fpp = derivative(fp,x) # Derivative of f' = 2nd derivative of f resultnew = solve([fpp == 0], x, solution_dict=True) # Find critical points of f' # A dictionary containing the solutions is retuned in resultnew[0] print "Critical point(s) of f' at: x =", resultnew[0][x] thrill = arctan( abs( fp(resultnew[0][x]))) * (50-5) # Compute thrill using its definition. # Note that arctan of slope = angle in radians. print "thrill=", thrill.n()
Critical point(s) of f' at: x = 35 thrill= 37.9869293750927
Exercise


Shown below are two real-world coasters, together with data on the coordinates of peak and valley for a single drop. Determine which drop is more thrilling.

Colossus, Valencia, California.
Image from http://www.ultimaterollercoaster.com
Peak @ (165 ft, 280 ft); valley @ (372 ft, 88 ft)
Steel Dragon 2000, Nagashima, Japan.
Image from http://www.coastergallery.com
Peak @ (224 ft, 309 ft); valley @ (469 ft, 79 ft)
Some extensions
It is fairly straightforward to consider other types of functions, instead of cubic polynomials, for modeling the track shape. For example, consider the following trigonometric function with 4 parameters: f(x)=acos(bx+c)+df(x)=a\cos(bx+c)+d
If we know the coordinate locations of the peak and valley, the 4 parameters can be found using a strategy very similar to that of the cubic case. Try it now for the example with peak at (5 ft, 50 ft) and valley at (65 ft, 5 ft). How does the value of its thrill compare with that of the cubic case?

How about if we want to use a 5th order polynomial like: ax5+bx4+cx3+dx2+ex+fax^5 + bx^4 + cx^3 + dx^2 + ex +f?
Is it possible? We have 6 unknown parameters here. How do we find them? Think about it!

Another direction of extension is to look at roller coasters with more than 1 drop. Recall that the thrill of a roller coaster is the sum of the thrills of each drop. Thus, a coaster with multiple drops may be more thrilling than one with only a single drop. Modeling multiple drops is similar -- you just have to find a function for the shape of each part of the track separately.
Calculus computations learned so far
  • How to define a function: e.g., f(x) = x^2 - x*sin(x)
  • How to find its derivative: e.g., derivative(f,x)
  • How to find its 4th derivative: e.g., derivative(f,x,4)
  • How to find critical points: e.g., fp = derivative(f,x); solve([fp == 0], x)
  • How to minimize/maximize f
Here are a few more calculus operations that are easy to do with Sage:

  • Find limit of a function: e.g., limit(f, x=0); limit(f, x=-1)
  • One-sided limits: e.g., limit(f,x=2,dir="plus"); limit(f,x=2,dir="minus")
  • Compose two functions: e.g., f(x)=e^(-x)*(x^2); g(x)=(x^2)*cos(x); f(g(x)); g(f(x))
  • Limits of difference quotients: e.g., h = var('h'); limit((g(x+h)-g(x))/h, h=0)
  • Indefinite integrals: e.g., integral(f,x)
  • Definite integrals: e.g., integral(f,x,-1,1)