Wave Motion (Lateral or Internal)

step[a_,b_,n_,j_]=a+j (b-a)/n

Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-2 step[0,1,16,j]+(1/2) step[0,1,16,j]^2},{j,0,16}],PlotStyle->{Black,AbsolutePointSize[5]}],Ticks->False,PlotRange->{{-0.1,0.6},{-1.6,0.1}}]

wavezero[x_]=-x^2/2+2 x;
waveone[x_,t_]=Cos[Pi t/2] Sin[Pi x/2];

Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-wavezero[step[0,1,16,j]]},{j,0,16}],PlotStyle->{Black,AbsolutePointSize[5]}],ListPlot[Table[{1/4,-wavezero[step[0,1,16,j]]-waveone[step[0,1,16,j],0]},{j,0,16}],PlotStyle->{Red,AbsolutePointSize[5]}],Ticks->False,PlotRange->{{-0.1,0.6},{-2.6,0.1}}]

Animate[Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-wavezero[step[0,1,16,j]]},{j,0,16}],PlotStyle->{Black,AbsolutePointSize[5]}],ListPlot[Table[{1/4,-wavezero[step[0,1,16,j]]-waveone[step[0,1,16,j],t]},{j,0,16}],PlotStyle->{Red,AbsolutePointSize[5]}],Ticks->False,PlotRange->{{-0.1,0.6},{-2.6,0.1}}],{t,0,20}]

wavex[x_,t_]=D[wavezero[x]+waveone[x,t],x];

Animate[Plot[wavex[x,t],{x,0,1},PlotRange->{{0,1},{-0.5,4}}],{t,0,4}]

Animate[Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-wavezero[step[0,1,16,j]]-waveone[step[0,1,16,j],t]},{j,0,16}],PlotStyle->{Red,AbsolutePointSize[5]}],Ticks->False,PlotRange->{{-0.1,0.6},{-2.6,0.1}}],{t,0,20}]

Animate[Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-wavezero[step[0,1,16,j]]-waveone[step[0,1,16,j],t]},{j,0,16}],PlotStyle->{Red,AbsolutePointSize[5]}],ParametricPlot[{t,-1},{t,0,0.5},PlotStyle->Green],Ticks->False,PlotRange->{{-0.1,0.6},{-2.6,0.1}}],{t,0,20}]

wavealtx[x_,t_]=D[wavezero[x]+0.4 waveone[x,t],x];

Animate[Plot[{1,wavealtx[x,t]},{x,0,1},PlotRange->{{0,1},{-0.5,4}},PlotStyle->{Red,Black}],{t,0,4}]

Animate[Plot[{1,wavealtx[x,t]},{x,0,1},PlotRange->{{0.8,1},{-0.9,1.5}},PlotStyle->{Red,Black}],{t,0,4}]

wavealt[x_,t_]=wavezero[x]+0.4 waveone[x,t];

Animate[Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-wavealt[step[0,1,16,j],t]},{j,0,16}],PlotStyle->{Red,AbsolutePointSize[5]}],ParametricPlot[{t,-1},{t,0,0.5},PlotStyle->Green],Ticks->False,PlotRange->{{-0.1,0.6},{-1.8,0.1}}],{t,0,20}]

wavetwo[x_,t_]=Cos[3 Pi t/2] Sin[3 Pi x/2];
newwave[x_,t_,size_]=wavezero[x]+size wavetwo[x,t];
newwavex[x_,t_,size_]=D[newwave[x,t,size],x];

Animate[Plot[{1,newwavex[x,t,0.05]},{x,0,1},PlotRange->{{0,1},{-0.5,4}},PlotStyle->{Red,Black}],{t,0,4}]

Animate[Plot[{1,newwavex[x,t,0.05]},{x,0,1},PlotRange->{{0.8,1},{0,1.5}},PlotStyle->{Red,Black}],{t,0,4}]

Animate[Plot[{1,newwavex[x,t,0.05]},{x,0,1},PlotRange->{{0.9,1},{0.9,1.2}},PlotStyle->{Red,Black}],{t,0,4}]

Animate[Show[ParametricPlot[{0,t},{t,-1.5,0},PlotStyle->{Thick,Black}],ParametricPlot[{t,0},{t,0,0.5},PlotStyle->{Thick,Black}],ListPlot[Table[{1/4,-newwave[step[0,1,16,j],t,0.05]},{j,0,16}],PlotStyle->{Red,AbsolutePointSize[5]}],ParametricPlot[{t,-1},{t,0,0.5},PlotStyle->Green],Ticks->False,PlotRange->{{-0.1,0.6},{-1.8,0.1}}],{t,0,20}]