Qu

rk4

Builtin index · Signal processing

result = rk4(f, tspan, y0, h)

Input: f, tspan, y0, h · Output: result

What it is

Classical fixed-step Runge-Kutta of order 4 with step h > 0; the last step is shortened to land exactly on tf, and every step is reported.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = rk4(f, tspan, y0, h)
f —not documented yet
tspan —not documented yet
y0 —not documented yet
h —Classical fixed-step Runge-Kutta of order 4 with step h > 0.
ode45 —no rejected; no error control and no events, so rtol=/events= are errors
Returns {t, y, steps, nfev, status} like ode45 (no rejected; no error control and no events, so rtol=/events= are errors). status is "nonfinite" if the state overflows. Use it when you need a fixed grid or a known cost; there is no check that h is small enough for stability.

Examples

No documentation example calls this form yet. The Signal processing chapter is where one belongs.

How it works

and general minimization. Only a user-defined function (by name, the same convention pmap/spawn use) can be the target of any of these — not a builtin. fzero(f, a, b, [tol=1e-10], [max_iter=100]) — Brent's method: robust root finding (guaranteed convergence given a bracket [a,b] where f changes sign), no derivative needed. The "something better than plain bisection" choice.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.