Skip to content

Documentation / @interstellar-tools/equations / gravityLoss

Function: gravityLoss() ​

ts
function gravityLoss(
  g: number | readonly number[],
  gamma: readonly Radians[],
  dt: number
): number;

Defined in: manoeuvres/gravity-loss.ts:48

Compute the gravity loss of a burn from samples of gravity and flight-path angle.

Δvg=∫0tbgsin⁡γdt

integrated with the trapezoidal rule over equally spaced samples.

Where:

  • g is the local gravitational acceleration (m/s²)
  • γ is the flight-path angle above the local horizontal (rad)
  • tb is the burn time (s)

Units

  • Inputs: g in m/s², gamma in radians, dt in s.
  • Output: Δvg in m/s.

Notes

  • Thrust spent holding a rocket up against gravity doesn't speed it up. The loss is largest for a vertical climb (γ=90°) and zero for a horizontal burn (γ=0).
  • The delta-v a rocket must carry is its orbital delta-v plus its gravity, drag and steering losses.
  • Pass g as one number when it's constant over the burn, or as samples matching gamma.

Parameters ​

ParameterTypeDescription
gnumberreadonly number[]
gammareadonly Radians[]Flight-path angles γ in radians, sampled every dt seconds (at least 2 samples, each finite).
dtnumberTime between samples in s (finite, > 0).

Returns ​

number

Gravity loss Δvg in m/s. Negative when the vehicle is mostly descending.

Throws ​

  • If any input is not a finite number, or g and gamma have different lengths.
  • If gamma has fewer than 2 samples, dt <= 0 or any g < 0.

Example ​

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

// A 10 s vertical climb in constant Earth gravity
const vertical = Array.from({ length: 11 }, () => (Math.PI / 2) as Radians);
gravityLoss(9.80665, vertical, 1); // ≈ 98.07 m/s

See ​

https://en.wikipedia.org/wiki/Gravity_drag Gravity drag