Runge-Kutta method: Difference between revisions

m
Line 100:
INT num points = ENTIER ((x1 - x0) / dx + 0.5); CO Add 0.5 for rounding errors. CO
[0:num points] REAL y; y[0] := y0; CO Grid and starting point.CO
PROC dy by dtdx = (REAL tx, y) REAL : tx * sqrt(y); CO Differential equation. CO
FOR i TO num points
DO
y[i] := rk4 (dy by dtdx, y[i-1], x0 + dx * (i - 1), dx)
OD;
print ((" x true y calc y relative error", newline));
Anonymous user