Runge Kutta module

class einsteinpy.integrators.runge_kutta.RK4naive(fun, t0, y0, t_bound, stepsize)[source]

Bases: object

Class for Defining Runge-Kutta 4th Order ODE solving method

Initialization

Parameters
  • fun (function) – Should accept t, y as parameters, and return same type as y

  • t0 (float) – Initial t

  • y0 (array or float) – Initial y

  • t_bound (float) – Boundary time - the integration won’t continue beyond it. It also determines the direction of the integration.

  • stepsize (float) – Size of each increment in t

step()[source]

Updates the value of self.t and self.y

class einsteinpy.integrators.runge_kutta.RK45(fun, t0, y0, t_bound, stepsize, rtol=None, atol=None)[source]

Bases: scipy.integrate._ivp.rk.RK45

This Class inherits ~scipy.integrate.RK45 Class

Initialization

Parameters
  • fun (function) – Should accept t, y as parameters, and return same type as y

  • t0 (float) – Initial t

  • y0 (array or float) – Initial y

  • t_bound (float) – Boundary time - the integration won’t continue beyond it. It also determines the direction of the integration.

  • stepsize (float) – Size of each increment in t

  • rtol (float) – Relative tolerance, defaults to 0.2*stepsize

  • atol (float) – Absolute tolerance, defaults to rtol/0.8e3

step()[source]

Updates the value of self.t and self.y