I am reading a book on numerical methods and the square of the discrete $L^2$ norm is defined as $$||x||^2_2=h\sum_1^Nx^2_i$$ Every point gets a "weight", which is $h$, thus this is like an average over the squares of the values at all points. This in fact comes from the approximation of a continuous integral. On the other hand, can I define similar norm where the grid is nonuniform with spacing $h_i$ as $$||x||^2_2=\sum_1^Nh_ix^2_i$$ that seems to me natural as I could approximate a continuous integral this way too but as I don't see that in the books made me suspicious I am missing something! So, if I have non-uniform grid and I want to make some estimates in this norm, how one should define it?
-
$\begingroup$ there is no reference as I have NOT seen that in the book, that's why I am asking what is wrong by defining it this way? $\endgroup$– KamilCommented Jan 24, 2013 at 12:07
-
$\begingroup$ @David, I don't think I have a typo there, do I? I just opend first pdf eecs.berkeley.edu/~colella/E266AFall2012/E266A20120920.pdf and it looks the same to me on page 2. $\endgroup$– KamilCommented Jan 27, 2013 at 14:49
-
$\begingroup$ @David, I opened the book by Leveque on subsection A1.5 where the norm is defined the same as in the question, the elements in the sum are numbered from $0...N$ and $h=1/N$, I did not write explicitly that $h=1/(N-1)$, is that the issue? In fact, in the article above I linked the scaling is done by the number of points and in the book I mentioned the scaling is by the number of grid intervals. Can you be specific what is the issue here please? $\endgroup$– KamilCommented Jan 27, 2013 at 22:42
-
$\begingroup$ I apologize. You confused me by claiming that you would define the norm. I never looked at the left side of your equation, since I assumed it was consistent with the text preceding it. I see now that you have (correctly) defined the norm squared. I edited the text to be consistent with that. This is a fine question. $\endgroup$– David KetchesonCommented Jan 28, 2013 at 11:50
-
$\begingroup$ Dumb question here. You have $N$ points (nodes), but $N-1$ spaces between points (elements). How do you do that sum? Do you consider the distance between the centroids of the elements? Do you then just take half the $h$ of the boundary elements? $\endgroup$– BrenoCommented Nov 16, 2023 at 18:09
2 Answers
You are exactly right: The norm is defined in such a way that the discrete (vector) norm equals (or at least approximates) the continuous norm of a corresponding function.
When you have non-uniform meshes, the form you give (with the $h_i$ inside the sum) is correct and frequently used in the analysis of non-uniform meshes.
Of course, in 2d, the correct formula would contain a factor of $h^2$ and in 3d of $h^3$.
Given a function $f(x)$, $x \in (a,b)$, let we define the $L^2$ norm as \begin{equation} \lVert f \rVert_2^2 = \int_a^b \lvert f(x)\rvert^2 \, dx. \end{equation} Given a vector $\mathbf f \equiv \{ f_i = f(x_i), \; i=0\dots N\}$, with $x_i = a + i \frac{b-a}{N}$ we define the discrete $L^2$ norm as
\begin{align} \lVert \mathbf f \rVert_{2,\text{d}}^2 &= h \sum_{i=0}^N \lvert f_i \rvert^2, &h = \frac{b-a}{N} \end{align} In your question you assume that this is done because we want that \begin{equation} \lim_{h \rightarrow 0} \: \lVert \mathbf f \rVert_{2,\text{d}} = \lVert f \rVert_2 \end{equation} and you are interpreting the discrete norm as a sort of quadrature rule, and wonder why for non uniform grids a better formula is not used.
This interpretation is not wrong, but not the only one possible. As an engineer working with physical quantities, instead of pure numbers, I prefer to think of the discrete norm as of an $\ell^2$-euclidean norm scaled in such a way to make it dimensionally homogeneous to the continuum $L^2$ norm. So if we can prove that $\lVert f - f^h \rVert_2 \rightarrow 0$, we may expect that $\lVert \mathbf f -\mathbf f^h\rVert_{2,\text{d}} \rightarrow 0$. Without the scaling factor this would not be true.
EDIT:
I deleted my conclusions here. See the answer by Wolfgang.
Note that the scaled euclidean norm is easy to compute, while your proposal is a little bit imprecise (may raise some concerns as a quadrature formula) and expensive to compute.
Bottom line: the discrete $L^2$-norm is not (needs not to be) and approximation to the continuous one, but can be simply interpreted as a scaled $\ell^2$-euclidean norm, dimensionally consistent to continuous $L^2$ norm.
-
$\begingroup$ ok, I agree with a scaling factor. Even though it might be expensive to compute it's not a fundamental reason not to use it though. Moreover, if I can't define it anyway, looks like I can't do than any stability estimates for non-uniform grid as stability comes with a norm and I am not able to come up with one. How would one handle than the proofs for non-uniform grid? $\endgroup$– KamilCommented Jan 25, 2013 at 2:14
-
$\begingroup$ @Kamil my reply was just one possible rationale for the discrete $L^2$ norm in $1D$. (Following the same reasoning you arrive at a $h^d$ scaling for $d$-dimensional spaces.) It is not my intention forbidding you the use of any norm defined in the way you may prefer; however to address your concerns you should provide concrete examples in which you think that the "standard" definition is not valid or leads to wrong results. $\endgroup$ Commented Jan 25, 2013 at 8:47
-
$\begingroup$ I see. The example is I have a non-uniform grid, doesn't have to be anything crazy, just a simple non-equidistancy. Thus, I am considering a method, say Euler implicit and willing to prove its stability. Therefore, how to define a norm then? I see in books all the theory is built for uniform meshes, however, there are advantages of the non0uniform grid in terms of a local truncation error... $\endgroup$– KamilCommented Jan 26, 2013 at 0:51
-
$\begingroup$ I appreciate your answer but I have excepted the second one as it did in fact answer the question of the possibility to define such a norm. $\endgroup$– KamilCommented Jan 30, 2013 at 1:37