Message Boards Message Boards

0
|
5761 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Manipulate graphics not fully loading when playing variable or autorun

Posted 11 years ago
My problem is that my manipulate does not 'wait' for the graphics to be fully rendered before moving on to the next step when playing the variable n. See code and picture below:
 unitcircle =
   ParametricPlot[{Re[Exp[I*t]], Im[Exp[I*t]]}, {t, 0, 2*\[Pi]},
    PlotStyle -> {Red}];
 Options[unitcircle, PlotRange];
 unitdisc =
   ParametricPlot[{Re[r*Exp[I*t]], Im[r*Exp[I*t]]}, {r, 0, 1}, {t, 0,
     2*\[Pi]}, PlotStyle -> {Red}, PlotRangePadding -> 0.25,
    ImagePadding -> {{Automatic, Automatic}, {Automatic, 10}}];
 
Manipulate[a = 1/2;
f[z_] := \[Alpha]*(z + a)/(1 + Conjugate[a]*z);
\[CurlyPhi][z_, n_] := Nest[f, z, n];

b = (\[Alpha] -
     1 + \[Sqrt]((\[Alpha] - 1)^2 + 4*\[Alpha]*Abs[a]^2))/(2*
     Conjugate[a]);
bImage = Graphics[Locator[{Re[b], Im[b]}]];
bImagelabel = Graphics[Locator[{Re[b] + 0.1, Im[b] + 0.15}, "\!\(\*
StyleBox[\"\[Xi]\",\nFontSize->36]\)"]];

fimage[n] =
  ParametricPlot[{Re[\[CurlyPhi][0.25*(1 - I) + r*Exp[I*t], n]],
    Im[\[CurlyPhi][0.25*(1 - I) + r*Exp[I*t], n]]}, {r, 0, 0.5}, {t,
    0, 2*\[Pi]}];
If[Orbit,
  Show[unitdisc, bImage, bImagelabel, Table[fimage[m], {m, 0, n, 1}],
   PlotLabel ->
    If[n == 0, B,
     Table[If[m == 0, B, (\[CurlyPhi]^m)[B]], {m, 0, n, 1}]] ],
  Show[unitdisc, bImage, bImagelabel, fimage[n],
   PlotLabel -> If[n == 0, B, (\[CurlyPhi]^n)[B]]] ], {{\[Alpha], 1,
   "\!\(\*
StyleBox[\"\[Alpha]\",\nFontSize->24]\)"}, {1, (1 + I)/Sqrt[2]},
  ControlType -> PopupMenu},
{{n, 0, "\!\(\*
StyleBox[\"n\",\nFontSize->24]\)"}, 0, 5, 1},
{{Orbit, True, "\!\(\*
StyleBox[\"Show\",\nFontSize->18]\)\!\(\*
StyleBox[\" \",\nFontSize->18]\)\!\(\*
StyleBox[\"Orbit\",\nFontSize->18]\)"}, {True, False}},
SaveDefinitions -> True]



Is there something wrong with my code? Indeed Mathematica never seems to finish calculating. I fear that this may be something to do with my computer as the following neat example from the documentation on Manipulate also doesn't play smoothly when I run the code locally.
Manipulate[
ContourPlot[
  q1/Norm[{x, y} - p[[1]]] + q2/Norm[{x, y} - p[[2]]], {x, -2,
   2}, {y, -2, 2}, Contours -> 10], {{q1, -1}, -3, 3}, {{q2, 1}, -3,
  3}, {{p, {{-1, 0}, {1, 0}}}, {-1, -1}, {1, 1}, Locator},
Deployed -> True]

I think my computer is more than capable of performing the calculations (1.7GHz i7 with 8GB RAM) but i cannot explain this behaviour in Mathematica 9.0.1.0 Student Edition.

I am more than happy to learn more about Manipulate and Dynamic but I want to understand what is going wrong here first.

Any help much appreciated.
POSTED BY: Mike Rigby
2 Replies
You can also force the quality of the graphics to be 'good' while you drag it by using the PerformanceGoal option. Please read the help-file for this command. Here is an example: As you drag the slider it will only show fully rendered graphics. While if you set PerformanceGoal to "Speed" it will show not fully rendered graphics while sliding.
Manipulate[Plot3D[Sin[a x y],{x,0,3},{y,0,3},PerformanceGoal->"Quality"],{a,1,2}]
Manipulate[Plot3D[Sin[a x y],{x,0,3},{y,0,3},PerformanceGoal->"Speed"],{a,1,2}]
POSTED BY: Sander Huisman
Try the SynchronousUpdating -> False  and  ContinuousAction->False options.

ref:   http://reference.wolfram.com/mathematica/ref/Manipulate.html  under Examples - Options.
(Sorry - the hyperlink maker was not playing nicely.)
POSTED BY: Bruce Miller
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract