The following works exactly as advertised:
Manipulate[
Plot[5 Cos[Pi t] Sin[Pi x], {x, 0, 2},
PlotRange -> {-5, 5}],
{t, 0, 4}]
However, if I use an expression in a variable instead of explicitly in the Plot
command, that is...
wave = 5 Cos[Pi t] Sin[Pi x];
Manipulate[
Plot[wave, {x, 0, 2},
PlotRange -> {-5, 5}],
{t, 0, 4}]
... then the plot is blank. However, I can get this to work by replacing t
with a different variable and manipulating on that instead:
wave = 5 Cos[Pi t] Sin[Pi x];
Manipulate[
Plot[wave /. t -> tt, {x, 0, 2},
PlotRange -> {-5, 5}],
{tt, 0, 4}]
Does anybody out there understand why I can't use the second example?