# Correct way of computing norm $L_2$ for a finite difference scheme

I am computing the rate of convergence of my finite difference scheme in norm $L_2$. Which is the correct way to compute it? This:

\begin{align} L_2 &= \frac{1}{N}\sqrt{\sum_{j=1}^N(u^{numerical}_j-u^{exact}_j)^2} \;\;\;\;\;\;\;\;\;\;\;\; (1)\\ \end{align}

or this:

\begin{align} L_2 &= \sqrt{\frac{1}{N}\sum_{j=1}^N(u^{numerical}_j-u^{exact}_j)^2} \;\;\;\;\;\;\;\;\;\;\;\; (2)\\ \end{align}

where $u^{numerical}$ is the computed along-x velocity at velocity point $j$, with $j=1..N$, and $u^{exact}$ is the analytical solution. In some publications I saw the second option, but that clashes against the fact that norm $L_2$ should be always smaller than norm $L_1$ (see https://math.stackexchange.com/questions/245052/showing-that-l2-norm-is-smaller-than-l1 ). However here norms are "scaled" so I guess that inequality should hold only for the unscaled version. Note that if one uses (1) the inequality still holds. In Leveque's book a pag 140 the error is defined as:

\begin{align} L_2 &= \sqrt{\Delta{x} \sum_{j=1}^N(u^{numerical}_j-u^{exact}_j)^2} \;\;\;\;\;\;\;\;\;\;\;\; (3)\\ \end{align}

Although this would be strictly true for a finite volume method, if we extend it to a finite difference method and to two dimension, by division by the total active area of the domain one gets equation (2). This question is related to question Why a finite difference scheme would give second order of accuracy in norm L2 but 1.5 with L1 (while 1 with Linf)? , since I see that the order of accuracy is larger than the thoretical value of 2 if I use equation (1), while it is smaller if I use equation (2). Which one is the best formulation?

• Why the $1/N$ coefficient? – horchler May 25 '15 at 22:24
• Well you need to scale the norm, if you remove 1/N you cannot compute the rate of convergence, For example if one refines the grid by halving the grid spacing in x and y, one has four times the number of grid cells and if the error is 4 times smaller in each point => L2 stays constant. – Millemila May 25 '15 at 22:35

Technically the $L^2$ norm (upper case "L") is an integral norm of a function defined as $$\left|\left|f(x)\right|\right|_2 = \sqrt{ \int_\Omega |f(x)|^2 dx}.$$ I'm sure you meant $l^2$.
What you typically want to compute in the context of convergence of numerical methods is the finite dimensional analog of the $L^2$ norm which is an area-normalized version of the $l^2$ norm, meaning $$\left|\left|f\right|\right| = \sqrt{\sum_i \left|f_i\right|^2 \Delta x_i}$$ Note that $\Delta x$ is inside the square root.
In practice, the area of the domain is just a constant that you don't really care about and the step size ($\Delta x$) is often a constant so you can just use your equation (2). Equation (1) is off by a factor of $1/\sqrt{N}$ so you will underestimate your error for large $N$.
• If you are comparing functions on different meshes, you want to use the form that includes $N$ or $\Delta x$. – Bill Barth May 26 '15 at 1:29