# Trajectory

A couple of weeks ago, I followed a link to this article by Alejandro Tauber that purported to calculate how far you’d be flung from an amusement park ride called the Booster Maxxx. The article had achieved some popularity through a link on Boing Boing from the usually reliable Maggie Koerth-Baker. Given that this is the internet and that the article was written by a guy who thinks the ability to do high school physics is a sign of mad nerd skillz, you will not be surprised to find that the analysis was wrong. I spent a few minutes redoing the problem,1 thought about writing a snarky post, but moved on to something else. It didn’t seem worth the effort.

But I kept thinking about the problem and how my solution would have been different if I’d done it at different times of my life. Which reminded me of James Burke and his wonderful science history series, Connections and The Day the Universe Changed. I was also reminded of a conversation I had with an older faculty member back in my teaching days. So I decided to write the post with a somewhat different emphasis.

Let’s start with the problem. A large, two-armed ride called the Booster Maxx swings its riders around in a circle at tangential speeds of up to 145 kph. The goal is to figure out the farthest horizontal distance a rider would be flung if something went wrong.

We’re going to make the usual assumptions made in introductory physics courses:

• Air resistance (or assistance if there’s a tail wind) is negligible. This eliminates at lot of interesting but tricky complications. In real ballistics problems—in military applications, for example—you can’t ignore drag, but those problems typically have a projectile with a well-defined shape that helps in determining the drag coefficient. A person launched from an amusement park ride doesn’t.
• The arm moves at a constant angular speed. This probably isn’t a terrible assumption, as the arm should be pretty well balanced.
• Any complications that might retard the initial release of the rider from the end of the arm—like bolts breaking in sequence instead of simultaneously—will be ignored.

There’s nothing wrong with making these assumptions. Even if we were going to continue on with a more detailed analysis, it would probably be worthwhile to run out a quick initial calculation under these simplified conditions.

The rider will start his flight in a direction tangent to the arm, and there is a particular angle of the arm that will lead to the farthest distance traveled. Here’s the first mistake Tauber makes:

According to the internet, the ideal angle to launch a catapult is 45 degrees. So let’s go with that.

You’ve probably heard the 45° story, too, and it’s true under certain conditions, but not the conditions we have here. It works only when the elevation at which the projectile is launched is the same as the one at which it lands. And we don’t need to rely on the authority of “the internet”—we can prove it for ourselves. It’ll be a good warmup for the Booster Maxxx problem.

Let’s launch our projectile from ground level with an initial velocity of $v_0$ at an angle $\theta$ up from the horizontal.

In the absence of air resistance, the horizontal component of velocity is constant,

The vertical component starts out at $v_0 \sin \theta$ in the upward direction but the downward acceleration due to gravity, $g$, changes the upward velocity linearly with time,

Putting the origin of our coordinate system at the starting point of the projectile, the equations for its position at any given time are

When the projectile hits the ground, $y = 0$, so we substitute that in and solve the second equation

There are two solutions. The trivial solution is $t = 0$, which is when the projectile is at ground level at the start. The more interesting solution is

Plugging this into the expression for $x$, we get the horizontal position when it hits the ground,

This is the horizontal distance traveled. What value of $\theta$ maximizes it? We could use calculus, but there’s an easier way if you remember this trigonometric identity:

We can use this to rewrite the expression for horizontal distance as

Since $\sin$ is a maximum at 90°, $x$ must be a maximum when $\theta$ is 45°. Boom.

On to the Booster Maxxx, where the motion is similar but starts at a higher elevation.

The expressions for the horizontal and vertical components of velocity are the same as before, as is the expression for the horizontal distance traveled; but because the starting point of our trip is up at the end of the ride’s arm, the expression for the vertical position is more complicated.

In this expression, $r$ is the radius of the Booster Maxx, which Tauber says is 27.5 meters. This expression includes the implicit assumption that the riders scrape along the ground when the arm is at its lowest point, which is obviously not correct, but since Tauber doesn’t provide us with that vertical offset we’ll stick with this expression.

Note that by keeping $\theta$ defined as the angle up from the horizontal of the initial velocity vector (for consistency with our previous solution), we are implicitly also defining it as the angle down from the vertical of the Booster Maxxx’s arm.

As in the simpler problem, we want to solve this expression for $t$ when $y = 0$. The quadratic formula comes in handy, giving us two answers that can be collapsed into a single expression with a plus-or-minus sign:

The square root term is clearly larger than $v_0 \sin\theta$ so the solution that uses the minus sign will give us a $t$ less than zero. This may seem like a silly result, but if we imagine a trajectory that started at the ground and reached the position of the arm at a matching speed and angle, this negative value represents the time that flight would take from the ground up to the arm.

But we are clearly more interested in the solution with the plus sign. Plugging that value of $t$ into the expression for $x$, we get

Notice, by the way, that if we got rid of the term with $r(1 + \cos \theta)$, we’d have the solution to the simple problem we did first.

So now it’s time to figure out the maximum value for this expression. The values of $v_0$, $r$, and $g$ are all fixed, so the only variable is $\theta$.

