Message Boards Message Boards

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

Manipulate Aborts in Version 10

Posted 10 years ago

Hello everyone,

I created a simple routine that cleans up and reorganizes a fairly big data array. The routine is wrapped in Module. It takes about 15 seconds to run, and it works fine. But when I then place the module inside Manipulate, where there is only one control that is used to select the kind of information displayed about the array, the routine aborts in 15 to 20 seconds (spinning beach ball on Mac and $Abort returned in Manipulate). Is there something new in version 10 that would cause this? TimeConstrained? MemoryConstrained? Any tips would be most appreciated.

Gregory

POSTED BY: Gregory Lypny
6 Replies

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
Posted 10 years ago

Good stuff. Thanks again.

Gregory

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

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
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