Question 23.5: Use both the explicit and implicit Euler methods to solve Eq...

Use both the explicit and implicit Euler methods to solve Eq. (23.17), where y(0) = 0. (a) Use the explicit Euler with step sizes of 0.0005 and 0.0015 to solve for y between t = 0 and 0.006. (b) Use the implicit Euler with a step size of 0.05 to solve for y between 0 and 0.4.
\frac{dy}{dt} = −1000y + 3000 − 2000e^{−t}                   (23.17)

The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.

(a) For this problem, the explicit Euler’s method is

y_{i+1}=y_i+\left(-1000 y_i+3000-2000 e^{-t_i}\right)h.

The result for h = 0.0005 is displayed in Fig. 23.9a along with the analytical solution.
Although it exhibits some truncation error, the result captures the general shape of the analytical solution. In contrast, when the step size is increased to a value just below the stability limit (h = 0.0015), the solution manifests oscillations. Using h > 0.002 would result in a totally unstable solution—that is, it would go infinite as the solution progressed.
(b) The implicit Euler’s method is
y_{i+1}=y_i+\left(-1000 y_{i+1}+3000-2000 e^{-t_{i+1}}\right) h
Now because the ODE is linear, we can rearrange this equation so that y_{i+1} is isolated on the left-hand side:

y_{i+1}=\frac{y_i+3000 h-2000 h e^{-t_{i+1}}}{1+1000 h}

The result for h = 0.05 is displayed in Fig. 23.9b along with the analytical solution. Notice that even though we have used a much bigger step size than the one that induced instability for the explicit Euler, the numerical result tracks nicely on the analytical solution.

23.9

Related Answered Questions