ssapy_toolkit.Integrators.fuel

Functions

estimate_fuel_usage(accels, dt, positions[, ...])

Estimate total propellant mass used given an acceleration profile, with gravity computed at each time step based on spacecraft position.

ssapy_toolkit.Integrators.fuel.estimate_fuel_usage(accels: ndarray, dt: float, positions: ndarray, engine: str = 'Mira') float[source]

Estimate total propellant mass used given an acceleration profile, with gravity computed at each time step based on spacecraft position.

Parameters:
  • accels (np.ndarray) – Array of acceleration magnitudes (m/s²) at each time step.

  • dt (float) – Time step duration (s).

  • positions (np.ndarray) – Array of position vectors (x, y, z) in meters, shape (n, 3), in Earth-centered inertial frame.

  • engine (str, optional) – Name of the thruster or spacecraft to use (must be in engines.thrusters). Default is “Mira”.

Returns:

total_fuel – Total fuel mass consumed across all steps (kg).

Return type:

float

Raises:
  • KeyError – If the specified engine is not found in the thrusters dictionary or lacks a mass specification.

  • ValueError – If positions array shape does not match accels or is not 3D.