$$ \newcommand{\uex}{{u_{\small\mbox{e}}}} \newcommand{\Aex}{{A_{\small\mbox{e}}}} \newcommand{\half}{\frac{1}{2}} \newcommand{\Oof}[1]{\mathcal{O}(#1)} $$
Implementation of the norm of the error
$$ E = ||e^n||_{\ell^2} = \sqrt{\Delta t\sum_{n=0}^{N_t} (e^n)^2}$$
Python w/array arithmetics:
e
=
exact_solution(t)
-
u E
=
sqrt(dt
*
sum
(e
**2
))