"Simulating a wave pulse"

"Sample code 0: Profile of a 1-D nonochromatic wave"
A=1;(*amplitude of wave *)
k0=1.0;(*default wave number *)
omega0=1.0; (*default angular frequency*)
y1[x_,t_]:=A*Sin[k0*x-omega0*t];
Plot[{y1[x,0]},{x,-25Pi,25Pi},PlotRange->{-5,5},PlotLabel->"Profile of a monochromatic wave at t = 0"]

"Sample caode 0.5: Simulating the movement of a 1-D nonochromatic wave for the period from t=0 till t=2T, T = the period of the wave defined as T = (2Pi/omega0)"
A=1;(*amplitude of wave *)
k0=1.0;(*default wave number *)
omega0=1.0; (*default angular frequency*)
T=(2Pi/omega0);
y1[x_,t_]:=A*Sin[k0*x-omega0*t];
Manipulate[
Plot[{y1[x,t]},{x,-5Pi,5Pi},PlotRange->{-5,5},PlotLabel->{"Profile of a monochromatic wave at t =",t}],{t,0,2T,0.1T}
]

"Sample code 1: Two waves at t=0 with slightly different wave number and wave length"
A=1;(*amplitude of wave *)
k0=1.0;(*default wave number *)
omega0=1.0; (*default angular frequency*)
Deltaomega=0.05*omega0;(*Deltaomega is defined in terms of tiny fraction of omega0*);
Deltak=0.05*k0;(*Deltak is defined in terms of tiny fraction of k0*);
omega1=omega0+1*Deltaomega;(*angular frequency of wave 1*)
omega2=omega0+2*Deltaomega;(*angular frequency of wave 2*)
k1=k0+1*Deltak;(* wave number of wave 1*)
k2=k0+2*Deltak;(*angular number of wave 2*)
y1[x_,t_]:=A*Sin[k1*x-omega1*t];
y2[x_,t_]:=A*Sin[k2*x-omega2*t];
Plot[{y1[x,0],y2[x,0]},{x,-25Pi,25Pi},PlotRange->{-5,5}]

"Sample code 2: Adding two waves at t=0 with different wave number and wave length to form a wave group. To display the effect more dramatically, make the two waves to have larger discrepencies in k and omega"
A=1;(*amplitude of wave *)
k0=1.0;(*default wave number *)
omega0=1.0; (*default angular frequency*)
Deltaomega=0.05*omega0;(*Deltaomega is defined in terms of tiny fraction of omega0*);
Deltak=0.05*k0;(*Deltak is defined in terms of tiny fraction of k0*);
omega1=omega0+1*Deltaomega;(*angular frequency of wave 1*)
omega2=omega0+2*Deltaomega;(*angular frequency of wave 2*)
k1=k0+1*Deltak;(* wave number of wave 1*)
k2=k0+2*Deltak;(*angular number of wave 2*)
y1[x_,t_]:=A*Sin[k1*x-omega1*t];
y2[x_,t_]:=A*Sin[k2*x-omega2*t];
y[x_,t_]:=y1[x,t]+y2[x,t];
Plot[{y1[x,0],y2[x,0]},{x,-25Pi,25Pi},PlotRange->{-5,5}]
Plot[{y[x,0]},{x,-25Pi,25Pi},PlotRange->{-5,5}]

"Sample code 3: Simulate the movement of the wave group for t=0 up to t=50T at and interval of 0.25T, using Manipulate"
T=(2Pi/omega0);
Manipulate[Plot[{y[x,t]},{x,-25Pi,25Pi},PlotRange->{-5,5}],{t,0,50T,0.25T}]

"Sample code 4: Construct and simulate the movement of a wave pulse comprised of N0 slighly different waves"

A=1;(*amplitude of wave *)
k0=1.0;(*default wave number *)
omega0=1.0; (*default angular frequency*)
T=(2Pi/omega0);
Deltaomega=0.05*omega0;(*Deltaomega is defined in terms of tiny fraction of omega0*);
Deltak=0.05*k0;(*Deltak is defined in terms of tiny fraction of k0*);
k[n_]:=k0+n*Deltak;
omega[n_]:=omega0+n*Deltaomega;
yn[x_,t_,n_]:=A*Sin[k[n]*x-omega[n]*t];
wp[x_,t_,N0_]:=Sum[yn[x,t,n],{n,1,N0}];
Manipulate[Plot[{wp[x,t,2]},{x,-25Pi,25Pi},PlotRange->{-5,5}],{t,0,50T,0.25T}]