Functions

The axinite module's API reference.

All the functions listed on this page can be found in axinite.functions. axinite.functions also includes a G constant.

body_dtype

def body_dtype(limit: np.float64, delta: np.float64) -> np.dtype

Returns the data type for a body.

  • limit (np.float64): The length of the simulation in seconds.

  • delta (np.float64): The frequency at which the simulation should be computed in seconds.

Returns:

np.dtype([
    ("n", "U20"),
    ("m", np.float64),
    ("r", np.float64, (int(limit/delta), 3)),
    ("v", np.float64, (int(limit/delta), 3))
])

_body

def _body(limit: np.float64, delta: np.float64, 
          name: str, mass: np.float64) -> np.ndarray

Creates a new body.

  • limit (np.float64): The length of the simulation in seconds.

  • delta (np.float64): The frequency at which the simulation should be computed in seconds.

  • name (str): The name of the body.

  • mass (np.float64): The mass of the body in kilograms.

Returns: A new inner body.

get_inner_bodies

def get_inner_bodies(bodies: list[ax.Body]) -> np.ndarray

Returns the inner representations of a list of bodies.

  • bodies (list[ax.Body]): A list of Body objects.

Returns: An array of inner bodies.

create_outer_bodies

def create_outer_bodies(bodies: np.ndarray, limit: np.float64, 
                        delta: np.float64) -> list[ax.Body]

Creates outer body representations from inner bodies.

  • bodies (np.ndarray): An array of inner body representations.

  • limit (np.float64): The length of the simulation in seconds.

  • delta (np.float64): The frequency at which the simulation should be computed in seconds.

Returns: A list of body objects.

vector_magnitude_jit

@njit 
def vector_magnitude_jit(vec: np.ndarray) -> float

Calculates the magnitude of a vector.

  • vec (np.float64): The vector to calculate the magnitude of.

Returns: The magnitude of the vector.

Last updated