Consider the differential equation C. What is the magnitude of the error in the
ID: 1943089 • Letter: C
Question
Consider the differential equation
C. What is the magnitude of the error in the two Euler approximations you found?
Magnitude of error in Euler with 2 steps =
Magnitude of error in Euler with 4 steps =
D. By what factor should the error in these approximations change (that is, the error with two steps should be what number times the error with four)?
factor =
(How close to this is the result you obtained above?)
Explanation / Answer
Do the problem for y(0) = 2 The Euler stepping method for y' = f(x) is y(x(n+1)) = y(x(n)) + dx f(x(n)) (A). dx = 0.25, for four steps. So x(1) = dx = 0.25, x(2) = 2dx = 0.5, x(3) = 0.75. y(0) = 1. y(0.25) = y(0) + dx * f(0) = 1 + 0.25*(4*0.) = 1. y(0.5) = y(0.25) + dx * f(0.25) = 1 + 0.25*(4.*0.25) = 1.25. y(0.75) = y(0.5) + dx * f(0.5) = 1.25 + 0.25*(4.*0.5) = 1.75. y(1.0) = y(0.75) + dx * f(0.75) = 1.75 + 0.25*(4.*0.75) = 2.50. The exact solution is y(x) = 2x^2 + 1. So y(0.25) = 1.125, y(0.5) = 1.5, y(0.75) = 2.125, and y(1) = 3. The error at x=1: E = |2.5-3| = 0.5. For (D), you should be able to conclude that the error is halved if the step dx is halved. Therefore, E = O(dx).