gncpy.math.rk4_backward

rk4_backward(f, x, h, **kwargs)[source]

Implements a backwards classic Runge-Kutta integration RK4.

Parameters:
  • f (callable) – function to reverse integrate, must take x as the first argument and arbitrary kwargs after

  • x (numpy array, or float) – state needed by function

  • h (float) – step size

Returns:

state – Reverse integrated state

Return type:

numpy array, or float