1

Statement of the problem

Is it possible to achieve the second order of convergence (OOC) of Lax-Wendroff scheme applied to solve inviscid Burgers equations with discontinuous initial data? If no, then how to achieve OOC of 2nd order in quasilinear problem?

Wolfram Mathematica code

(*Initial data*)
 u0[x_] := 1 - UnitStep[x - 0.1];
Flux[u_] := 0.5 u^2;
u = u0[xTbl];
dt = Abs[\[Sigma]] /Abs[Max[u]] dx;
un = 0*u;
F = Flux[u];

(*LW*)
t = 0;
While[t < tFin,
(*Main loop*)
un[[2 ;; nx - 1]] = u[[2 ;; nx - 1]] -
  0.50 \[Sigma] (F[[3 ;; nx]] - F[[1 ;; nx - 2]]) +
  0.25 \[Sigma]^2 ((u[[3 ;; nx]] + u[[2 ;; nx - 1]]) (F[[3 ;; nx]] - 
     F[[2 ;; nx - 1]]) - (u[[2 ;; nx - 1]] + 
     u[[1 ;; nx - 2]]) (F[[2 ;; nx - 1]] - F[[1 ;; nx - 2]]));
(*BC*)
un[[1]] = u[[1]];
un[[nx]] = u[[nx]];
(*Update*)
u = un;
F = Flux[u];
nstep = nstep + 1;
t = t + dt
];

Output

nx = {50, 100, 200, 400, 800};
L1err = {0.0217352, 0.0107321, 0.00533915, 0.00207726, 0.00132978};
p = {1.0181, 1.00725, 1.36192, 0.643502}

Average OOC equals

1.00769
  • If I read this right, you do not have problems with the code but with the choice of methods. You will have a better chance for answers to this type of semi-theoretical question on http://scicomp.stackexchange.org – Lutz Lehmann Mar 20 '18 at 05:48
  • @LutzL Thank you for your kindness answer. You are completely right. My question is rather theoretical. Let me ask is it okay me to clone it to scicomp branch? P.S. Last three letters in url you've mentioned above seems to be 'com'. – Oleg Kravchenko Mar 20 '18 at 06:42
  • You are right, stackexchange.com. There is a way to move questions to different portals, but it should also be OK if you copy it and add links to the other version, perhaps indicating preference for the place of the answer. You might also want to look at the Mathematica portal, but probably not for this question. – Lutz Lehmann Mar 20 '18 at 08:03
  • @LutzL Moved question [here](https://scicomp.stackexchange.com/questions/29084/numerical-lax-wendroff-scheme-order-of-convergence-on-burgers-equation) – Oleg Kravchenko Mar 20 '18 at 08:41

0 Answers0