So I wrote a code that plots the probability distribution function for a number of cascades in a transmission line given initial propagation and distrubance. Initialization is as follows:
SetOptions[EvaluationNotebook[], NotebookDynamicExpression :> Refresh[
\[Lambda] = .1;
BTD[r_,
x_, \[Lambda]_] := (x*\[Lambda] (r \[Lambda] )^(r - x -
1)) (E^(-r*\[Lambda] )/(r - x)!);
(*Where r is the total number of failure, \[FormalZ] is the \
initial number of failure, \[Lambda] is the mean propogation*)
BTDdist[x_, \[Lambda]_, n_] :=
Table[BTD[r, x, \[Lambda]], {r, 1, n}] // N;
BTDdistdrop[x_, \[Lambda]_, n_] :=
Drop[Table[BTD[r, x, \[Lambda]], {r, 1, n}], 1] // N;
BTDdistcond[x_, \[Lambda]_, n_] :=
BTDdistdrop[x, \[Lambda], n]/(1 - E^(-x));
nextstage[thisstage_, \[Lambda]_] :=
RandomInteger[PoissonDistribution[thisstage \[Lambda]]];, None]]
But the part where i am having problem is as follows
Manipulate[
Column@{Text["Propagation= "] , Text[\[Lambda]],
Labeled[Framed[
ListLogLogPlot[BTDdistcond[z, \[Lambda], 2000], Joined -> True,
AxesLabel -> {Failures , Probability}, ImageSize -> Medium,
PlotRange -> {All, {0.000001`, 1}}]], PDF, Top],
ControlActive[\[Lambda],
Monitor[For[i = 1, i <= 2, Pause[.3]; i++],
Labeled[NestWhileList[nextstage[#, \[Lambda]] &, 1, # != 0 &],
Cascades, Top]]]}, {{\[Lambda], .01, "Propagation"}, 0.01,
1}, {{z, 1, "Initial Disturbance"}, 1, 10, 1}]
The problem is that cascades are not being displayed inside the manipulate box.