Une vague  au temps t = 0  se casse en deux vagues, l' une va vers  la droite,  l' autre vers  la  gauche

on résout par un schéma explicite instable!!

dt =  .2;
h0 = Exp[-x^2]; 
    u0 = 0;


\(TraditionalForm\`Do[
h1 = 
        h0 - dt\ D[u0, x]; 
u1 = 
        u0\  - \ dt\ D[h1, x]; 

Show[
        GraphicsArray[{Plot[{u1\ }, {x, \(-5\), 5}, 
              PlotRange -> {{\(-5\), 
                    5}, {\(- .5\),  .5}}, 
PlotStyle -> RGBColor[1, 0, 0], 
              Ticks -> 
                None, 
PlotLabel -> "vitesse", 
DisplayFunction -> 
                Identity], 
Plot[{h1\ }, {x, \(-5\), 5}, 
              PlotRange -> {{\(-5\), 5}, {0, 
                    1}}, 
PlotStyle -> 
                RGBColor[0, 0, 
                  1], 
PlotLabel -> "hauteur d'eau", 
DisplayFunction -> 
                Identity]}], 
DisplayFunction -> $DisplayFunction]
; 
u0 = Simplify[u1]; 
      h0 = Simplify[h1];
, {i, 0, 20}]\)

Une vague  au temps t = 0  se déplace va vers  la droite

dt =  .1;
h0 = Exp[-x^2]; 
    u0 = Exp[-x^2];


\(TraditionalForm\`Do[
h1 = 
        h0 - dt\ D[u0, x]; 
u1 = 
        u0\  - \ dt\ D[h1, x]; 

Show[
        GraphicsArray[{Plot[{u1\ }, {x, \(-5\), 5}, 
              PlotRange -> {{\(-5\), 5}, {0, 
                    1}}, 
PlotStyle -> 
                RGBColor[1, 0, 0], 
              Ticks -> 
                None, 
PlotLabel -> "vitesse", 
DisplayFunction -> 
                Identity], 
Plot[{h1\ }, {x, \(-5\), 5}, 
              PlotRange -> {{\(-5\), 5}, {0, 
                    1}}, 
PlotStyle -> 
                RGBColor[0, 0, 
                  1], 
PlotLabel -> "hauteur d'eau", 
DisplayFunction -> 
                Identity]}], 
DisplayFunction -> $DisplayFunction]
; 
u0 = Simplify[u1]; 
      h0 = Simplify[h1];
, {i, 0, 20}]\)

s = 
      NDSolve[{
D[h[y, t], t, t] == 
            D[h[y, t], y, y], 
h[y, 0] == 
            Exp[-y y], 
Derivative[0, 1][h][y, 
              0] == 
            2 y Exp[-y y], 

h[6, 
              t] == h[-6, t]}, 
        h, {y, -6, 6}, {t, 0, 16}]

Plot3D[
      Evaluate[h[y, t] //. s[[1]]], {y, -6, 6}, {t, 0, 16}, 
      PlotPoints -> 30]

Résolution avec NDSolve

s = 
      NDSolve[{
D[h[y, t], t, t] == 
            D[h[y, t], y, y], 
h[y, 0] == 
            Exp[-y y], 
Derivative[0, 1][h][y, 
              0] == 
            0, 

h[7, t] == 
            h[-7, t]}, h, {y, -7, 7}, {t, 0, 16}]

Plot3D[
      Evaluate[h[y, t] //. s[[1]]], {y, -7, 7}, {t, 0, 4}, 
      PlotPoints -> 30]

Une vague  (dessin!)

Do[
Plot3D[ 
        Exp[-(x  - t )^2], {y, 0, 5}, {x, 0, 5}, 
        PlotPoints -> 30, Ticks -> None, 
        BoxRatios -> {1, 5, 1}, 
        PlotRange -> {{0, 5}, {0, 5}, {0, 1}}], {t, -1, 
        8}]

Une vague  (dessin!)

Table[
Plot[ 
        Sin[-Pi (x  - t ) ],  {x, 0, 5},  Ticks -> None, 
        PlotRange -> {{0, 5}, {-4, 
              1}} ], 
{t, -1, 0.9,  .1}]

Table[
Plot3D[ 
        Sin[-Pi (x  - t ) ], {y, 0, 1}, {x, 0, 5}, 
        PlotPoints -> 30, Ticks -> None, 
        BoxRatios -> {1, 5, 1},  
        PlotRange -> {{0, 1}, {0, 5}, {-2, 
              2}}], 
{t, -1, 0.9,  .1}]

Do[
Plot3D[ 
        Sin[-Pi (x  - t ) ], {y, 0, 1}, {x, 0, 5}, 
        PlotPoints -> 30, Ticks -> None, 
        BoxRatios -> {1, 5, 1},  
        PlotRange -> {{0, 1}, {0, 5}, {-2, 
              1}}], 
{t, -1, 
        5}]