Euler Worksheet
Euler Worksheet
yr + 1 = yr + hf(xr , yr)
and
xr + 1 = xr + h
dy
1. Solve = 2xy. Solve for x = 0(0.2)0.6 given that x0 = 0, y0 = 1 and h = 0.2
dx
dy
2. Solve = x y. Solve for x = 0(0.1)0.2 given that x0 = 0, y0 = 0 and h = 0.1
dx
dy
3. Solve = x 3 xy. Solve for x = 1.0(0.1)1.2 given that x0 = 1, y0 = 1 and h = 0.1
dx
dy
4. Solve = 2(1 + x) y. Solve for x = 2(0.2)2.4 given that x0 = 2, y0 = 5 and h = 0.2
dx
dy
5. Solve = x 2 + 3y. Solve for x = 0(0.3)0.3 given that x0 = 0, y0 = 1 and h = 0.3
dx
dy
6. Solve = x 2 + 3y. Solve for x = 0(0.1)0.3 given that x0 = 0, y0 = 1 and h = 0.1
dx
Compare your answer with your answer to question 5. Which is the more accurate?
dy
7. Solve = 2x + y 2 . Solve for x = 0(0.1)0.3 given that x0 = 0, y0 = 1.4 and h = 0.1
dx
Improved Euler Method
The gradient at the end of the interval can then be estimated by evaluating f(x1 , y1* ). The average
value of the two gradients replaces f(x0 , y0) in the Euler formula, so that;
2
Worksheet 2
dy
1. Solve = x 2 2x + y using the modified Euler method
dx
Find y1 y2 and y3 given that x0 = 0, y0 = 0.5 and h = 0.1
dy
2. Solve = 2(1 + x) y using the modified Euler method.
dx
Find y1 up to y5 given that x0 = 2, y0 = 5 and h = 0.2
Answers
Worksheet 1
Questio x0 , y0 x1 , y1 x2 , y2 x3 , y3
n
1 0 1 0.2 1 0.4 1.08 0.6 1.2528
2 0 0 0.1 0 0.2 0.01
3 1 1 1.1 1 1.2 1.0231
4 2 5 2.2 5.2 2.4 5.44
5 0 1 0.3 1.9
6 0 1 0.1 1.3 0.2 1.691 0.3 2.2023
7 0 1.4 0.1 1.596 0.2 1.8707 0.3 2.2607
Worksheet 2
Qu No x0 , y0 x1 , y1 x2 , y2 x3 , y3
1 0 0.5 0.1 0.543 0.2 0.5716 0.3 0.5863
Mjbs/NumericalAnalysis/EulerWorksheet 2/2