ssapy_toolkit.Integrators.leap_frog

Functions

leapfrog(r0, v0, t[, radial, velocity, ...])

Symplectic leap-frog integrator with point-mass Earth gravity + optional extra accelerations.

ssapy_toolkit.Integrators.leap_frog.leapfrog(r0, v0, t, radial=None, velocity=None, inclination=None, *, accels=None, stop_altitude_m=100000.0, verbose=False)[source]

Symplectic leap-frog integrator with point-mass Earth gravity + optional extra accelerations.

Parameters:
  • r0 (array-like (3,)) – Initial position [m] and velocity [m/s] in an inertial frame.

  • v0 (array-like (3,)) – Initial position [m] and velocity [m/s] in an inertial frame.

  • t (array-like) – Time grid (anything to_gps can handle). Must be evenly spaced.

  • radial (profile spec or None) – Thrust-acceleration profiles (m/s^2). See build_profile [104]. - radial uses accel_radial(r, magnitude) [65] - velocity uses accel_velocity(v, thrust_mag) [68] - inclination uses accel_inclination(r, v, magnitude) [61]

  • velocity (profile spec or None) – Thrust-acceleration profiles (m/s^2). See build_profile [104]. - radial uses accel_radial(r, magnitude) [65] - velocity uses accel_velocity(v, thrust_mag) [68] - inclination uses accel_inclination(r, v, magnitude) [61]

  • inclination (profile spec or None) – Thrust-acceleration profiles (m/s^2). See build_profile [104]. - radial uses accel_radial(r, magnitude) [65] - velocity uses accel_velocity(v, thrust_mag) [68] - inclination uses accel_inclination(r, v, magnitude) [61]

  • accels (callable or list[callable] or None) – Optional additional acceleration models to add each step. Each function may have signature f(r), f(r,t), f(r,v), or f(r,v,t) and must return a (3,) acceleration vector [m/s^2].

  • stop_altitude_m (float) – Stop integration if ||r|| < EARTH_RADIUS + stop_altitude_m [104].

  • verbose (bool) – Print impact message.

Returns:

r, v – State history up to (and including) the first impact step, or full length.

Return type:

ndarray (n,3)