Problem:
Consider the differential equation
$ \frac{dy}{dt} = y $
with y(0)=1. The exact solution to this problem is given by $ y(t)=e^t $. Knowing the exact solution and using $\Delta t=0.1$ with the Euler scheme, compute the local error for two iterative steps ((a) $\epsilon_1$, (b) $\epsilon_2$) and compute the global error ((c) $E_1$, (d) $E_2$) at each of the three steps.
Solution:
The local error computation is exactly the same as the last problem.
$ \epsilon_1 = e^{0.1} - (1 + 0.1) \approx 0.0052 $
$ \epsilon_2 = e^{0.2} - (e^{0.1} + 0.1e^{0.1}) \approx 0.0057 $
For the 1st step, the global error is actually the same as the local error.
$ E_1 = \epsilon_1 = 0.0052 $
For the 2nd step, we need to actually iterate twice.
$ y_1 = 1 + 0.1 $
$ y_2 = y_1 + 0.1 y_1 = 1.21 $
Therefore $ E_2 = e^{0.2} - 1.21 \approx 0.011 $
Notice an important observation here - $ \epsilon_2 \neq E_2 - E_1 $. The error introduced in the last step also lead to wrong slope estimation, the local error of the second step assumed the correct slope will be there!
Consider the differential equation
$ \frac{dy}{dt} = y $
with y(0)=1. The exact solution to this problem is given by $ y(t)=e^t $. Knowing the exact solution and using $\Delta t=0.1$ with the Euler scheme, compute the local error for two iterative steps ((a) $\epsilon_1$, (b) $\epsilon_2$) and compute the global error ((c) $E_1$, (d) $E_2$) at each of the three steps.
Solution:
The local error computation is exactly the same as the last problem.
$ \epsilon_1 = e^{0.1} - (1 + 0.1) \approx 0.0052 $
$ \epsilon_2 = e^{0.2} - (e^{0.1} + 0.1e^{0.1}) \approx 0.0057 $
For the 1st step, the global error is actually the same as the local error.
$ E_1 = \epsilon_1 = 0.0052 $
For the 2nd step, we need to actually iterate twice.
$ y_1 = 1 + 0.1 $
$ y_2 = y_1 + 0.1 y_1 = 1.21 $
Therefore $ E_2 = e^{0.2} - 1.21 \approx 0.011 $
Notice an important observation here - $ \epsilon_2 \neq E_2 - E_1 $. The error introduced in the last step also lead to wrong slope estimation, the local error of the second step assumed the correct slope will be there!
No comments:
Post a Comment