Geodesic module¶
This module contains the class, defining a general Geodesic:
-
class
einsteinpy.geodesic.Geodesic(time_like, metric, coords, end_lambda, step_size=0.001, return_cartesian=True)[source]¶ Bases:
objectBase Class for defining Geodesics
- Parameters
time_like (bool) – Determines type of Geodesic
Truefor Time-like geodesicsFalsefor Null-like geodesicsmetric (*) – Metric, in which Geodesics are to be calculated
coords (*) – Coordinate system, in which Metric is to be represented
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-3return_cartesian (bool, optional) – Whether to return calculated values in Cartesian Coordinates Defaults to
True
-
property
state¶ Returns the Initial State Vector of the Geodesic
-
property
trajectory¶ Returns the “Trajectory” of the Geodesic
-
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.0OdeMethodKwargs (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
- 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
-
class
einsteinpy.geodesic.Timelike(metric, coords, end_lambda, step_size=0.001, return_cartesian=True)[source]¶ Bases:
einsteinpy.geodesic.GeodesicClass for defining Time-like Geodesics
- Parameters
metric (*) – Metric, in which Geodesics are to be calculated
coords (*) – Coordinate system, in which Metric is to be represented
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-3return_cartesian (bool, optional) – Whether to return calculated values in Cartesian Coordinates Defaults to
True