E. Design and Thrill of a Straight Stretch Coaster using Polynomial Functions
In this Maple worksheet, we build a roller coaster using n peak and valley points. Our approach is to determine (n-1) cubic polynomials that connect these points and then to calculate the angle of steepest descent/ascent of each hill and resulting thrill factor for the coaster..
I. Getting Started
We clear all variables. To avoid multiple solutions, we set the maximum number of solutions variable equal to 1.
> | restart: |
> | _MaxSols:=1: |
II. Data Points
We enter the number of peak and valley points (n) and the x coordinates (xdata), y coordinates (ydata) and slope conditions (slopes) for these points.
In this example , the first peak is at (0,75) then a vally at (50,0), then another peak at (100,50) and the last valley is at (200,0). Also, since all points are either peak or valley points, then all slope conditions will be zero.
In your work, you should use the collected peak and valley data points from several hills of the Greyhound (Module A).
> | n:=4: |
> | xdata:=[0,50,100,200]: |
> | ydata:=[75,0,50,0]: |
> | slopes:=[0,0,0,0]: |
III. Connecting Cubic Polynomials
In this example, we have 4 peak and valley data points. So we must determine 3 (f1,f2,f3) connecting cubic polynomials. We do this by simply repeating the approach taken in module C three times. We determine cubic polynomials of the form f(x) = that connect consecutive peak and valley points. The following Maple code may easily be incorporated into a "do" loop.
For f1(x):
> | f1:=x->a1*x^3+b1*x^2+c1*x+d1; |
> | f1p:=D(f1); |
> | s1:=fsolve({f1(xdata[1])=ydata[1],f1p(xdata[1])=slopes[1],f1(xdata[2])=ydata[2],f1p(xdata[2])=slopes[2]},{a1,b1,c1,d1}); |
> | assign(s1); |
> | f1:=x->a1*x^3+b1*x^2+c1*x+d1; |
> | tplot1:=plot(f1(x),x=xdata[1]..xdata[2]): |
For f2(x):
> | f2:=x->a2*x^3+b2*x^2+c2*x+d2; |
> | f2p:=D(f2); |
> | s2:=fsolve({f2(xdata[2])=ydata[2],f2p(xdata[2])=slopes[2],f2(xdata[3])=ydata[3],f2p(xdata[3])=slopes[3]},{a2,b2,c2,d2}); |
> | assign(s2); |
> | f2:=x->a2*x^3+b2*x^2+c2*x+d2; |
> | tplot2:=plot(f2(x),x=xdata[2]..xdata[3]): |
For f3(x):
> | f3:=x->a3*x^3+b3*x^2+c3*x+d3; |
> | f3p:=D(f3); |
> | s3:=fsolve({f3(xdata[3])=ydata[3],f3p(xdata[3])=slopes[3],f3(xdata[4])=ydata[4],f3p(xdata[4])=slopes[4]},{a3,b3,c3,d3}); |
> | assign(s3); |
> | f3:=x->a3*x^3+b3*x^2+c3*x+d3; |
> | tplot3:=plot(f3(x),x=xdata[3]..xdata[4]): |
Now we display the three connecting polynomials.
> | with(plots): |
Warning, the name changecoords has been redefined
> | display(tplot1,tplot2,tplot3); |
The coaster plot looks good. It matches the peak and valley points.
IV. Calculation of Angle of Steepest Descent/Ascent
We need to determine the angles of steepest ascent/descent for each of the three connecting polynomials. We use what we learned from part VI module C (i.e., for these functions , the x coordinate of the point of steepest ascent/descent is the x coordinate of the midpoint between the peak and valley points).
For f1(x):
> | mdpt1:=.5*xdata[1]+.5*xdata[2]; |
> | slope1:=abs(f1p(mdpt1)); |
> | rangle1:=arctan(slope1); |
> | dangle1:=evalf(rangle1*180/Pi); |
The radian measure (for thrill) is 1.15 and the degree measure (for safety) is 66.
For f2(x):
> | mdpt2:=.5*xdata[2]+.5*xdata[3]; |
> | slope2:=abs(f2p(mdpt2)); |
> | rangle2:=arctan(slope2); |
> | dangle2:=evalf(rangle2*180/Pi); |
The degree measure (for safety) is 56.
For f3(x):
> | mdpt3:=.5*xdata[3]+.5*xdata[4]; |
> | slope3:=abs(f3p(mdpt3)); |
> | rangle3:=arctan(slope3); |
> | dangle3:=evalf(rangle3*180/Pi); |
The radian measure (for thrill) is .64 and the degree measure (for safety) is 37.
V. Safety Restrictions and Thrill Factor
Safety Criteria
For this coaster, the maximum angle of steepest descent/ascent is 66 degrees which is less than 80 degrees and so the coaster is SAFE.
Thrill Factor
Now we calculate the thrill for each of the two drops (not of each hill) and the thrill of the coaster
For first drop:
> | thrill1:=rangle1*(ydata[1]-ydata[2]); |
For the second drop(third piece):
> | thrill2:=rangle3*(ydata[3]-ydata[4]); |
And the total thrill is
> | thrill1+thrill2; |
> |
VI. Coaster Design
A. Build another straight stretch trig coaster using the collected data points from The Devil (Module A).
B. Build another straight stretch trig coaster using the collected data points from Shivering Timbers (Module A).
C. Keeping in mind the coaster restrictions, design your own trig coaster by modifying the Maple code given above. Your design should be creative, interesting, and as thrilling as possible.