︠56987bb3-bca1-4a11-997e-2803485c638ci︠ %hide %html

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. ︡0e261e04-2b3b-4c96-9603-f59addaeccf9︡{"hide":"input"}︡{"html":"\n

\nRoller Coaster Design\n

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


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

Introduction

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


\n According to Google reviews, Dream World in Pathum Thani \n ranks higher than Siam Park City in Bangkok. But, \n is that because one has better roller coasters than the other?! \n Is there a way to mathematically determine -- or, even better -- \n to mathematically design the best roller coasters? \n In this module we will explore certain aspects of this \n question."}︡{"done":true}︡ ︠bfcefe67-c2c1-4a42-b44f-0126bad00f69i︠ %hide %html

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)$, with $x$, $y$ 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)$, for the shape of the track.

                    $f(x)=ax^3 + bx^2 + cx + d$.

                    The four unknown coefficients $a$, $b$, $c$, $d$ must be determined using 4 conditions we want the track to satisfy. For example:

                    $\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. ︡4dfd41b4-06c4-439a-bac1-649ded61aeb8︡{"hide":"input"}︡{"html":"\n

\n Model 0: A simple case\n

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


\n\nThe photo on the left below is of the Colossus \ncoaster at Six Flags Mountain in Valencia, California. \n(Image from www.ultimaterollercoaster.com.)\nWe want to model the shape of the track in the form of a \nfunction $y=f(x)$, with $x$, $y$ denoting the horizontal and \nvertical distance (in feet) from some reference point. The \nsketch on the right shows an example of coordinate locations \nof the peak and valley of some hypothetical coaster.\n\n\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Colossus, Valencia, California.\n
Image from http://www.ultimaterollercoaster.com\n
\n Hypothetical peak / valley example\n
\n\nStrategy

\n\nSuppose we use a cubic polynomial, say $f(x)$, \nfor the shape of the track.

\n \n                   \n$f(x)=ax^3 + bx^2 + cx + d$.

\n                   \nThe four unknown coefficients \n$a$, $b$, $c$, $d$ must be determined using 4 conditions we want \nthe track to satisfy. For example:

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

\n \nWhat system of 4 equations do these conditions yield? \nHow do you solve them?

\nWe want Sage to do all that work for us. But it is still \nuseful to know exactly what Sage will be doing. "}︡{"done":true}︡ ︠35313bb4-e1f8-4de7-86cf-6986075d5e6bs︠ # 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)) ︡215a8309-7278-4ef8-aeb8-129f36016d41︡{"file":{"filename":"/projects/5af60d30-8ee0-4c83-b7d2-6a0b68f44907/.sage/temp/compute3-us/13636/tmp_DlAiPT.svg","show":true,"text":null,"uuid":"dc3e286a-135b-4a39-8511-409c46412f8e"},"once":false}︡{"done":true}︡ ︠b684b439-7537-4090-b621-a28457179d91i︠ %hide %html 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^\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 $f^\prime$ on a closed interval? We determine critical points of $f^\prime$ and then compare function values of $f^\prime$ at critical points and endpoints. The critical points of $f^\prime$ are found by solving $f^{\prime\prime}(x)=0$ on the restricted $x$ interval. Finally we evaluate $f^\prime(x)$ at all critical points and endpoints and choose the maximum value." ︡df437482-edf0-48f0-a3e7-d10e0369d612︡{"hide":"input"}︡{"html":"\nBut, is this coaster สนุก สุดสุด?!!\n


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

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


\nAgain, we want Sage to do most of the work, but we \nmust understand what work needs to be done.
\nHere's how to do Step 1, from Hammer et al:

\n\"How do we maximize $f^\\prime$ \non a closed interval? We determine critical points of $f^\\prime$ and then \ncompare function values of $f^\\prime$ at critical points and endpoints. The \ncritical points of $f^\\prime$ are found by solving $f^{\\prime\\prime}(x)=0$ on the restricted \n$x$ interval. Finally we evaluate $f^\\prime(x)$ at all critical points \nand endpoints and choose the maximum value.\"\n"}︡{"done":true}︡ ︠6098ffcc-7b69-46e3-9842-238d2b17a448s︠ # 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() ︡8445726f-f59d-4a41-84e8-30c5e378f152︡{"stdout":"Critical point(s) of f' at: x = 35\n"}︡{"stdout":"thrill= 37.9869293750927\n"}︡{"done":true}︡ ︠74dfeb8a-a4e4-497f-967c-c0960b19a768i︠ %hide %html 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)
︡9a6cc3d5-5ead-4e5a-96ff-546996a4c1d3︡{"hide":"input"}︡{"html":"\nExercise\n\n


\nShown below are two real-world coasters, together with data on the \ncoordinates of peak and valley for a single drop. Determine \nwhich drop is more thrilling.\n \n\n \n \n \n \n \n \n \n \n
\n \n \n \n
Colossus, Valencia, California.\n
Image from http://www.ultimaterollercoaster.com
\n Peak @ (165 ft, 280 ft); valley @ (372 ft, 88 ft)\n
Steel Dragon 2000, Nagashima, Japan.\n
Image from http://www.coastergallery.com
\n Peak @ (224 ft, 309 ft); valley @ (469 ft, 79 ft)\n
"}︡{"done":true}︡ ︠766c9c48-5a16-4055-b806-975618502306i︠ %hide %html

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)=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: $ax^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. ︡866da094-cc46-49a2-8146-a0e096e5ca29︡{"hide":"input"}︡{"html":"\n
\nSome extensions\n
\n\nIt is fairly straightforward to consider other types of functions, \ninstead of cubic polynomials, for modeling the track shape. \nFor example, consider the following trigonometric function \nwith 4 parameters: $f(x)=a\\cos(bx+c)+d$
\nIf we know the coordinate locations of the peak and valley, the \n4 parameters can be found using a strategy very similar to \nthat of the cubic case. Try it now for the example with peak \nat (5 ft, 50 ft) and valley at (65 ft, 5 ft). How does the value \nof its thrill compare with that of the cubic case?

\n\nHow about if we want to use a 5th order polynomial like: \n$ax^5 + bx^4 + cx^3 + dx^2 + ex +f$?
\nIs it possible? \nWe have 6 unknown parameters here. How do we find them? Think \nabout it!

\n\nAnother direction of extension is to look at roller \ncoasters with more than 1 drop. Recall that the thrill of \na roller coaster is the sum of the thrills of each drop. \nThus, a coaster with multiple drops may be more thrilling \nthan one with only a single drop. Modeling multiple drops \nis similar -- you just have to find a function for the shape \nof each part of the track separately.\n"}︡{"done":true}︡ ︠5eab18c3-fa3c-4040-88b1-794142b8dbc6i︠ %hide %html
Calculus computations learned so far
Here are a few more calculus operations that are easy to do with Sage:

︡0b51f7ef-8dd6-45b0-9590-c698e32a57cc︡{"hide":"input"}︡{"html":"\n
\nCalculus computations learned so far\n
\n\n\n \nHere are a few more calculus operations that are easy to do with Sage:

\n"}︡{"done":true}︡ ︠04c718be-8c28-446f-a99a-c572b0adeb5doi︠ # 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 solve([f(224) == 309, df(224) == 0, f(469) == 79, df(469) == 0], (a, b, c, d)) ︡6bf48368-9a8d-4c86-91a4-c2dd5953ecd7︡{"stdout":"[[a == (92/2941225), b == (-13662/420175), c == (591744/60025), d == (-5310901/8575)]]\n"}︡{"done":true}︡ ︠0ca516f8-d597-4bd8-8c81-b1859ee7e228io︠ # Define f(x): f(x) = (92/2941225)*x^3 + (-13662/420175)*x^2 + (591744/60025)*x + -5310901/8575 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' print "Critical point(s) of f' at: x =", resultnew[0][x] thrill = arctan( abs( fp(resultnew[0][x]))) * (309-79) # Compute thrill using its definition. # Note that arctan of slope = angle in radians. print "thrill=", thrill.n() ︡caf993ca-5e8a-45fb-aff6-f414b32caf52︡{"stdout":"Critical point(s) of f' at: x = 693/2\n"}︡{"stdout":"thrill= 219.257639928999\n"}︡{"done":true}︡