Error of finite difference for solving heat equation

204 Views Asked by At

Consider solving the heat equation $u_t=u_{xx}$ on $[0,2\pi]$ with periodic boundary condition. Numerically, we can solve it using second order finite difference in space discretization and Euler-Backward in time.

One can get the following error estimate:

$$ \left\|U^{n}-u^{n}\right\|_{\infty, h} \leq C t_{n}\left(h^{2}+k\right) \max _{t \leq t_{n}}|u(\cdot, t)|_{\mathcal{C}^{4}}, \quad \text { for } t_{n} \geq 0 $$ where $u^n=u(\cdot,t_n)$, $U^n$ is the numerical solution at time $t_n$, $h$ is the size of the mesh and $k$ is the size of time step.

In the following figure, I plot the error $\left\|U^{n}-u^{n}\right\|_{\infty, h}$ for each $n$: The true solution is set to be $u(x,t)=\sin(x)e^{-t}$ enter image description here

What I confused here is that why the error will decrease after a certain of time? At each time step, there will be some errors added to the solution. So, I thought the error might be as a nondecreasing function of time t.