I'm studying the effects of some parameter on a complex system.
When we change the parameter, the system is converted and we need to write each new state to the list.
Problems encountered in using Manipulate[]
for this purpose.
I've created a very simple model to explain:
$$x_{n+1}=x_n^p$$
Unfortunately the following program enters into infinite recursion (Do not run this code!)
Manipulate[
newvar = var^p;
AppendTo[trace, newvar];
var = newvar,
{{p, 0.5}, 0.1, 1., 0.1},
Initialization :> {var = 0.5, trace = {}}]
I understand what's wrong, but I don't know how to get needed result.
Do
or Table
cannot be used, it must be interactive demonstration with manual change of parameter and recording of results.
q
? If you want a button to clean the list, just useButton
and show it insideManipulate
:Manipulate[...; Row[{Button["Clean trace", trace = {}], var}, ...]
. $\endgroup$q
changing! $\endgroup$