Skip to content

Documentation / @interstellar-tools/equations / cr3bpDerivatives

Function: cr3bpDerivatives() ​

ts
function cr3bpDerivatives(state: Cr3bpState, mu: number): Cr3bpStateDerivative;

Defined in: three-body/cr3bp-derivatives.ts:71

Compute the time derivative of a state in the circular restricted three-body problem (right-hand side for ODE integration).

In the rotating frame, normalised so the separation, G(m1+m2) and the angular rate are 1:

x¨−2y˙=∂U∂x,y¨+2x˙=∂U∂y,z¨=∂U∂zU=x2+y22+1−μr1+μr2,r1=‖(x+μ, y, z)‖,r2=‖(x−1+μ, y, z)‖

Where:

  • μ is the mass ratio, from cr3bpMassRatio
  • r1, r2 are the distances to the larger body, at x=−μ, and the smaller, at x=1−μ
  • 2y˙ and −2x˙ are the Coriolis terms, and x, y in U the centrifugal ones

Units

  • Input: state [x, y, z, xDot, yDot, zDot] in normalised units (see cr3bpUnits), mu dimensionless.
  • Output: [xDot, yDot, zDot, xDDot, yDDot, zDDot] in normalised units.

Notes

  • "Restricted": the third body is too light to move the other two, which circle their centre of mass. It fits a spacecraft between Earth and Moon far better than two patched conics, but the Moon's real orbit is slightly elliptic and the Sun pulls on everything.
  • Integrate it with rk4Integrate, and check the result with jacobiConstant, which this motion keeps constant.
  • Same layout and style as cwHillDerivatives.
In practiceApollo 11, the free return

+3.7 m/s

On top of Apollo 11's 10 834.3 m/s at TLI, for a free return in the Earth–Moon plane

Integrated from the TLI point, 334.4 km up at 7.367° above the horizontal, a trajectory 242.27° round from the Earth–Moon line passes 114 km behind the Moon 68.6 h later and comes back to a 38.5 km perigee, inside the atmosphere, 137.4 h after TLI. That's the figure-eight that would have brought the crew home if the service module's engine had failed.

Parameters ​

ParameterTypeDescription
stateCr3bpStateCR3BP state [x, y, z, xDot, yDot, zDot] (finite, not at either body).
munumberMass ratio μ (finite, in (0, 0.5]).

Returns ​

Cr3bpStateDerivative

The time derivative [xDot, yDot, zDot, xDDot, yDDot, zDDot].

Throws ​

  • If mu or a state component is not finite.
  • If mu is outside (0, 0.5], or the state is at the centre of either body.

Example ​

ts
import type { Cr3bpState } from '@interstellar-tools/types';

// At rest at L4: the forces balance, so the acceleration is zero
const mu = 0.012151;
const l4: Cr3bpState = [0.5 - mu, Math.sqrt(3) / 2, 0, 0, 0, 0];
cr3bpDerivatives(l4, mu); // ≈ [0, 0, 0, 0, 0, 0]

See ​