How to calculate necessary Delta-V for circularization burn

kerbal-space-program

I'm trying to write a launch into orbit program.

I could use wait until periapsis > x, but this seems inaccurate, because I can't start the burn at the exactly right time, because I don't know how much to burn.

How do I calculate necessary Delta-V for circularization burn?

Best Answer

So the only way to do this without just measuring the periapsis is with lots and lots of math. Luckily, Newton told us everything we need to know (at least for KSP), and Kepler helped out a bit too.

But first, a note on how MechJeb handles circularizing an orbit. Or at least used to handle it in version 1.x, since I think it changed after integrating with maneuver nodes. When performing an automated ascent, MechJeb would wait until the apoapsis, and then fire the engine(s) in such a way as to maintain a vertical velocity of 0m/s. Given sufficient thrust (more than 1g local), the ship could "drag" the apoapsis along with it while also raising the periapsis. All MechJeb had to do was maintain a vertical speed of 0m/s until the difference between the apoapsis and periapsis was a few metres. Other than the slightly less than efficient burn pattern, this is how it's done in practice.

But since you don't want to do it the easy way (really, the method described above is the easy way), the first thing you need to know is F=ma. That one equation governs everything in KSP. In english, the force acting on a body is equal to the mass of the body multiplied by the acceleration the body is under. But this equation is only the starting point, and actually isn't all that useful to us right now. More useful is a secondary form F=mvv/r, which relates the velocity to the radius of the orbit (as measured from the centre of the planet, not the surface, as is commonly displayed). However, we still have that pesky mass term in there, but if we forget about the force acting on the object, then we can relate the first equation to the second:
ar=vv
Now all we have to worry about is the acceleration, but we can calculate that, thanks to Newton's law of gravitation. First is the equation:
F=Gm1m2/rr
But we don't need to know all that, and can simplify it significantly:
arr=mu
Where μ is constant for each planetary body. We already know that a is 9.81m/s at the surface of Kerbin, and that the radius is 600km, so μ must equal 3.5316×1012 m3/s2, which is exactly what we find in the wiki. First sanity check complete.

Now, given a target altitude, we merely need to work backwards in order to determine the desired orbital velocity. As an example, we'll work through a 100km orbit. First, determine the acceleration due to gravity at 100km:
a=7.2
7.2m/s2 seems low, but we'll go with it. With that, we can calculate the velocity:
orbital velocity calc
2.25km/s closely agrees with what I've seen in game, so second sanity check complete.

Now this won't tell you how much delta-V you'll need to circularize from a sub-orbital trajectory, but it will give you a lower bound at any point in the ascent simply by subtracting the current velocity from the orbital velocity. You'll know the true value required is something larger than this calculated value.

However, this is all basically for nought. These calculations all assume perfectly circular orbits, which is never the case. If you just base your burns off of orbital velocity, your eccentricity could be wildly off, causing your spacecraft to plunge back into the atmosphere. You're better off using something similar to the approach MechJeb used in the older version.