$$
\newcommand{\uex}{{u_{\small\mbox{e}}}}
\newcommand{\Aex}{{A_{\small\mbox{e}}}}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\tp}{\thinspace .}
\newcommand{\Oof}[1]{\mathcal{O}(#1)}
\newcommand{\dfc}{\alpha} % diffusion coefficient
$$
Step 4: Formulating a recursive algorithm
- Nature of the algorithm: compute \( u \) in space at \( t=\Delta t, 2\Delta t, 3\Delta t,... \)
- Two time levels are involved in the general discrete equation:
\( n+1 \) and \( n \)
- \( u^n_i \) is already computed for \( i=0,\ldots,N_x \),
and \( u^{n+1}_i \) is the unknown quantity
Solve the discretized PDE for the unknown \( u^{n+1}_i \):
$$
\begin{equation}
u^{n+1}_i = u^n_i + F\left(
u^{n}_{i+1} - 2u^n_i + u^n_{i-1}\right)
\tag{8}
\end{equation}
$$
where
$$ F = \dfc\frac{\Delta t}{\Delta x^2} $$