Modeling the Maximum Range of a Projectile

Students love the “range equation” in introductory physics, but it’s really kind of silly. Here is a better way to calculate the maximum range of a projectile.
sketchesfall14key7
Rhett Allain

I’ve started recreating many of my numerical model tutorials for introductory physics. In the beginning, I had students use spreadsheets to create models. Of course, spreadsheets aren’t very good for this kind of thing but I figured this method was the most accessible to students. Later, I used VPython – which is indeed awesome. The problem with VPython was that the students would have to install multiple things on their own computer to get it to work. Now, I am starting to use GlowScript. I think it’s safe to say that GlowScript is essentially VPython that runs in your web browser. Nothing needed to install.

Perhaps I should define the two types of solutions that I use in class (just so we all agree on the definition).

Analytical Solution: This is a solution that uses algebra and maybe some calculus to solve a problem. You can do an analytical solution with just a paper and pencil (and maybe a calculator).

Numerical Solution: This method solves a problem by breaking into tiny and easier problems. These smaller problems can be broken up into time intervals or displacement intervals. The solution is then determined by the sum of all these tiny problems (usually). You can do a numerical solution with just a paper and pencil (and maybe a calculator). However, I recommend using a computer.

Here is my general strategy for numerical calculation tutorials:

  • Start with a simple introduction to the programming environment. Maybe just show how to draw and add vectors.

  • Do basic projectile motion. With projectile motion, you can check your numerical calculation since this is a problem that is easily solved analytically.

  • Add something like air resistance to projectile motion to show a problem that is essentially impossible to solve analytically.

  • What about springs? Can we model the motion of a mass on a spring? Yes.

  • Do other cool things with a computer.

Here is where I want to go over the “other cool things with a computer” and find the launch angle for projectile motion that gives the highest value of range. Introductory physics students like to call this “THE Range Equation”. They love it and they want to use it all the time even though I tell them that this equation is very dangerous as it doesn’t always apply to their situation. Here is the range equation (and here is an older derivation with more details).

La te xi t 1

Since the sine function gives a value between -1 and 1, the range will be the greatest at an angle of 45 degrees (since sin(90) = 1). Simple, right? Well, it’s not so simple to derive that equation (and introductory students hardly ever need that equation). But how about a different approach?

Finding the Range With a Numerical Calculation

Let me start with the following program in GlowScript:

Glow Script ide

I don’t want to go over all the details, but let me make a few points.

  • In this GlowScript program, I didn’t create a 3d object so that when you run it you don’t get a 3d environment. Why? Why not. I don’t really need the 3d output, I just want a graph.

  • I typically calculate things in terms of forces and momentum. In this case, I instead deal with the velocity and the acceleration since mass doesn’t matter.

  • The structure of the program follows my normal numerical method: calculate the change in velocity and then calculate the change in position. Repeat.

This is the output from the program.

Glow Script ide

No real surprises here. This is what you would expect. If you wanted to stop programming here, you could just manually change the launch angle and record the distance. Keep changing the angle and you would find that you get a maximum distance at 45°.

Using Functions With Numerical Calculations

Who wants to keep running a program with different parameters? Not me. This seems like a job that the computer itself could do – and it can. Here is where I introduce the idea of functions in GlowScript. I have a short tutorial on functions, but let me just jump straight to the fun stuff.

The basic idea is to create a function that takes a launch speed and angle. From that, it will return the distance the projectile traveled before hitting the ground. Here is the function (with a test) to calculate the range of a projectile.

Glow Script ide

Since I have the same initial velocity and angle as the previous program, I should get the same result. Indeed, I do. The output from this exact program is 1.38564. Ok, now for the useful part. All I need to do is to create a loop that goes through different launch angles and then records the final x-position. I’m not going to show you the complete code since I give this as an assignment for my students. However, I can show you the output. In this case, I am going to plot the final position as a function of starting angle. I am going to do with this plotly because it makes nicer graphs.

Projectile Range

Here you can see that the maximum range is indeed at a launch angle of 45°.  Also, this is NOT a parabola showing position vs. time even though it sort of looks like that.  No, this is the horizontal distance the ball travels when shot at a particular angle. I think it’s cool, but you might say “big deal”. I hear you.

Try This With Your “Range Equation”

Now for something different. What if you want to shoot a ball at 4 m/s off a table onto the floor such that the starting height of the ball is 1 meter off the ground? What angle should you launch at to get the best range? Go ahead, use your “range equation” – you will get the wrong answer. With my numerical method, I only change one number – yes, just one and I get the following plot.  

Range vs. Angle (4 m/s launched 1 m above floor) Here you can see that a launch angle of 45° does NOT give the maximum range. No, instead the best angle is at 33° (you can get that by inspecting the graph).

So, what is my point in this post? There are a few, here they are:

  • The “range equation” is highly over rated. It is only valid in one special case so I recommend that students just forget about it.

  • Since students don’t want to forget about it, I show a case where it doesn’t work (launching from a height above the ground).

  • If you make a numerical calculation, you can get a plot of range vs. angle to get the angle of maximum range. The program is essentially the same as the one for on flat ground.

  • Yes, I lied. You don’t actually have to do a numerical calculation to get the distance of the projectile. You could instead make a function that algebraically solves for the final position.

That’s it. If you haven’t used a computer to solve problems, you should. It’s awesome.