packlogo.mws traveling wave packet

exp-(x-vg*t)^2/d^2 * cos (wp*t)
restart; with(plots):
y:=a*exp(-((x-vg*t)/d)^2)*cos(k*(x-vp*t));
View traveling along w/ packet envelope, or on the ground
values_stat:={a=1,d=1/3,k=2*Pi*4,vg=0,vp=-1};
values_trav:={a=1,d=1/3,k=2*Pi*4,vg=2,vp=1};
plot(subs(values_stat,t=0,y),x=-1..1);
nfr:=40;
animate(subs(values_stat,y),x=-1..1,t=-1..(nfr-1)/nfr,frames=nfr,numpoints=200,color=blue,title=`Seen
by traveling packet`);
animate(subs(values_trav,y),x=-1..1,t=-8/10..8/10,frames=40,numpoints=200,color=red);