Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am solving $u_t=u_{xx}+u_{yy}$ with a solver which is locally $O(dx^2+dy^2+dt^2)$. I use the following norm for the error between the numerical vector solution and the analytical solution $$||e||_2=\sqrt{dxdy\sum_{i,j}^{N_1,N_2}e_{ij}}=\sqrt{dxdyN_1,N_2O(dt^2+dx^2+dy^2)}$$ Now I want to test the rate of convergence, that is I increase the number of points in all dimensions by a factor of $2$ and thus new mesh sizes become $dx/2,dy/2,dt/2$ then the new norm of the error is $$||\bar{e}||:=\sqrt{dxdy/4*2N_12N_2O(dx^2/4+dy^2/4+dt^2/4)}=1/2||e||$$. So for the second order method discrete $L^2$ norm decreases by $2$, not by $4$? Even though at each point the local error will decrease by $4$. Did I do something wrong this is expected? I thought the total $L^2$ discrete norm is like averaged norm at each point, so the average should decrease by $4$ as well?

share|improve this question
up vote 2 down vote accepted

Yes, you've done something wrong. The appropriate 2-norm of a vector that approximates a grid function is

$$\|e\|_2 = \sqrt{dx dx \sum_{i,j} e_{ij}^2}.$$

You are incorrectly using $e_{ij}$ instead of $e_{ij}^2$.

share|improve this answer
yes, right, thanks so much, now the observed ratio $4$ makes sense. – Kamil Nov 13 '12 at 5:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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