# Mesh error quantification using error norm for a sharp logistic function [closed]

Consider the following logistic function in 1D for the domain $0$ to $1$.

$$f(x) = \frac{1}{1 + \exp(-50(x-0.5))}$$

Let's say I resolve this on two meshes:

• first with 11 equispaced points (0.0, 0.1, 0.2, ... 1.0)
• second with 101 equispaced points (0.0, 0.01, 0.02, ... 1.0)

The plots for the two meshes look like this (blue is first, green is second): How do I compute the error norm for the two meshes? I don't know if L2 norm is the best choice but let's say it is. In that case, the discrete version of the L2 norm is usually stated as follows:

$$||\mathrm{error}||_{2} ^{2} = h \sum_{i} |f_{i,\mathrm{ref}} - f_{i,h}|^2$$

Where $f_{i,h}$ is function value for a given mesh at mesh point $i$, and $f_{i,\mathrm{ref}}$ is the value of the analytical function used as a reference.

However this will produce zero error norm for both cases, since the function evaluated at the mesh points is exact, i.e., it comes directly from the analytical expression. But we can clearly see in the plot that it's a wrong answer for the mesh with 11 points, i.e., error should be non-zero around the middle of the domain, resulting in a non-zero error norm. The zero-error answer is wrong for 101 points too but in the plot the error is not very visible (but it's still there, due to discretization/sampling). In other words, the second mesh has reduced the error compared to the first mesh. (what I described is beginner stuff; just putting things in context).

For correct error computation, a possible alternative is to compute the norm through quadrature. But before we even think about quadrature, we need to compute the error function itself. But how do we do that? Do we use a high resolution mesh (like 1001, or 10001 points) where we resolve $f_{i,\mathrm{ref}}$ as well as interpolate $f_{i,h}$ (say we use linear interpolation)? but this feels very sloppy/adhoc. Is there a better, more systematic way?

(I'm just trying to find out what are the "standard" ways of doing such error analysis for mesh resolution, such that I can show that the error in the second case goes down compared to that in the first case. Any tips for doing similar analysis in 2D on unstructured meshes would also be highly appreciated).

• Maybe I don't understand the question, but Did you try the standard error formula for linear interpolation piecewise? (See proposition 1.2 in this pdf ) The formula relate the estimate to $h^4$, and the second derivate of $f$ (you have $f$ so you can estimate the required norm) – Mauro Vanzetto Oct 30 '17 at 11:36
• I am not familiar with the proposition in the document you shared (probably something like that is what I'm looking for). I'll try to understand it but it will take time. Do you think this pdf chapter has enough details that can let me do simple/standard meshing error analysis on an analytical function? – Fi Zixer Oct 30 '17 at 12:12
• This kind of arguments, generally, are present in entry level course of numerical analysis, so if your goal is to work over mesh error I suggest to look this argument. The above pdf is an example, but there are a lot of books. With this back ground, for example, you easy understand that calculate the error between the function and the interpolation in the mesh points has no much sense because when you built the interpolation function you force it to be equals the real function over the mesh. – Mauro Vanzetto Oct 31 '17 at 18:52
• Considering your case roughly speaking we can tell that the second mesh is 100 times better than the first (if you see the norm error and not the square norm). – Mauro Vanzetto Oct 31 '17 at 18:52
• It may not make much sence because I presented the problem in 1D and oversimiplified form. But if it is 2D, and my second mesh was generated from an adaptive meshing technique (that I'm trying to publish) then it makes all the sense to do this error analysis. Furthermore, this is the right-hand-side (or input) to a PDE, and I have to show that if input error reduces, output error reduces as a result. In that case it makes a world of sense don't you think? – Fi Zixer Nov 1 '17 at 9:01