Consider the following diffusion equation:
$\frac{\partial u}{\partial t} = D \frac{\partial^2 u}{\partial x^2}$ $x \in [0, 1]$, $t > 0$
(1)
with initial and boundary conditions given by
$u(x, 0) = \begin{cases} x, & \text{if } 0 \le x \le 0.5, \\ 1 - x, & \text{if } 0.5 < x \le 1. \end{cases}$ (2)
$u(0, t) = u(1, t) = 0$, $t \ge 0$.
(3)
Numerically solve (1)-(3) with the diffusion coefficient $D = 1/2$. Use
the following difference scheme:
$\frac{u_j^{n+1} - u_j^n}{\Delta t} = D \frac{u_{j+1}^n - 2u_j^n + u_{j-1}^n}{\Delta x^2}$
(ES) explicit
Take $\Delta x = 0.1$ and compute the numerical solution of (1)-(3) with $\Delta t =$
1/50,1/100,1/200.
Questions.
Compare plots of the exact and numerical solution for each scheme at
$\Delta t = 1/50, 1/100, 1/200$.
Explain the results of the computations.