Message Boards Message Boards

0
|
5322 Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Manipulate Aborts in Version 10

Posted 10 years ago
POSTED BY: Gregory Lypny
6 Replies

The likely reason is that the computation is taking so long. Manipulate (and various other dynamic things in Mathematica such as Buttons) is set up to time out after a system-specified number of seconds (5 seconds for Manipulate). The main design reason for this is that things that are expected to respond quickly should, as a general rule, not take a long time to respond. Read the documentation on the SynchronousUpdating option to Manipulate to get a sense of this for Manipulate. And therefor try setting

SynchronousUpdating->False

in your Manipulate to see if that makes a difference in the behavior. Let me know what happens..>!

POSTED BY: David Reiss
Posted 10 years ago

Thanks, David. Works like a charm! Is there some way I can have a message, such as "Computation in progress...", display in the content area while the script is running?

Regards,

Gregory

POSTED BY: Gregory Lypny

By the way, the example in the documentation for SynchronousUpdating is not correct since it uses Pause[6] in the Manipulate example. However,

In[6]:= Options[$FrontEnd, DynamicEvaluationTimeout]

Out[6]= {DynamicEvaluationTimeout -> 6.}

So the example in the documentation for SynchronousUpdating does not show the issue. A better example would be

Manipulate[Pause[7]; x, {x, 0, 1}]

I submitted a documentation bug report for this...

POSTED BY: David Reiss
Posted 10 years ago

Good stuff. Thanks again.

Gregory

POSTED BY: Gregory Lypny

One approach is something like the following:

Manipulate[
 Module[{nb},
  nb = CreateDialog[{TextCell["Computing..."], 
     TextCell[
      ProgressIndicator[Dynamic[Clock[Infinity]], Indeterminate]], 
     TextCell["Click OK to close"], DefaultButton[]}];
  Pause[3];
  NotebookClose[nb];
  u],
 {u, 0, 1},
 ContinuousAction -> False,
 SynchronousUpdating -> False]

Note the ContinuousAction -> False option setting that serves to keep the computation from starting until you let go of the mouse button after moving the slider to the desired position.

POSTED BY: David Reiss
Posted 10 years ago

Excellent. Thanks again, David. It even works without the close button, leaving only the progress bar. I'm going to try to tweak it a little, so that the dialog window remains the front window while the Manipulate is computing.

Regards,

Gregory

POSTED BY: Gregory Lypny
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