Concept:
Heun’s Method:
Consider dxdy=f(x,;y) with the initial condition y(x0) = y0
Initially y1 is computed by Euler’s formula.
y1p=y0+h;f(x0,;y0)
Then the modified value of y1 is given by
y1c=y0+2h[f(x0,;y0)+f(x1,;y1p)]
Similarly, we can find y2, y3, …. yn
Where p indicates predicator and c indicates character.
This method is also called modified Euler’s method (or) second order Range-kutta method.
Calculation:
Given differential equation is,
f(x,;y)=dxdy=x2+y
Initial condition y0 = 1, x0 = 0
Step size, h = 0.2
y1p=1+0.2;[f(0,;1)]=1+0.2(0+1)=1.2
y1c=1+20.2;[f(0,;1)+f(0.2,;1.2)]
f(0,;1)=0+1=1
f(0.2,;1.2)=0.22+1.2=1.24
y1c=1+0.1[1+1.24]=1.224