rk4 module
Define Runge-Kutta integraiton function.
- rk4(u, du, x, dx)[source]
Compute variation of
ubetweenxandx+dx.Use 4-th order Runge-Kutta method.
Note
This is a slightly modified version of the RK. The
k_iare proportional toduinstead ofdu/dx.- Parameters:
- Return type:
- Returns:
Variation of
ubetweenxandx+dx.
- rk4_2d(u, v, delta, x, dx)[source]
Compute variation of
uandvbetweenxandx+dx.Use 4-th order Runge-Kutta method.
uandvare scalar. This version isrk4()but with two dimensions only.Note
This is a slightly modified version of the RK. The
k_iare proportional todelta_uinstead ofdu_dz.- Parameters:
- Return type:
- Returns:
Variation of
uandvbetweenxandx+dx.