Geodesic module

This module contains the class, defining a general Geodesic:

class einsteinpy.geodesic.Geodesic(position, momentum, a=0.0, end_lambda=50.0, step_size=0.0005, time_like=True, return_cartesian=True, julia=True)[source]

Bases: object

Base Class for defining Geodesics Working in Geometrized Units (M-Units), with G = c = M = 1.

Constructor

Parameters
  • position (array_like) – Length-3 Array, containing the initial 3-Position

  • momentum (array_like) – Length-3 Array, containing the initial 3-Momentum

  • a (float, optional) – Dimensionless Spin Parameter of the Black Hole 0 <= a <= 1 Defaults to 0. (Schwarzschild Black Hole)

  • end_lambda (float, optional) – Affine Parameter value, where integration will end Equivalent to Proper Time for Timelike Geodesics Defaults to 50.

  • step_size (float, optional) – Size of each geodesic integration step A fixed-step, symplectic VerletLeapfrog integrator is used Defaults to 0.0005

  • time_like (bool, optional) – Determines type of Geodesic True for Time-like geodesics False for Null-like geodesics Defaults to True

  • return_cartesian (bool, optional) – Whether to return calculated positions in Cartesian Coordinates This only affects the coordinates. The momenta dimensionless quantities, and are returned in Spherical Polar Coordinates. Defaults to True

  • julia (bool, optional) – Whether to use the julia backend Defaults to True

property trajectory

Returns the trajectory of the test particle

calculate_trajectory()[source]

Calculate trajectory in spacetime, according to Geodesic Equations

Returns

  • ~numpy.ndarray – N-element numpy array, containing affine parameter values, where the integration was performed

  • ~numpy.ndarray – Shape-(N, 6) numpy array, containing [x1, x2, x3, p_r, p_theta, p_phi] for each Lambda

class einsteinpy.geodesic.Nulllike(position, momentum, a=0.0, end_lambda=50.0, step_size=0.0005, return_cartesian=True, julia=True)[source]

Bases: einsteinpy.geodesic.geodesic.Geodesic

Class for defining Null-like Geodesics

Constructor

Parameters
  • position (array_like) – Length-3 Array, containing the initial 3-Position

  • momentum (array_like) – Length-3 Array, containing the initial 3-Momentum

  • a (float, optional) – Dimensionless Spin Parameter of the Black Hole 0 <= a <= 1 Defaults to 0. (Schwarzschild Black Hole)

  • end_lambda (float, optional) – Affine Parameter value, where integration will end Equivalent to Proper Time for Timelike Geodesics Defaults to 50.

  • step_size (float, optional) – Size of each geodesic integration step A fixed-step, symplectic VerletLeapfrog integrator is used Defaults to 0.0005

  • return_cartesian (bool, optional) – Whether to return calculated positions in Cartesian Coordinates This only affects the coordinates. The momenta dimensionless quantities, and are returned in Spherical Polar Coordinates. Defaults to True

  • julia (bool, optional) – Whether to use the julia backend Defaults to True

class einsteinpy.geodesic.Timelike(position, momentum, a=0.0, end_lambda=50.0, step_size=0.0005, return_cartesian=True, julia=True)[source]

Bases: einsteinpy.geodesic.geodesic.Geodesic

Class for defining Time-like Geodesics

Constructor

Parameters
  • position (array_like) – Length-3 Array, containing the initial 3-Position

  • momentum (array_like) – Length-3 Array, containing the initial 3-Momentum

  • a (float, optional) – Dimensionless Spin Parameter of the Black Hole 0 <= a <= 1 Defaults to 0. (Schwarzschild Black Hole)

  • end_lambda (float, optional) – Affine Parameter value, where integration will end Equivalent to Proper Time for Timelike Geodesics Defaults to 50.

  • step_size (float, optional) – Size of each geodesic integration step A fixed-step, symplectic VerletLeapfrog integrator is used Defaults to 0.0005

  • return_cartesian (bool, optional) – Whether to return calculated positions in Cartesian Coordinates This only affects the coordinates. The momenta dimensionless quantities, and are returned in Spherical Polar Coordinates. Defaults to True

  • julia (bool, optional) – Whether to use the julia backend Defaults to True