2
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ Why the $1/N$ coefficient? $\endgroup$
    – horchler
    Commented May 25, 2015 at 22:24
  • $\begingroup$ 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. $\endgroup$
    – Millemila
    Commented May 25, 2015 at 22:35

1 Answer 1

7
$\begingroup$

Use equation (2), equation (1) is wrong.

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$.

$\endgroup$
3
  • $\begingroup$ If you are comparing functions on different meshes, you want to use the form that includes $N$ or $\Delta x$. $\endgroup$
    – Bill Barth
    Commented May 26, 2015 at 1:29
  • $\begingroup$ @BillBarth Yes, I thought that was clear. Perhaps I should (or you can) edit the answer to make it more explicit? $\endgroup$ Commented May 26, 2015 at 1:50
  • $\begingroup$ Ok, as I thought thanks. Therefore, it s not true that norm L2 should be always smaller than norm L1 as pointed in the math.stackexchange link. That was only for the vectorial unscaled norm. $\endgroup$
    – Millemila
    Commented May 26, 2015 at 14:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.