# How to find the optimal launch trajectory for a rocket launched from a planet with an atmosphere?

I originally asked this question on maths stack exchange

As the title states I am trying to find the optimal launch trajectory for a rocket launched from a planet with an atmosphere (Earth) in order to maximise payload to orbit. I have to do a second year physics project and I would very much like to avoid stepping foot in a lab so I am trying to do something more mathematical in nature, and if I am being honest I want to know how to play Kerbal Space Program more optimally.

My background is I am a second year student a university studying theoretical physics (maths & physics pretty much). I have done linear algebra 1 & 2, (Newtonian) mechanics 1 & 2, Calculus 1 & 2, and some physics modules which aren't really relevant. I am currently doing Lagrangian mechanics, real analysis and "equations of mathematical physics" which is Fourier transforms, (more) vector calculus, ODEs and some other stuff. Most of my knowledge of calculus of variations comes from a brief overview of it that I got in my Lagrangian mechanics class. The book for linear algebra module was Algebra by Artin, and for Lagrangian mechanics the recommended books are Landau & Lifshitz volume 1 & 2 to give an idea of the level (I think these 2 will be the most relevant). My level relative to this is that with effort I can get through the homeworks. what I really want from here though is book/papers to read through and some help understanding the maths in them. This is my first time trying to find and read papers so any and all help is appreciated. It is also my first time asking a qustion on maths stack exchange so any critiques are also welcome.

When looking for resources online I had trouble finding anything that answers my question. I have had some luck with NASA's technical reports server and found this paper: Teren, F.; Spurlock, O.F.: Optimal three dimensional launch vehicle trajectories with attitude and attitude rate constraints which looks to go a long way to answering my question but there are still some things which are not clear to me, such as where the equation and constraints that are optimised come from. That appears to come from "Stancil, R.T.; and Kulakowski, L.J.: Rocket Boost Vehicle Mission Optimization. ARS J., vol. 31, no. 7, July 1961, pp 935-942." which is referenced in an earlier paper by Teren and Spurlock that only considers a 2 dimensional vrsion of the problem: Payload optimization of multistage launch vehicles, but I have not been able to find that paper for online for free. I have also come across linear tangent steering which might be worth looking at, perhaps someone could shine a light on this?

I'll be the first to admit that I don't understand everything that is going on in these papers so if I've missed the answer to any of my questions I apologise in advance. First this paper states that it doesn't consider the atmospheric phase other than the booster kick angle as generally one wants to minimise the aerodynamic loads on the rocket which makes perfect sense. Does this mean the paper presumes a gravity turn with the only torque applied being the gravity of the planet? Or does solve it more generally and allow for a launch vehicle that can allow a small pitch over rate? If it allows for a small pitch over rate should I use the maximum allowable? I can't see why the logic used to show that you use the maximum for the optimised parts of the trajectory shouldn't be applied in atmosphere either. I haven't gotten to trying to solve for my initial and final conditions yet but if anyone would like to offer some tips for that, they would be most appreciated. I am familiar with some numerical methods but I have a feeling that I am going to struggle numerically solving this in the end so tips or tricks for that would also be a great help.

If you have read all that without giving up you're a saint, and thank you for taking the time to answer.

• This is a very very broad question. When I see "optimal", I'm conditioned to ask "with respect to what?". If you have a model in the form of a set of differential equations, a criterion and boundary conditions, there's a ton of tools to solve the problem numerically. But, for me that toolbox came in a 4th year graduate class... – Ludo Oct 25 at 14:25
• With respect to the payload that a given rocket can launch to a given orbit. I know its a hard question because I haven't found a satisfying answer but all that means is that I have to put in a bit of work myself. I appreciate that the toolbox for solving this is at an advanced graduate level so I have little to no chance of understanding it but I would still appreciate any pointers in the right direction such as books, websites, lecture notes, tutorials ect. – Glum_Mathematician Oct 25 at 15:27
• NASA uses (or used) a program called POST (Program to Optimize Simulated Trajectories). It's covered by ITAR so you can't get it, but this paper describes it in some detail, and might be of interest: ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770012832.pdf – Organic Marble Oct 25 at 20:50
• I've only just skimmed it but that looks like a very interesting paper, it should be of great help. Its too bad about ITAR but oh well. Thank you. – Glum_Mathematician Oct 26 at 16:20
• You should look into optimal control! This allows you to have certain cost functionals that define what "optimal means" in your case and then you can use calculus of variations to develop state equations you can numerically integrate which yield an optimal solution based off of your problem statement. – aaastro Oct 31 at 23:15

