Geodesic module

This module contains the class, defining a general Geodesic:

class einsteinpy.geodesic.Geodesic(metric, init_vec, end_lambda, step_size=0.001, return_cartesian=True)[source]

Bases: object

Base Class for defining Geodesics

Parameters
  • metric (*) – Metric, in which Geodesics are to be calculated

  • init_vec (ndarray) – Length-8 Vector containing Initial 4-Position and 4-Velocity, in that order

  • end_lambda (float) – Affine Parameter, Lambda, where iterations will stop Equivalent to Proper Time for Timelike Geodesics

  • step_size (float, optional) – Size of each geodesic integration step Defaults to 1e-3

  • return_cartesian (bool, optional) – Whether to return calculated values in Cartesian Coordinates Defaults to True

calculate_trajectory(end_lambda=10.0, OdeMethodKwargs={'stepsize': 0.001}, return_cartesian=True)[source]

Calculate trajectory in spacetime, according to Geodesic Equations

Parameters
  • end_lambda (float, optional) – Affine Parameter, Lambda, where iterations will stop Equivalent to Proper Time for Timelike Geodesics Defaults to 10

  • OdeMethodKwargs (dict, optional) – Kwargs to be supplied to the ODESolver Dictionary with key ‘stepsize’ along with a float value is expected Defaults to {'stepsize': 1e-3}

  • return_cartesian (bool, optional) – Whether to return calculated values in Cartesian Coordinates Defaults to True

Returns

  • ~numpy.ndarray – N-element numpy array containing Lambda, where the geodesic equations were evaluated

  • ~numpy.ndarray – (n,8) shape numpy array containing [x0, x1, x2, x3, v0, v1, v2, v3] for each Lambda

calculate_trajectory_iterator(OdeMethodKwargs={'stepsize': 0.001}, return_cartesian=True)[source]

Calculate trajectory in manifold according to geodesic equation Yields an iterator

Parameters
  • OdeMethodKwargs (dict, optional) – Kwargs to be supplied to the ODESolver Dictionary with key ‘stepsize’ along with a float value is expected Defaults to {'stepsize': 1e-3}

  • return_cartesian (bool, optional) – Whether to return calculated values in Cartesian Coordinates Defaults to True

Yields
  • float – Affine Parameter, Lambda, where the geodesic equations were evaluated

  • ~numpy.ndarray – Numpy array containing [x0, x1, x2, x3, v0, v1, v2, v3] for each Lambda