[Math] How to test the convergence of a scheme of a PDE without knowing the exact solution

computer sciencenumerical methods

I am now solving a Schrodinger equation with a magnetic field. I don't know its exact solution. I am trying to test the convergence of the scheme by comparing the difference of numerical solution when using different mesh-sizes.

However, in the 2D case, the solution is stored in a matrix; when I change the number of nodal points $n$ ($dx=(x_{max}-x_{min})/(n-1)$), the size of the matrix changes.

Both the $L^2$ norm and $\sup{}$-norm require the same dimensions.

In this case, how can I measure the difference of the solutions?

Best Answer

Your simplest course of action is to directly obtain approximations for the solution of the PDE at exactly the same grid points.

This can be done be repeatedly refining an existing grid. The simplest method is to systematically cut the step size in half.

To be specific, suppose your 2D domain is the unit square and the initial step size is $h_0 = \frac{1}{2}$ in either direction. Your approximation can be stored in a matrix $A_0$ of dimension 3. Now reduce the step size to $h_1 = \frac{1}{2}h_0 = \frac{1}{4}$. You now require a matrix $A_1$ of dimension $5$. However, the submatrix $B_1$ of dimension $3$ obtained by deleting the second and fourth columns of $A_1$ contains approximations for the same grid points, as $A_0$. In short, it is meaningful to examine $B_1 - A_0$.

If you are working with MATLAB, then you can construct $B_1$ using as $$B_1 = A_1(1:2:5,1:2:5).$$