Documentation / @interstellar-tools/equations / cr3bpDerivatives
Function: cr3bpDerivatives()
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,
Where:
is the mass ratio, from cr3bpMassRatio , are the distances to the larger body, at , and the smaller, at and are the Coriolis terms, and , in the centrifugal ones
Units
- Input:
state[x, y, z, xDot, yDot, zDot]in normalised units (see cr3bpUnits),mudimensionless. - 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.
+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
| Parameter | Type | Description |
|---|---|---|
state | Cr3bpState | CR3BP state [x, y, z, xDot, yDot, zDot] (finite, not at either body). |
mu | number | Mass ratio |
Returns
The time derivative [xDot, yDot, zDot, xDDot, yDDot, zDDot].
Throws
- If
muor a state component is not finite. - If
muis outside (0, 0.5], or the state is at the centre of either body.
Example
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
- jacobiConstant
- rk4Integrate
- https://en.wikipedia.org/wiki/Three-body_problem#Circular_restricted_three-body_problem Circular restricted three-body problem