Core API

poliastro.core.angles module

poliastro.core.elements module

poliastro.core.elements.rv_pqw

Returns r and v vectors in perifocal frame.

poliastro.core.elements.coe2rv

Converts from classical orbital elements to vectors.

Parameters:
  • k (float) – Standard gravitational parameter (km^3 / s^2).
  • p (float) – Semi-latus rectum or parameter (km).
  • ecc (float) – Eccentricity.
  • inc (float) – Inclination (rad).
  • omega (float) – Longitude of ascending node (rad).
  • argp (float) – Argument of perigee (rad).
  • nu (float) – True anomaly (rad).
poliastro.core.elements.coe2mee

Converts from classical orbital elements to modified equinoctial orbital elements.

The definition of the modified equinoctial orbital elements is taken from [Walker, 1985].

Parameters:
  • k (float) – Standard gravitational parameter (km^3 / s^2).
  • p (float) – Semi-latus rectum or parameter (km).
  • ecc (float) – Eccentricity.
  • inc (float) – Inclination (rad).
  • omega (float) – Longitude of ascending node (rad).
  • argp (float) – Argument of perigee (rad).
  • nu (float) – True anomaly (rad).

Note

The conversion equations are taken directly from the original paper.

poliastro.core.elements.rv2coe

Converts from vectors to classical orbital elements.

Parameters:
  • k (float) – Standard gravitational parameter (km^3 / s^2).
  • r (array) – Position vector (km).
  • v (array) – Velocity vector (km / s).
  • tol (float, optional) – Tolerance for eccentricity and inclination checks, default to 1e-8.

poliastro.core.hyper module

Utility hypergeometric functions.

poliastro.core.hyper.hyp2f1b

Hypergeometric function 2F1(3, 1, 5/2, x), see [Battin].

poliastro.core.iod module

poliastro.core.perturbations module

poliastro.core.perturbations.J2_perturbation

Calculates J2_perturbation acceleration (km/s2)

New in version 0.9.0.

Parameters:
  • t0 (float) – Current time (s)
  • state (numpy.ndarray) – Six component state vector [x, y, z, vx, vy, vz] (km, km/s).
  • k (float) – gravitational constant, (km^3/s^2)
  • J2 (float) – oblateness factor
  • R (float) – attractor radius

Notes

The J2 accounts for the oblateness of the attractor. The formula is given in Howard Curtis, (12.30)

poliastro.core.perturbations.J3_perturbation

Calculates J3_perturbation acceleration (km/s2)

Parameters:
  • t0 (float) – Current time (s)
  • state (numpy.ndarray) – Six component state vector [x, y, z, vx, vy, vz] (km, km/s).
  • k (float) – gravitational constant, (km^3/s^2)
  • J3 (float) – oblateness factor
  • R (float) – attractor radius

Notes

The J3 accounts for the oblateness of the attractor. The formula is given in Howard Curtis, problem 12.8 This perturbation has not been fully validated, see https://github.com/poliastro/poliastro/pull/398

poliastro.core.perturbations.atmospheric_drag

Calculates atmospheric drag acceleration (km/s2)

New in version 0.9.0.

Parameters:
  • t0 (float) – Current time (s)
  • state (numpy.ndarray) – Six component state vector [x, y, z, vx, vy, vz] (km, km/s).
  • k (float) – gravitational constant, (km^3/s^2)
  • C_D (float) – dimensionless drag coefficient ()
  • A (float) – frontal area of the spacecraft (km^2)
  • m (float) – mass of the spacecraft (kg)
  • H0 (float) – atmospheric scale height, (km)
  • rho0 (float) – the exponent density pre-factor, (kg / m^3)

Notes

This function provides the acceleration due to atmospheric drag. We follow Howard Curtis, section 12.4 the atmospheric density model is rho(H) = rho0 x exp(-H / H0)

poliastro.core.perturbations.shadow_function
Determines whether the satellite is in attractor’s shadow,
uses algorithm 12.3 from Howard Curtis
Parameters:
  • r_sat (numpy.ndarray) – position of the satellite in the frame of attractor (km)
  • r_sun (numpy.ndarray) – position of star in the frame of attractor (km)
  • R (float) – radius of body (attractor) that creates shadow (km)
poliastro.core.perturbations.third_body(t0, state, k, k_third, third_body)

Calculates 3rd body acceleration (km/s2)

