Prof. Vladimir A. Dobrushkin
This tutorial contains many matlab scripts.
You, as the user, are free to use all codes for your needs, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately. Any comments and/or contributions for this tutorial are welcome; you can send your remarks to
Consider the initial value problem \( y' = f(x,y) , \quad y(x_0 ) = y_0 . \) The third order multistep method is based on the following Adams--Bashforth-Moulton formulas:
There is known another third order multistep method, called Hermite predictor-Milne corrector method:
Predictor-corrector of order 2:
Block[{xold = x0, yold = y0, ynew = y1, sollist = {{x0, y0}}, h},
h = N[(xn - x0)/steps]; sollist = Append[sollist, {x0 + h, y1}];
Do[xnew = xold + h;
xnew2 = xold + h*2;
k1 = f /. {x -> xold, y -> yold};
k2 = f /. {x -> xnew, y -> ynew};
abnew = ynew + (3*h/2)*k2 - h*k1/2;
k3 = f /. {x -> xnew2, y -> abnew};
bm = ynew + h*k2/2 + h*k3/2;
sollist = Append[sollist, {xnew2, bm}];
xold = xnew;
yold = ynew; ynew = bm, {steps}];
Return[sollist[[steps + 1]]]]
To apply this method, use the following commands:
ABM2[f[x, y], {x, 0, 1.0}, {y, 1, Exp[0.1*0.1]}, 10]
If you want to see the whole table of values:
Block[{xold = x0, yold = y0, ynew = y1, sollist = {{x0, y0}}, h},
h = N[(xn - x0)/steps]; sollist = Append[sollist, {x0 + h, y1}];
Do[xnew = xold + h;
xnew2 = xold + h*2;
k1 = f /. {x -> xold, y -> yold};
k2 = f /. {x -> xnew, y -> ynew};
abnew = ynew + (3*h/2)*k2 - h*k1/2;
k3 = f /. {x -> xnew2, y -> abnew};
bm = ynew + h*k2/2 + h*k3/2;
sollist = Append[sollist, {xnew2, bm}];
xold = xnew;
yold = ynew; ynew = bm, {steps}];
Return[sollist]]
Example.
ABM2[f[x, y], {x, 0, 1.0}, {y, 1, Exp[0.1*0.1]}, 10]
Predictor-corrector method of order 2:
function Complete
Complete