rk4 module

Define Runge-Kutta integraiton function.

rk4(u: ndarray, du: Callable[[float, ndarray], ndarray], x: float, dx: float) ndarray

Compute variation of u between x and x+dx.

Use 4-th order Runge-Kutta method.

Note

This is a slightly modified version of the RK. The k_i are proportional to delta_u instead of du_dz.

Parameters:
Returns:

delta_u – Variation of u between x and x+dx.

Return type:

numpy.ndarray