Parameters:
  • t0 (float) – Current time (s)
  • state (numpy.ndarray) – Six component state vector [x, y, z, vx, vy, vz] (km, km/s).
  • k (float) – gravitational constant, (km^3/s^2)
  • third_body (a callable object returning the position of 3rd body) – third body that causes the perturbation
poliastro.core.perturbations.radiation_pressure(t0, state, k, R, C_R, A, m, Wdivc_s, star)

Calculates radiation pressure acceleration (km/s2)

Parameters:
  • t0 (float) – Current time (s)
  • state (numpy.ndarray) – Six component state vector [x, y, z, vx, vy, vz] (km, km/s).
  • k (float) – gravitational constant, (km^3/s^2)
  • R (float) – radius of the attractor
  • C_R (float) – dimensionless radiation pressure coefficient, 1 < C_R < 2 ()
  • A (float) – effective spacecraft area (km^2)
  • m (float) – mass of the spacecraft (kg)
  • Wdivc_s (float) – total star emitted power divided by the speed of light (W * s / km)
  • star (a callable object returning the position of star in attractor frame) – star position

Notes

This function provides the acceleration due to star light pressure. We follow Howard Curtis, section 12.9

poliastro.core.thrust package

poliastro.core.thrust.change_a_inc.extra_quantities

Extra quantities given by the Edelbaum (a, i) model.

poliastro.core.thrust.change_a_inc.beta

Compute yaw angle (β) as a function of time and the problem parameters.

poliastro.core.thrust.change_a_inc.beta_0

Compute initial yaw angle (β) as a function of the problem parameters.

poliastro.core.thrust.change_a_inc.compute_parameters

Compute parameters of the model.

poliastro.core.thrust.change_a_inc.delta_V

Compute required increment of velocity.

poliastro.core.thrust.change_argp.delta_V

Compute required increment of velocity.

poliastro.core.thrust.change_argp.extra_quantities

Extra quantities given by the model.

poliastro.core.thrust.change_ecc_quasioptimal.delta_V

Compute required increment of velocity.

poliastro.core.thrust.change_ecc_quasioptimal.extra_quantities

Extra quantities given by the model.

poliastro.core.thrust.change_inc_ecc.delta_V

Compute required increment of velocity.

poliastro.core.thrust.change_inc_ecc.extra_quantities

Extra quantities given by the model.

poliastro.core.propagation module

poliastro.core.propagation.mean_motion

Propagates orbit using mean motion

New in version 0.9.0.

Parameters:
  • orbit (Orbit) – the Orbit object to propagate.
  • tof (float) – Time of flight (s).

Notes

This method takes initial \(\vec{r}, \vec{v}\), calculates classical orbit parameters, increases mean anomaly and performs inverse transformation to get final \(\vec{r}, \vec{v}\) The logic is based on formulae (4), (6) and (7) from http://dx.doi.org/10.1007/s10569-013-9476-9

poliastro.core.stumpff module

Stumpff functions.

poliastro.core.stumpff.c2

Second Stumpff function.

For positive arguments:

\[c_2(\psi) = \frac{1 - \cos{\sqrt{\psi}}}{\psi}\]
poliastro.core.stumpff.c3

Third Stumpff function.

For positive arguments:

\[c_3(\psi) = \frac{\sqrt{\psi} - \sin{\sqrt{\psi}}}{\sqrt{\psi^3}}\]

poliastro.core.util module

Function helpers.

poliastro.core.util.circular_velocity

Compute circular velocity for a given body (k) and semimajor axis (a).

poliastro.core.util.rotate

Rotates the coordinate system around axis x, y or z a CCW angle.

Parameters:
  • vec (ndarray) – Dimension 3 vector.
  • angle (float) – Angle of rotation (rad).
  • axis (int) – Axis to be rotated.

Notes

This performs a so-called active or alibi transformation: rotates the vector while the coordinate system remains unchanged. To do the opposite operation (passive or alias transformation) call the function as rotate(vec, ax, -angle) or use the convenience function transform, see [1]_.

References

poliastro.core.util.transform

Rotates a coordinate system around axis a positive right-handed angle.

Notes

This is a convenience function, equivalent to rotate(vec, ax, -angle). Refer to the documentation of that function for further information.

poliastro.core.util.norm

Norm of a 3d vector.

poliastro.core.util.cross

Computes cross product between two vectors