$$
\newcommand{\uex}{{u_{\small\mbox{e}}}}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\halfi}{{1/2}}
\newcommand{\xpoint}{\boldsymbol{x}}
\newcommand{\normalvec}{\boldsymbol{n}}
\newcommand{\Oof}[1]{\mathcal{O}(#1)}
\newcommand{\Ix}{\mathcal{I}_x}
\newcommand{\Iy}{\mathcal{I}_y}
\newcommand{\It}{\mathcal{I}_t}
\newcommand{\setb}[1]{#1^0} % set begin
\newcommand{\sete}[1]{#1^{-1}} % set end
\newcommand{\setl}[1]{#1^-}
\newcommand{\setr}[1]{#1^+}
\newcommand{\seti}[1]{#1^i}
\newcommand{\Real}{\mathbb{R}}
$$
Testing with the exact discrete solution
- We have established that \( u^{n+1}_i = \uex(x_i,t_{n+1})=x_i(L-x_i)(1+t_{n+1}/2) \)
- Run one simulation with one choice of \( c \), \( \Delta t \), and \( \Delta x \)
- Check that \( \max_i |u^{n+1}_i - \uex(x_i,t_{n+1})| < \epsilon \),
\( \epsilon\sim 10^{-14} \) (machine precision + some round-off errors)
- This is the simplest and best verification test
Later we show that the exact solution of the discrete equations
can be obtained by \( C=1 \) (!)