dyad.TwoBody

class dyad.TwoBody(m_1, m_2, a, e, Omega=0.0, i=0.0, omega=0.0)[source]

A class representing the elliptical orbits of a two-body system

Represents the orbit of the secondary body with respect to the primary body as well as the orbit of the primary and secondary bodies with respect to the system’s centre of mass.

Parameters:
m_1: array-like

Mass of the primary body, \(m_{1}\).

m_2: array-like

Mass of the secondary body, \(m_{2}\).

a: array-like

Semimajor axis of the relative orbit, \(a\).

e: array-like

Eccentricity of the relative orbit, \(e\).

Omega: array-like

Longitude of the ascending node of the relative orbit, \(\Omega\).

i: array-like

Inclination of the relative orbit, \(i\).

omega: array-like

Argument of pericentre of the relative orbit, \(\omega\).

Attributes:
angular_momentum

Get the body’s specific angular momentum

angular_momentum_magnitude

Get the magnitude of the body’s specific angular momentum

apoapsis

Get the apoapsis of the orbit

area

Get the area contained by the orbit

argument_of_pericentre

Get the orbit’s argument of pericentre

central_mass

Get the central mass

eccentricity

Get the orbit’s eccentricity

eccentricity_vector

Get the eccentricity vector of the orbit

energy

Get the body’s specific total energy

inclination

Get the inclination of the orbit

longitude_of_ascending_node

Get the longitude of the ascending node of the orbit

lrl_vector

Get the Laplace-Runge-Lenz vector of the orbit

periapsis

Get the periapsis of the orbit

period

Get the orbital period

primary

Get the primary body’s orbit as an instance of Orbit

secondary

Get the secondary body’s orbit as an instance of Orbit

semilatus_rectum

Get the orbit’s semilatus rectum

semimajor_axis

Get the orbit’s semimajor axis

semiminor_axis

Get the orbit’s semiminor axis

Methods

delaunay_elements([theta])

Get the Delaunay elements of the orbit

eccentric_anomaly(theta)

Return the body's eccentric anomaly

kinetic_energy(theta)

Return the body's specific kinetic energy

mean_anomaly(theta)

Return the body's mean anomaly

modified_delaunay_elements([theta])

Get the modified Delaunay elements of the orbit

orbital_elements([theta])

Get the orbital elements of the orbit

potential(theta)

Return the gravitational potential at the body's position

radius(theta)

Return the body's radius

speed(theta)

Return the body's speed

state(theta)

Return the orbital state vector in Cartesian coordinates

Examples

Scalar parameters defining a single binary system in the perifocal plane.

>>> dyad.TwoBody(1., 1., 1., 0.)
<dyad._core.TwoBody object at 0x...>

Scalar parameters defining a single orbit in the observer’s frame.

>>> dyad.TwoBody(1., 1., 1., 0., 1., 1., 1.)
<dyad._core.TwoBody object at 0x...>

Array-like parameters defining multiple orbits.

>>> m, q, a, e = [1., 1.], [1., 1.], [1., 1.], [0., 0.]
>>> dyad.TwoBody(m, q, a, e)
<dyad._core.TwoBody object at 0x...>

The relative position and velocity of the secondary body with respect to the primary body in the form \((x, y, z, v_{x}, v_{y}, v_{z})\).

>>> dyad.TwoBody(1., 1., 1., 0.).state(1.)
array([ 0.54030231,  0.84147098,  0.        , -0.02047084,  0.01314417,
        0.        ])

The position and velocity of the primary and secondary bodies with respect to the centre-of-mass frame each again in the form \(x, y, z, v_{x}, v_{y}, v_{z}\).

>>> dyad.TwoBody(1., 1., 1., 0.).primary.state(1.)
array([ 0.27015115,  0.42073549,  0.        , -0.01023542,  0.00657209,
        0.        ])
>>> dyad.TwoBody(1., 1., 1., 0.).secondary.state(1.)
array([-0.27015115, -0.42073549, -0.        ,  0.01023542, -0.00657209,
       -0.        ])
__init__(m_1, m_2, a, e, Omega=0.0, i=0.0, omega=0.0)[source]

Methods

__init__(m_1, m_2, a, e[, Omega, i, omega])

delaunay_elements([theta])

Get the Delaunay elements of the orbit

eccentric_anomaly(theta)

Return the body's eccentric anomaly

kinetic_energy(theta)

Return the body's specific kinetic energy

mean_anomaly(theta)

Return the body's mean anomaly

modified_delaunay_elements([theta])

Get the modified Delaunay elements of the orbit

orbital_elements([theta])

Get the orbital elements of the orbit

potential(theta)

Return the gravitational potential at the body's position

radius(theta)

Return the body's radius

speed(theta)

Return the body's speed

state(theta)

Return the orbital state vector in Cartesian coordinates

Attributes

angular_momentum

Get the body's specific angular momentum

angular_momentum_magnitude

Get the magnitude of the body's specific angular momentum

apoapsis

Get the apoapsis of the orbit

area

Get the area contained by the orbit

argument_of_pericentre

Get the orbit's argument of pericentre

central_mass

Get the central mass

eccentricity

Get the orbit's eccentricity

eccentricity_vector

Get the eccentricity vector of the orbit

energy

Get the body's specific total energy

inclination

Get the inclination of the orbit

longitude_of_ascending_node

Get the longitude of the ascending node of the orbit

lrl_vector

Get the Laplace-Runge-Lenz vector of the orbit

periapsis

Get the periapsis of the orbit

period

Get the orbital period

primary

Get the primary body's orbit as an instance of Orbit

secondary

Get the secondary body's orbit as an instance of Orbit

semilatus_rectum

Get the orbit's semilatus rectum

semimajor_axis

Get the orbit's semimajor axis

semiminor_axis

Get the orbit's semiminor axis