vivyd.solvers.RK4#
- class RK4(verbose=False)[source]#
Bases:
SolverAn explicit RK4 integrator for solving systems of ordinary differential equations of the form
\[\dfrac{ds}{dt} = f(t, s).\]The method is a simple fourth-order integrator that updates the state of the system at each time step as
\[\begin{split}k_1 &= f(t_n, s_n) \\ k_2 &= f\left(t_n + \dfrac{\Delta t}{2}, s_n + k_1 \dfrac{\Delta t}{2}\right) \\ k_3 &= f\left(t_n + \dfrac{\Delta t}{2}, s_n + k_2 \dfrac{\Delta t}{2}\right) \\ k_4 &= f\left(t_n + \Delta t, s_n + k_3 \Delta t\right) \\ s_{n+1} &= s_n + \dfrac{\Delta t}{6} (k_1 + 2 k_2 + 2 k_3 + k_4)\end{split}\]The integrator supports both pure Python and Taichi-accelerated implementations (as defined by the
vivyd.models.TaichiCompatibleandvivyd.models.TaichiConvertibleprotocols).- Parameters:
verbose (bool)