When I was in college, with the lessons of calculus fresh in my mind, my first instinct would have been to differentiate the expression with respect to $\theta$, set the result equal to zero, and solve for $\theta$. That would have been a tremendous pain in the ass, and because the expression for $x$ is so complicated, it would have almost certainly left me with an equation for $\theta$ that didn’t have a closed-form solution. I’d have to resort to a numerical technique to solve for $\theta$.

Of course, when I was in college I didn’t own a computer (or even a graphing calculator, for that matter). Now that I do my sense of the best way to go about finding the maximum $x$ has changed.

First, I could make a quick plot of $\theta$ vs. $x$ to get a sense of the maximum $x$ and the value of $\theta$ associated with it. It helps slightly to rearrange the expression for $x$ this way:

The advantage of writing it this way is that every term except the leading $v_0^2/g$ is nondimensional. Note that the ratio $r g/ v_0^2$ is nondimensional, as is $\theta$. Putting as many things as possible in nondimensional form is often helpful when plotting or doing numerical solutions.

Using the plot command I wrote a few months ago, with $v_0 = 40.3\;\mathrm{m/s}$, $g = 9.81 \;\mathrm{m/s^2}$, and $r = 27.5\; \mathrm{m}$,

plot '40.3**2/9.81*cos(pi*x/180)*(sin(pi*x/180) + sqrt(sin(pi*x/180)**2 + (2*9.81*27.5/40.3**2)*(1 + cos(pi*x/180))))' 30 45 > projectile.png


we get the following graph,

which tells us that the maximum distance is a little over 209 meters and would occur with a $\theta$ of about 37°. If we wanted more precision, we could zoom in near the peak of the curve and pick out more accurate values. You could make the graph in a spreadsheet if you wanted to. My sons would probably use their graphing calculators. Whatever’s convenient and familiar.

Taking a different approach, we could use one of SciPy’s numerical methods to get the maximum directly. SciPy doesn’t have a maximize function, but it does have the minimize_scalar function in the optimize library. All we have to do is minimize the negative of our expression for $x$. Interactively in IPython, that looks like this:

In [1]: from scipy.optimize import minimize_scalar

In [2]: def fn(x):
...:     return -40.3**2/9.81*cosd(x)*(sind(x) + sqrt(sind(x)**2 + (2*9.81*27.5/40.3**2)*(1 + cosd(x))))
...:

In [3]: minimize_scalar(fn)
Out[3]:
fun: -209.0983365231974
nfev: 11
nit: 10
x: 36.934987114574426


This matches what we found through plotting. If you’re more familiar with MatLab, Octave, or Julia, you could use the similar functions they have.

Neither of these methods were widely available when I was in college. There were plotting routines and numerical methods libraries, but they were on mainframes, not at your desk in front of you. The graphs I made for class were plotted point by point on graph paper.

Even as personal computers became commonplace, the software environment remained rudimentary. Too much programming and not enough solving. It took time for interactive tools for solving problems like this to develop.

(By the way, given that my answer of 209 meters is only 5 meters more than the value Tauber calculated, you might question the value of all this extra work. In fact, as you can see from the graph, you could assume any release angle from about 29° to 45° and get within about 5 meters of the correct result. But the only way to know that is to do the problem correctly.2)

What does this have to do with James Burke? In one of his programs,3 Burke was talking about the development of calculus and suggested that Newton might never have developed calculus if he’d had a computer that could do numerical differentiation and numerical integration. I’ve been fascinated by that idea ever since. Put aside the question of whether computers could have been developed in the absence of calculus—if you have a device that can do the necessary sums and differences to mimic calculus with sufficient precision, do you need calculus anymore? For this problem, and many others I need to solve for my job, I jump to a numerical solution much faster than I would have thirty years ago.

The conversation with my older colleague, David, had a similar theme. We were talking about a nonlinear dynamics problem (as you do), and I mentioned that I’d solve the governing differential equation through a predictor-corrector or Runge-Kutta solver—both of which are numerical methods that require a computer.4 He thought that was interesting because those solution techniques would never have occurred to him. Being of an older generation, his first instincts would have been to try a perturbation method or an asymptotic expansion. A few weeks later, David had an SE/30 and was teaching himself how to do numerical analysis in Excel.

I’m approaching the age David was when we had that conversation, and I see how easy it is to stick with what I already know. His interest in and acceptance of new ideas is a constant reminder to remain flexible.

1. Turns out™ I made my own mistake in that first attempt at a solution, and there may still be another lurking in what follows. Calling out the errors of others always leaves you open to your own embarrassment.

2. Actually, I’m not sure how Tauber got the correct value of 204 meters for a 45° launch angle. He got the elevation of the release point wrong, the horizontal distance to reach that same elevation on the way down wrong, and the horizontal movement from that point to the ground wrong. He doesn’t show his work, so I can’t figure out how three wrongs made a right.

3. Sorry, I don’t remember which program or episode. It’s been a long time.

4. I didn’t have easy access to numerical libraries like SciPy in those days, but I was used to programming certain techniques from scratch. That skill, like my ability to do calculus, has gotten rusty over the years.