Topic 14.2: Heun's Method (Maple)

Contents Previous Chapter Start of Chapter Previous Topic Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple Next Topic Next Chapter

Given the IVP y(1)(t = t y(t) - t2 + 1 with y(0) = 3, to approximate y(1), we can do:

t[0] := 0;
t[1] := 1;
y[0] := 3;
f := (t, y) -> t*y - t^2 + 1;
h := t[1] - t[0];
K[0] := f(t[0],     y[0]         );
K[1] := f(t[0] + h, y[0] + h*K[0]);
y[1] := y[0] + h*(K[0] + K[1])/2;

	

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.