I'm trying to model an animated wave with Animate. I put it inside a Manipulate to easily change the values of the amplitude, wavelength and velocity. Currently Animate runs over 10 sec and then repeats. But depending on the variable settings the wave may not be at the same place after those 10 sec and when Animate repeats you can see the cut, like in a poorly animated GIF. How can I set it so that Animate only restarts after the wave completed one whole oscillation?
Here is my code:
Manipulate[
Animate[
Plot[A*Cos[2*Pi/λ*(x - VZ*v*t)], {x, -5, 5},
PlotRange -> {{-5, 5}, {-1, 1}},
AxesLabel -> {"x", "ψ(x,t)"}], {t, 0, 2*Pi}],
{{A, 0.5}, 0, 1, Appearance -> "Labeled"},
{{λ, 2*Pi}, 1, 100, Appearance -> "Labeled"},
{{v, 0.5}, 0, 1, Appearance -> "Labeled"},
{{VZ, 1, "Sign"}, {-1 -> "+", 1 -> "-"}}, AppearanceElements -> "ResetButton"]
The period of the wave is T = λ/v
and I tried setting this as the ending time of the animation, but somehow this causes the velocity slider to not work anymore. Does anybody have an idea?