I want to manipulate multiple plots with recurring functions, take for example:
Manipulate[Grid[{
{Plot[f1 = a*Sin[k*x], {x, 0, 2 Pi}]},
{Plot[f2 = a*Cos[2 k*x], {x, 0, 2 Pi}]},
{Plot[f1 + f2, {x, 0, 2 Pi}]},
{Plot[f1 + 2 f2, {x, 0, 2 Pi}]},
{Plot[f1 + 3 f2, {x, 0, 2 Pi}]}}],
{a, 0, 1}, {k, 0, 1}]
The functions of the last three plots are composed of the two functions in the first two plots (which I have named f1
and f2
). But when I evaluate in the above way the last three do not turn out correctly. They only do when I enter f1
and f2
in their complete forms, which I believe causes redundant repetitions of f1
and f2
, and takes an increasingly heavy toll whence I plot complicated functions. Is there a more efficient way?
f1
andf2
insidePlot
(or useEvaluate
/Evaluated->True
if you really need to) $\endgroup$