vivyd.solvers.RK4_38#

class RK4_38(verbose=False)[source]#

Bases: Solver

An explicit RK4 integrator following the 3/8 rule for solving systems of ordinary differential equations of the form

\[\dfrac{ds}{dt} = f(t, s).\]

The method is a simple first-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}{3}, s_n + \dfrac{k_1}{3}\Delta t\right) \\ k_3 &= f\left(t_n + \dfrac{2\Delta t}{3}, s_n + (- \dfrac{k_1}{3} + k_2) \Delta t\right) \\ k_4 &= f\left(t_n + \Delta t, s_n + (k_1 - k_2 + k_3) \Delta t\right) \\ s_{n+1} &= s_n + \dfrac{\Delta t}{8} (k_1 + 3 k_2 + 3 k_3 + k_4)\end{split}\]

The integrator supports both pure Python and Taichi-accelerated implementations (as defined by the vivyd.models.TaichiCompatible and vivyd.models.TaichiConvertible protocols).

Parameters:

verbose (bool)