L := 5; T := 2;
f1 := proc (x, t) options operator, arrow; -sin(2*Pi*(x-t/T))*Heaviside(t/T-x) end proc;
f2 := proc (x, t) options operator, arrow; sin(2*Pi*(x-L+t/T))*Heaviside(x-L+t/T) end proc;
plots[animate]('plot', [f1(x, t)+f2(x, t), x = -L .. 2*L, labels = [x, ""]], t = 0 .. 25, frames = 200);
|