# Why NDSolve a wave equation does not give a wave evolution or propagation result?

I am trying to solve the equation $$\frac{{\partial u}}{{\partial t}} + aa \times u\frac{{\partial u}}{{\partial x}} + bb \times \frac{{{\partial ^3}u}}{{\partial {x^3}}} - cc \times \frac{{{\partial ^2}u}}{{\partial {x^2}}} + dd \times u = 0$$ It is a Kdv-Burgers type equation where aa,bb,cc,dd are constants. I solve it numerically.

l = 1000;
aa = -25.7788;
bb = 13061;
cc = 0.087;
dd = 0.014;
eq = {D[u[t, x], {t, 1}] + bb*D[u[t, x], {x, 3}] +
aa*u[t, x]*D[u[t, x], {x, 1}] ==
cc*D[u[t, x], {x, 2}] - dd* u[t, x],
u[0, x] == -.03 Sech[x/15.0]^2, u[t, -l] == u[t, l]};
sol = NDSolve[eq, u, {t, 0, 2}, {x, -l, l}]
Plot3D[u[t, x] /. sol, {x, -l, l}, {t, 0, 2}, PlotRange -> All,
PlotPoints -> 100, BoxRatios -> {2, 1, 1/2}, AxesLabel -> {x, t, u},
ImageSize -> Large, LabelStyle -> Directive[12, Bold, Black]]


In my code, I use periodic boundary conditions. MMA gives 3D wave image, However the wave seems does not propagate or traveling from left to right. What is wrong in my code? How to correct it? Thanks

• should a wave equation not have a second order time derivative and a derivative of initial conditions? Feb 8, 2021 at 15:17

You use Animate or Manipulate to change the time.

l = 1000;
aa = -25.7788;
bb = 13061;
cc = 0.087;
dd = 0.014;
eq = {D[u[t, x], {t, 1}] + bb*D[u[t, x], {x, 3}] +
aa*u[t, x]*D[u[t, x], {x, 1}] ==
cc*D[u[t, x], {x, 2}] - dd*u[t, x],
u[0, x] == -.03 Sech[x/15.0]^2, u[t, -l] == u[t, l]};
sol = NDSolve[eq, u, {t, 0, 2}, {x, -l, l}];

Manipulate[
Plot3D[u[t, x] /. sol, {x, -l, l}, {t, 0, time},
PlotPoints -> 100,
BoxRatios -> {2, 1, 1/2},
AxesLabel -> {x, t, u},
ImageSize -> Large,
LabelStyle -> Directive[12, Bold, Black],
PerformanceGoal -> "Quality",
PlotRange -> {Automatic, Automatic, {-.02, .02}}
],
{{time, .01, "time"}, 0.01, 2, .1, Appearance -> "Labeled"},
TrackedSymbols :> {time}
]


the profile of the wave seems does not propagate from the left part to the right of the x axes

You can change the time axis to make it increase with time, if this makes it more clear and this is what you meant.

To obtain the above, just change the line

PlotRange->{Automatic,Automatic,{-.02,.02}}


to

  PlotRange->{Automatic,{0,2},{-.02,.02}}

• Thanks your answer, but it is not what i want. I mean the profile of the wave seems does not propagate from the left part to the right of the x axes. Feb 8, 2021 at 15:08