Module planet

class pyspace.planet.PlanetArray(ndarray x, ndarray y, ndarray z, ndarray v_x=None, ndarray v_y=None, ndarray v_z=None, ndarray m=None, ndarray r=None)

PlanetArray for storing planets

a_x

a_x: numpy.ndarray

a_y

a_y: numpy.ndarray

a_z

a_z: numpy.ndarray

com(self) → tuple

Return centre of mass of the system of planets

concatenate(self, PlanetArray other)

Concatenates ‘other’ PlanetArray to self

dist(self, int i, int j) → double

Distance between planet ‘i’ and planet ‘j’

Parameters:

i, j: int
Indices of planets whose distance is sought.
get_number_of_planets(self) → int

Returns number of planets in the PlanetArray

Parameters:

None

Returns:

int: Number of planets in PlanetArray

kinetic_energy(self) → double

Returns total kinetic energy of PlanetArray

kinetic_energy_planet(self, int i) → double

Returns kinetic energy of planet ‘j’

m

m: numpy.ndarray

potential_energy(self, double G) → double

Returns total potential energy of PlanetArray

potential_energy_planet(self, double G, int i) → double

Returns potential energy of planet ‘i’

Parameters:

G: double
Universal Gravitational constant
i: int
Index of the particle whose potential energy is sought
r

r: numpy.ndarray

total_energy(self, double G) → double

Returns total energy of PlanetArray

total_energy_planet(self, double G, int i) → double

Returns total energy of planet ‘i’

v_x

v_x: numpy.ndarray

v_y

v_y: numpy.ndarray

v_z

v_z: numpy.ndarray

x

x: numpy.ndarray

y

y: numpy.ndarray

z

z: numpy.ndarray