Welcome to the site! I am afraid the answer you are looking for is not the one you want. Long story short, the optimal gravity turn must be calculated numerically, because the atmospheric density profile and velocity field is inherently numerically defined based on local conditions at the time of launch. (There's the standard atmosphere, and then accounting for jet stream and such.)

You mentioned that you are currently studying Lagrangians and ODEs. This is perfect for this problem. Ultimately, the goal of a gravity turn is to minimize a "cost" function, which we define to be the total delta-V consumed during launch. If we define the rocket's pitchover angle in time as $$\theta(t)$$, and you know the rocket's mass and thrust profile in time $$m(t),\tau(t)$$, you can solve the second-order partial differential equation for the equations of motion.

$$m\ddot r = \tau(t)\cos(\theta(t)) + \frac{m\dot\phi^2}{r} - mg(r) - F_\text{drag}(r,\dot r,\dot\phi,\theta(t),...)\hat r$$ $$mr\ddot\phi = \tau(t)\sin(\theta(t)) - 2\dot r\dot\phi - F_\text{drag}(r,\dot r,\dot\phi,\theta(t),...)\hat\phi$$

As I am sure you are thinking, these equations have a lot of terms, are non-linear (that pesky $$\dot\phi^2/r$$ really does us in for standard solving techniques), and ultimately are composed of functions that are themselves numerically defined. The drag function needs the atmospheric density profile (at a minimum), along with the coefficient of drag for 0 AoA. If you want non-zero AoA, supersonic drag, etc., well that is what the ellipsis is for.

The cost function is buried in these equations through your choice of $$m(t)$$ and $$\tau(t)$$, because this determines your specific impulse. Ultimately I imagine that you want to minimize total mass for a starting case, but there may be reasons not to minimize mass. Take the Saturn V, the first stage was RP-1-fueled with a terrible specific impulse of 256 seconds. (In principle) Could they have made it lighter with LH2/LOX and better engines? Yes. Was the engineering practical to do so? No, they designed the F1 engines with maximum thrust in mind, to lob the second stage and the rest of the rocket to an altitude where the J-2 engines could operate efficiently.

That being said, there are some simple cases for which someone (not me) has already done their homework on gravity turns in various optimal conditions. So I will link them here.

Ascent profiles (which include the gravity turn, thrust of the engines, AoA, etc.) are calculated right before (<1 day) launch using the best available predictions and measurements of the atmosphere. Naturally, there is still some error in these models, and hence there is limited closed-loop control of the first, second (and possibly third) stages to correct these errors and achieve the target orbit.

I hope this enlightens you and somewhat answers the question. I do highly recommend setting up the equations in Mathematica or similar software if possible, and optimizing the ascent profile by modifying the function for thrust and pitchover angle.

• I don't mind a numerical answer, given the number of constraints I had assumed it would have to be solved numerically. In your equations I'm guessing tau is thrust and that m is implicitly a function of time? As for minimising mass that would be nice but the goal is to maximise payload for a given rocket, be it an efficient or inefficient one. I see quite a few things I should add to the post to make it clearer so I'll do that now. I don't suppose you could recommend books that cover this including the atmospheric phase? All the ones I've found have skipped straight to the in orbit phase. – Glum_Mathematician Oct 25 at 15:23
• Yes, tau is thurst, and m is an explicit function of time (The fuel consumption rate is known). So if you are working with a given rocket, then those functions would be mostly the same from trajectory to trajectory, but minor variations can be made to better optimize any particular gravity turn. (The rocket engines may be throttle-able to some degree) – Quietghost Oct 25 at 15:28
• So have I completely misunderstood what those papers I linked were trying to do? – Glum_Mathematician Oct 25 at 15:31
• From what I have read, the papers form a mathematical method for a standard gravity turn given downrange and pitchover constraints that provides the bulk of payload maximization, with most of the maneuvering done above the atmosphere. They are the right resources for your project as best I can tell, but you should also keep in mind when they are published (1960s). I interpreted your question as a fine-tuning of these methods, given local atmosphere and minor thrust variations, where we can now calculate the results in seconds, whereas this quick iteration wasn't available then. – Quietghost Oct 25 at 16:04
• You've been quite a lot of help and I thank you for that. As far as I can tell the atmospheric phase isn't normally available for optimisation since one normally wants to minimise the strain on the launch vehicle. It would be nice to be able to account for variations in thrust but I think I can safely avoid worrying about local atmospheric conditions as this isn't meant to be a very big project. A model that will work for KSP realism overhaul should do the job. I will look into long duration burns and probably come back with more questions. Thank you for the help once again. – Glum_Mathematician Oct 25 at 17:07