# Calculating dV to raise apoapsis at an arbitrary point of an orbit

This is similar to another StackExchange post (right down to the Kerbal Space Program mentions), but with a different approach. The question I'm trying to solve is thus:

Given current orbital state vectors for position ($\overrightarrow{r}$) and velocity ($\overrightarrow{v}$) (and it's safe to assume all of the current orbit's Keplerian elements are known as well), I am attempting to determine the $\Delta v$ required to reach a target apoapsis $R_{a}$. The location in the orbit is arbitrary; it might not be at apoapsis or periapsis; thus the target semi-major axis $a$ and eccentricity $e$ are not known and using the Vis-viva equation for the target semi-major axis isn't an option by itself.

In my particular case, I've added a constraint that the direction of $\overrightarrow{v}$ will not change -- only its magnitude. In other words, the resulting burn will be along the prograde/retrograde vector, and I'm essentially only trying to determine the magnitude of said vector.

My idea was to use a small portion of the formulas for programatically calculating orbital elements using position/velocity vectors in reverse -- namely those involving eccentricity and semi-major axis -- and then solve the resulting equation for the magnitude of $\overrightarrow{v}$. To do this, I replaced $\overrightarrow{v}$ with $\overrightarrow{d}m$, where $d$ is the normalized current velocity vector and m its magnitude. The resulting formula, after some simplification, looks like this:

$$R_{a} = \frac{\mu + 1+|(m-g)\overrightarrow{r} - \overrightarrow{d}(\overrightarrow{r}\cdot\overrightarrow{d})m|}{2g-m}$$ where $m$ is the magnitude of $\overrightarrow{v}$ squared and $g = \frac{\mu}{|\overrightarrow{r}|}$. This definition of $g$ is technically wrong but works for this equation -- more on that in a minute.

This equation gives me a formula that correctly determines my current apoapsis when I toss in the other parameters. However, I couldn't figure out how to solve it for $m$ on my own... so I asked Wolfram Alpha, which gives me the following: $$m = \frac{2ag+gr-\mu-1}{a-dr\cdot r + r}$$ or $$m = \frac{2ag-gr-\mu-1}{a+dr\cdot r + r}$$ (I couldn't find a way to convince it that $d$ and $r$ were vectors; thus they are not shown as such here. $r$ is $R_{a}$).

Plugging the numbers back into this formula, however, yielded incorrect results. But!

I found that if I used the "correct" formula for $g$ ($g = \frac{\mu/}{|\overrightarrow{r}|^2}$), it would yield completely wrong values for the apoapsis given other known variables... but plugging that 'wrong' apoapsis in to the other formula ended up yielding the correct value for $m$ for the 'correct' apoapsis. That said, I have no idea how to take advantage of that fact -- and I'm at a loss at where to continue from here after poking at it for several days.

So, a few questions:

1. What am I missing here?

2. Is there some other method to solving this that I'm not missing? I considered something involving conservation of angular momentum, but ran into the same problem where the formulas I could find require knowing the semi-major axis value.

• I'm not analyzing your maths now (busy with other stuff), but did you account for the apoapsis moving "sideways" if the burn is not at periapsis? E.g. you're scaling original $\overrightarrow{R_a} \cdot k$ (k = some scaling factor), instead of the new apoapsis at a completely different $\overrightarrow R$?
– SF.
Jun 16, 2016 at 9:52
• @SF $R_{a}$ is a scalar, not a vector. A formula to move apoapsis to a set location in cartesian coordinates is probably a much more complicated question (and one that likely has no solution whatsoever given the additional constraints mentioned). Jun 16, 2016 at 17:20

We have the specific energy and specific angular momentum:

$$\mathcal{E}=-{\mu\over 2a}={v^2\over 2}-{\mu\over r}$$

$$\mathcal{M}^2=\mu a\left(1-e^2\right)=r^2 v^2\cos^2\gamma$$

where $\mu$ is the $GM$ of the central body, $v$ and $r$ are the magnitudes of the respective vectors and $\gamma$ is the flight path angle.

You can get $\cos\gamma$ given $\vec{r}$ and your initial $\vec{v_i}$ directly from the definition of angular momentum — a vector without the arrow is its magnitude (we don't need to worry about the sign of $\gamma$ here):

$$\cos\gamma={\left|\vec{r}\times\vec{v_i}\right|\over r\,v_i}$$

We'll call the desired final apoapsis $z$, which is:

$$z=a\left(1+e\right)$$

The key is that your position and flight path angle will be unchanged before and after an instantaneous maneuver in the direction of the velocity. You can then solve for the final velocity magnitude as a function of the final apoapsis at the fixed $r$ and $\gamma$:

$$v_f=\sqrt{2\mu z(z-r)\over r z^2-r^3\cos^2\gamma}$$

The difference between that and your initial velocity magnitude, $v_f-v_i$, is your $\Delta V$ in the velocity direction.

You must have $z\ge r$. Since orbits are closed it will return to $r$. If $r$ is not less than $z$, then $z$ is not the apoapsis. When $z=r$ and $\gamma\ne 0$, you have a degenerate case where $v_f=0$, so the body then falls in a straight line to the center of the body, at infinite velocity at the body, and then back up to $r$. So really you better have $z>r$. If $z=r$ and $\gamma=0$, then you are at apoapsis or periapsis. If you're at apoapsis, then done. Do nothing. If you're at periapsis, then there are an infinite number of solutions. The minimum $\Delta V$ would be to lower the current apoapsis to the current periapsis, making the orbit circular.

Note that in general the maneuver will also change the periapsis and argument of periapsis. There is no assurance that the new periapsis will be above the surface or atmosphere of the body, so be careful.

• Re: the constraints between z and r: Is solving for z<r merely accomplishing the same thing but with a target periapsis rather than a target apoapsis? And, as I understand it, the nature of the burn being along the prograde vector (with no normal or radial components) means that an increase in velocity won't lower periapsis -- thus it's only a concern if z > current apoapsis. For the z=r periapsis case, there should only be one solution due to the direction constraint (technically two if the magnitude is negative) Jun 16, 2016 at 21:03
• Three comments in one! 1) No. In fact for $r\cos\gamma<z<r$, the result is imaginary. 2) Yes, the periapsis will only go down if you reduce the velocity magnitude. 3) No. For $z=r$ and $\gamma=0$ at the initial orbit's periapsis, that point in the orbit becomes the new apoapsis, so the opposite apsis can be changed to any radius less than or equal to $z$. Jun 17, 2016 at 2:51
• I've had a chance to test this in KSP and can confirm the formula works as written, but: 1) As it turns out, it does work to adjust periapsis if z>r: there's no imaginary component because both halves of the fraction will be negative. (Though I cannot prove this for all cases; absolute value might work). $\gamma = 1$, not 0, at apoapsis/periapsis, $\gamma = 0$ is only true on radial trajectory. 3) I see; because once z reaches the current periapsis there are an infinite number of magnitudes where that point goes below what is now apoapsis. Jun 17, 2016 at 3:26
• No, $\gamma=0$ at periapsis and apoapsis. You must be confusing $\gamma$ with $\cos\gamma$, where the latter is in fact $1$ at periapsis and apoapsis. Jun 17, 2016 at 11:50
• You mean if $z<r$. It is easy to find cases where the result is imaginary. I said exactly how. For those cases, taking the absolute value results in neither the apoapsis nor the periapsis becoming $z$. Jun 17, 2016 at 11:57