Developer reference¶
Listing solvers¶
Solvers¶
Fixed step¶
- class nbkode.ForwardEuler(*args, first_stepper_cls='auto', **kwargs)[source]¶
The simple explicit (forward) Euler scheme
y[n+1] = y[n] + h * f(t[n], y[n])
- class nbkode.BackwardEuler(*args, first_stepper_cls='auto', **kwargs)[source]¶
The simple implicit (backward) Euler scheme
y[n+1] = y[n] + h * f(t[n+1], y[n+1])
- class nbkode.AdamsBashforth1(*args, first_stepper_cls='auto', **kwargs)[source]¶
The Adams–Bashforth method with ONE is equivalent to Euler
- class nbkode.AdamsBashforth2(*args, first_stepper_cls='auto', **kwargs)[source]¶
The Adams–Bashforth method with TWO.
u[n+1] = u[n] + h * (3/2 *f(u[n], t[n]) - 1/2 * f(u[n-1], t[n-1]))
- class nbkode.AdamsBashforth3(*args, first_stepper_cls='auto', **kwargs)[source]¶
The Adams–Bashforth method with THREE.
u[n+1] = u[n] + h /12 .*(23*f(u[n], t[n]) - 16*f(u[n-1], t[n-1]) + 5*f(u[n-2], t[n-2]))
- class nbkode.AdamsBashforth4(*args, first_stepper_cls='auto', **kwargs)[source]¶
The Adams–Bashforth method with FOUR.
u[n+1] = u[n] + h / 24 .* (55.*f(u[n], t[n]) - 59*f(u[n-1], t[n-1]) + 37*f(u[n-2], t[n-2]) - 9*f(u[n-3], t[n-3]))
Variable step¶
- class nbkode.DOP853(*args, **kwargs)[source]¶
Explicit Runge-Kutta method of order 8.
This is a Python implementation of “DOP853” algorithm originally written in Fortran 4, 5. Note that this is not a literate translation, but the algorithmic core and coefficients are the same. Can be applied in the complex domain.
References
- class nbkode.RungeKutta23(*args, **kwargs)[source]¶
Explicit Runge-Kutta method of order 3(2).
This uses the Bogacki-Shampine pair of formulas 1. The error is controlled assuming accuracy of the second-order method, but steps are taken using the third-order accurate formula (local extrapolation is done). A cubic Hermite polynomial is used for the dense output. Can be applied in the complex domain.
References
- 1
P. Bogacki, L.F. Shampine, “A 3(2) Pair of Runge-Kutta Formulas”, Appl. Math. Lett. Vol. 2, No. 4. pp. 321-325, 1989.
- class nbkode.RungeKutta45(*args, **kwargs)[source]¶
Explicit Runge-Kutta method of order 5(4).
This uses the Dormand-Prince pair of formulas 2. The error is controlled assuming accuracy of the fourth-order method accuracy, but steps are taken using the fifth-order accurate formula (local extrapolation is done). A quartic interpolation polynomial is used for the dense output 3. Can be applied in the complex domain.
References