Question: Standing wave animation

Hello everyone,

I'm working on a simulation for standing wave to prove that the combination of 2 waves in opposite direction can create standing wave. So I use these:

> restart;
> with(plots):
> W1:=A*cos(omega*t-k*x);

> W2:=A*cos(omega*t+k*x);

> W:=W1+W2;

> SW:=(A,omega,k)->animate(plot,[{W1,W2,W},x=-4..4,y=-4..4,color=[red,green,blue],scaling=constrained],t=0..5,frames=10);

> display(SW(2,2*Pi,5),insequence);

It did work if SW is a function with one variable, now I need 3 variables (A,omega,k);

It said: "Plotting error, empty plot"

Please show me my mistake or an another method. Thank you

Please Wait...