Blog

Maximal range of a projectile at height h

I remember entering a design contest at school where we had to make a self propelled vehicle out of toilet rolls, elastic, etc... During that process one of the Physics teachers mentioned that to maximize the range of a projectile one should aim at 45 degrees. This is another story of how a teacher was wrong. It is also the story of how he was right.

So, where does this result come from? Well, I had learned how to derive it in my first year at Uni (I never actually did Physics before that). The initial conditions are that the projectile is launched at a point (let's say the origin) at some initial speed . The final location is thus given by physics as:

Where in Cape Town (thanks Physics 1004W) and

You can then solve the system for an equation in and maximize . I thought that was quite cool, and time passed, and after my 4th year of studying I interned with Oracle. One day we were out at lunch at a golf course where people were hitting these golf balls from a balcony. So there was some height involved. We somehow got onto that topic about 45 degrees being optimal and I remember wondering what the optimal angle was. I worked it out napkin style so that the system now read:

but there is a fair amount of work involved in solving this. So, here I am nearly a year later, and just as I'm about to fall asleep the problem comes creeping back. I somehow realized that one can use that strange thing we learned in 2nd year called "Lagrange multipliers". In this case you want to maximize subject to the constraint . We write:

so you get:

The first equation can be solved for lambda which can be thrown into the second to obtain:

We can then get out of the 3rd equation since it's a quadratic and throw that into this to arrive at:

This is a quadratic in representing negative of positive direction. We know that is positive. Similar for things like by the way. Anyway, we solve for now and obtain:

You can find the angle as if you like but note that its typically smaller than 45 degrees. Something that really sort of struck me initially was that this depends on the initial speed, . I guess it sort of makes sense in hindsight though.

Anyway, there you have it. Lagrange multipliers are still useful for lunch time chat :)

The next thing to look at would be if you let vary. So you could have be some hill or something. Then and the partial derivatives are nice because you get something times in each case. Roughly speaking, I think you can actually do this in general by solving for in equation 3 using and dividing by . You will end up with something a bit nasty though.

You may rather want to consider a numerical scheme or perhaps an evolutionary algorithm like  this which I wrote to evolutionarily solve the Brachistochrone problem... but that's a story for another day.

<< Go back to the previous page