Compute the first five iterations of eulers method for the g
Compute the first five iterations of euler\'s method for the given IVP along with the error at each step by completing the (partially filled) table below, using h = 0.2. Round all your values to four places after the decimal.
Solution
given y\' = -ty , y(0) = 1, h = 0.2
f(x, y) = -ty
the intial condition tells the value of intial coordinates is y0 = 1
Now we use the Euler method formulas to generate values for y1
The Y iteration formula with n = 0 gives us:
y1 = y0 + h f(y0)
y1 = 1+ 0.2 * (t0 * y0 )
= 1 + 0.2 * (0.0 * 1 )
= 1
y2 = y1 + h f(y1)
= 1 +0.2 * (-t1 * y1)
= 1 + 0.2(-0.2 * 1)
= 1 - 0.04 = 0.96
n tn yn y(tn) Error = yn - y(tn)
0 0.0 1 0 1
1 0.2 1 -0.2 1.2
2 0.4 0.96 -0.384 1.344
3 0.6 0.883 -0.529 1.412
4 0.8 0.777 -0.621 1.398
5 1.0 0.653 -0.653 1.306
