# Optimal depth for underground flyby?

Planetary flybys are used to modify the orbital parameters of spacecraft.

For maximum gain, a large deflection angle is often desired. But the deflection angle is limited by the closest approach, which in turn is limited by the radius of the planet

However: what if a tunnel was dug along the flyby path? Then the closest point of the flyby could be even lower, and the deflection angle increased.

Or would it?

Considering the extreme case, going straight through the centre, a tunnel path offers no deflection at all, where a point mass flyby would in contrast give a full 180º.

Sub-surface gravity can be found by applying the shell theorem, and assuming uniform density, the force of gravity then becomes proportional to distance $$F(r) \propto r$$, in contrast to the usual $$F(r) \propto r^{-2}$$ (as an aside, this law of gravity also happens to have stable orbits, the only other exponent for $$r$$ to do so. They are however ellipses with their geometric centre instead of a focus at the centre of mass, so it's not immediately clear how to patch them together with the outside hyperbola)

Writing a simple time stepping simulation, I found the deflection angle to indeed be increasing a little when digging tunnels some way into the planet, but then shrink again.

The question then arises: What is the optimal depth for flyby tunnels? Presumably it depends on $$v_{\infty}$$

• (this does not appear to be a practical scheme for infrastructure) Sep 21, 2022 at 21:07
• Would you have to flare the exit of the tunnel to allow for planetary rotation? Sep 21, 2022 at 22:18
• Presumably yes, but planetary rotation would not affect the trajectory in any way. Sep 21, 2022 at 22:32
• As an after thought, the nature of the rock being flown through during such a "fly-by" could pose practicality challenges. For argument's sake, a planet with an internal structure similar to Earth might find such a tunnel eventually closing in on itself if the tunnel had to pass through the mantle.
– Fred
Sep 23, 2022 at 4:15
• This sounds like a perfect question for XKCD What If. Sep 23, 2022 at 12:42

Assuming a uniform planet with radius $$1$$ and gravitational parameter $$1$$, if $$V_\infty$$ is the speed at infinity and $$r$$ is the closest approach to the center, then the maximal speed is $$V_m = \sqrt{V_\infty^2 + 3 - r^2}$$, and the specific angular momentum is $$L = V_mr$$. If I haven't made a mistake, the deflection angle is then $$2\left( \arctan\frac{{r}\sqrt{1-r^2}}{V_m\sqrt{V_m^2-1}} + \arctan \frac{L(V_\infty^2+1)}{\sqrt{V_\infty^2+2-L^2}} - \arctan LV_\infty \right),$$ where the first summand is due to the elliptic part of the trajectory inside the planet, and the rest is due to the hyperbolic parts outside.

This expression is too complex for me to try and find the optimal $$r$$ analytically, but if $$V \gg 1$$, the angle is approximately equal to $$\frac{2}{V_\infty^2}\frac{1-(1-r^2)^{3/2}} {r},$$ which indeed takes the maximal value at $$r = \sqrt{\frac{\sqrt 3}2}$$, as this answer describes.

• But inside the planet, the inverse square law no longer holds, so why should the path be elliptical? Sep 25, 2022 at 10:29
• @TonyK In the linear law, which holds inside the planet, the motion along each axis is harmonic with the same period. It means that all trajectories are ellipses with the center at the center of the planet or straight lines through the center. Sep 25, 2022 at 10:40
• @Litho just curious, what is "the linear law"? I think TonyK has a point, can it really still be a conic section if the force is not $r^{-2}$?
– uhoh
Sep 25, 2022 at 11:15
• @uhoh I meant that $F\propto r$. Fun fact: $F\propto r$ and $F\propto r^{-2}$ are the only two power laws where all the bounded trajectories are closed. They also both give conic sections for trajectories. Sep 25, 2022 at 11:56
• I am persuaded! Sep 25, 2022 at 12:03

The Optimal Depth is Precisely (Almost) No Depth

I solved this problem using a numerical differential equation solver to investigate a range of flyby approach angles. The results are fascinating!

I used the earth as a basis for the investigation. The planet radius is marked in red, and the starting point is near geostationary altitude. I implemented the "tunnel gravity" with a simple Boolean and then taking the mass under the position as the relevant mass.

I plot here 3 different starting velocities and a range of starting angles for each. If you look carefully, you will see that for all three cases the sharpest turning is provided by the trajectory that passes closest to the planet's surface.

Another fascinating result is that the planet acts like a lens! producing a focal length that is dependent on the initial velocity.

I will now admit that this is not a proof (though I think it is quite convincing), but every starting point I tried had the same result (and I tried many more than shown here). I am sure someone could mathematically prove this (and explain the neato lensing behavior), but that person will not be me.

Editing to address further work and comments discussion. On closer inspection, there is very marginal (~0.1 degree) extra turning to be had with a relatively shallow minimum depth (~100 km below ground)

Addendum: Variable Density and a Trench 200 km at Its Deepest

User Uhoh solicited a model for Earth's density model from this question following discussions about the effect this would cause. I integrated the equations to give mass and redid my analysis. Despite the modern-art aesthetic of these plots, there was very minimal change. The optimal minimum depth did reduce (as expected) but only by about 100 km. The left figure is not useful, I just wanted to include it because I think it's pretty. The middle figure shows a small band of the most optimal trajectories. The best had a depth of 190 km (0.97 Earth radii). The right plot shows a zoom of the middle and reveals that a 190 km deep trench would be, in fact, pretty deep.

• I suspect a very shallow underground flyby might be minimally better than a flat 0. I expect $1/h^2$ over time (for h - distance from surface) should be the function to maximize and you might gain a bit by digging the periapsis slightly in, to keep the arrival and departure trajectory closer to the surface. Still, I don't expect more than ~1% percent gain vs tangent trajectory.
– SF.
Sep 22, 2022 at 15:25
• So we need a ditch, not a tunnel! Sep 22, 2022 at 15:37
• For a formal proof that optimal surface depth is zero, consider elaborating on Newton's Shell Theorem (e.g. hyperphysics.phy-astr.gsu.edu/hbase/Mechanics/sphshell2.html) -- any apparent deflection to be gained as a result of some below-ground depth is an error in the numerical solver. Sep 22, 2022 at 19:12
• – uhoh
Sep 23, 2022 at 1:38
• @JoshuaVoskamp The shell theorem ruins any gains from deeper trajectories, rapidly decreasing the "active" mass pulling the craft the deeper it flies through the tunnel/trench. There is some angle to be gained by pulling the arrival/departure branches closer to the surface though. Keep the part within the trench very short and shallow and the losses it causes won't outweigh gains outside the trench, on a much longer segment of the trajectory, even assuming uniform Earth density.
– SF.
Sep 23, 2022 at 2:12

Adding my own numerical time-step simulations here.

The effect seems to be quite subtle, only increasing the deflection angle by a fraction of a degree at shallow depth.

For a unit mass, with unit radius, the optimal depth (found by hill climbing) seems to be dependent on the $$v_\infty$$ (velocity at infinity)

At sensible velocities, the depth tapers off with the velocity and is pretty close to 1.

At much faster velocities, the curve eventually flatlines, approaching $$\sqrt{\frac{\sqrt{3}}{2}} \approx 0.93060486$$

But until anyone actually does the math there doesn't seem to be much more insights to get from simulations.