Error between numerical solution and exact solution

I calculated a one-dimensional KdV equation. Through grid refinement, i.e. the interval [- 40,40] was divided into 80,160,320,400 parts. However, the L2 error between the four numerical solutions obtained after refinement and the exact solution remained unchanged.

L2error0.0944101H1error0.102034
L2error0.0954364H1error0.103233
L2error0.0957789H1error0.103633
L2error0.0959502H1error0.103834
L2error0.0960529H1error0.103954
CL2-0.0155998CH1-0.0168526
CL2-0.00516732CH1-0.00558552
CL2-0.00257757CH1-0.00278902
CL2-0.00154459CH1-0.0016741

KDV08.07_Neumann boundary condition.edp (2.5 KB)

I have 2 or 3 bug.

the array b is constant in time and the matrix A1 is also constant in time
but the form a and rhs depend of u0 (previous value).

After that they are other error but where ?

Hello, thank you for your answer. I did not use varf, but directly used solve .In fact, with the refinement of the spatial grid, the error between numerical solution and exact solution is increasing.

L2error0.0477312H1error0.0647041
L2error0.0480366H1error0.065121
L2error0.0481375H1error0.0652612
L2error0.0478928H1error0.0649569
L2error0.0482175H1error0.0653916

KDV(n=1)07.27.edp (1.9 KB)