Inconsistent rates of convergence

Hi everyone,
I’m trying to compute the order of convergence for a nonlinear PDE solver using a three-level time-stepping scheme in FreeFEM++, but I’m not getting the expected results. I’m computing L2 and H1 errors against an exact solution, but the convergence rates seem inconsistent.


kg_order.edp (4.9 KB)

Dear Xavier,
I have corrected your code
kg_order.edp (4.9 KB)
There were several problems:

  1. Dirichlet boundary conditions wrongly set in Newton method
  2. Error in duexdq
  3. Not good management of time
  4. Missing right-hand side g in the definition of U1

Indeed for U1 it is not mandatory to do the complicate definition,
it is more simple to set U1=U0+dt*(du/dt)_in
For your test case (du/dt)_in=-U0, thus it leads to
U1=U0-dt*U0;

Dear François Bouchut,
Thank you very much for your corrections and insightful remarks regarding the code.
I have implemented the suggested changes, like the simplified initialization of U1 = U0 - dt*U0 . However, I am still observing a large increase in the order of convergence in the
𝐻1 norm.
Please let me know if you have any further thoughts on this observation.

Dear Xavier,
The definition of U1 by the variational problem gives better results than the U1 = U0 - dt*U0 (but is more complicate).
Thus when debuging such a code, it is better to treat first the simplificed case.
I did not observe a particular problem on the H1 norm with the version I posted. For which data do you see it?

1 Like

Hi François Bouchut,
Thanks for the explanation! I’m comparing the results using the table below, along with the initial condition and exact solution mentioned in the example above (here k is dt)

Is it for T=10? For this time the code gives better results (case P2):
level 0 L2 error = 0.0070826 H1 error = 0.206281
level 1 L2 error = 0.000854992 H1 error = 0.0486429
level 2 L2 error = 2.59358e-05 H1 error = 0.00300922
level 3 L2 error = 3.29636e-06 H1 error = 0.000805949
Order of convergence in L2 norm between dt=0.25 and dt=0.125 = 3.0503
Order of convergence in H1 norm between dt=0.25 and dt=0.125 = 2.08431
Order of convergence in L2 norm between dt=0.125 and dt=0.0625 = 5.04289
Order of convergence in H1 norm between dt=0.125 and dt=0.0625 = 4.01477
Order of convergence in L2 norm between dt=0.0625 and dt=0.03125 = 2.976
Order of convergence in H1 norm between dt=0.0625 and dt=0.03125 = 1.90063

No, here time is T = 5.

For T=5 still it is much better than in your table
level 0 L2 error = 0.0128677 H1 error = 0.323882
level 1 L2 error = 0.000713262 H1 error = 0.0434486
level 2 L2 error = 4.37852e-05 H1 error = 0.00570313
level 3 L2 error = 1.31308e-06 H1 error = 0.000315001
Order of convergence in L2 norm between dt=0.25 and dt=0.125 = 4.17318
Order of convergence in H1 norm between dt=0.25 and dt=0.125 = 2.89809
Order of convergence in L2 norm between dt=0.125 and dt=0.0625 = 4.02591
Order of convergence in H1 norm between dt=0.125 and dt=0.0625 = 2.92948
Order of convergence in L2 norm between dt=0.0625 and dt=0.03125 = 5.05942
Order of convergence in H1 norm between dt=0.0625 and dt=0.03125 = 4.17833

I don’t see how theoretically the order of accuracy could be higher than 2 (but maybe you have a good reason, with your special formula \mathcal{G}(v,w)=\frac{1}{4}(v^3+v^2w+vw^2+w^3))

The fact is that the solution is proportional to exp(-t), hence becomes rapidly small. Then we measure essentially the ability of the scheme to decay rapidly.
If we take T=1, the order of accuracy becomes 2 for H1:
level 0 L2 error = 0.0173478 H1 error = 0.506981
level 1 L2 error = 0.00209946 H1 error = 0.113722
level 2 L2 error = 0.00021149 H1 error = 0.0262025
level 3 L2 error = 2.27056e-05 H1 error = 0.00630379
Order of convergence in L2 norm between dt=0.25 and dt=0.125 = 3.04666
Order of convergence in H1 norm between dt=0.25 and dt=0.125 = 2.15642
Order of convergence in L2 norm between dt=0.125 and dt=0.0625 = 3.31136
Order of convergence in H1 norm between dt=0.125 and dt=0.0625 = 2.11774
Order of convergence in L2 norm between dt=0.0625 and dt=0.03125 = 3.21947
Order of convergence in H1 norm between dt=0.0625 and dt=0.03125 = 2.05541