I have several Manipulate
codes as parts of a large block diagonal model. Each diagonal model produces outputs which are used in the second diagonal model, outputs of which are in turn used in the 3rd diagonal model and so on. I have a minimal example code as follows, which works just fine:
Row[{
Manipulate[
{
Plot[Sin[a x + b], {x, 0, 6}],
out1 = Sin[a x + b]
},
{{a, 2, "Multiplier"}, 1, 4},
{{b, 0, "Phase Parameter"}, 0, 10}
],
Spacer[40],
Manipulate[
{
Plot[a x + Sqrt[out1], {x, 0, 6}],
out2 = a x + Sqrt[out1]
},
{{a, 5, "Multiplier"}, 5, 10}
],
Spacer[40],
Manipulate[
Plot3D[b y + Sqrt[out1] + Sqrt[out2] x^2, {y, 0, 6}, {x, 0, 6}],
{{b, 1, "Multiplier"}, 1, 10}
]
}]
When I change a parameter in the 1st Manipulate
, the output generated is automatically used as an input in the 2nd Manipulate
and then in the 3rd Manipulate
- How can these separate
Manipulate
s be connected in a recursive manner and more efficiently, maybe with other codes like Block or While ...? - More troubling is how can I choose the
Manipulate
that I prefer to link to anotherManipulate
if there are more than 2Manipulate
s?
? And what about
Sqrt[out1]` if out1 is negative? Same for out2. $\endgroup$Sqrt[-1]
. $\endgroup$