with(plots): f:=Heaviside(x+100*t)-Heaviside(x-1+100*t)+Heaviside(x-100*t)-Heaviside(x+1-100*t); animate(f,x=-2..2,t=-0.01..0.02,numpoints=100, frames=31,thickness=3, color=magenta);