Ralston2

Contents

Ralston2#

class brainpy.integrators.ode.Ralston2(f, var_type=None, dt=None, name=None, show_code=False, state_delays=None, neutral_delays=None)[source]#

Ralston’s method for ODEs.

Ralston’s method is a second-order method with two stages and a minimum local error bound.

Given ODEs with a given initial value,

\[y'(t) = f(t,y(t)), \qquad y(t_0)=y_0,\]

the Ralston’s second order method is given by

\[y_{n+1}=y_{n}+\frac{h}{4} f\left(t_{n}, y_{n}\right)+ \frac{3 h}{4} f\left(t_{n}+\frac{2 h}{3}, y_{n}+\frac{2 h}{3} f\left(t_{n}, y_{n}\right)\right)\]

Therefore, the corresponding Butcher tableau is:

\[\begin{split}\begin{array}{c|cc} 0 & 0 & 0 \\ 2 / 3 & 2 / 3 & 0 \\ \hline & 1 / 4 & 3 / 4 \end{array}\end{split}\]