Re: Slow/jerky animations inside manipulate
- To: mathgroup at smc.vnet.net
- Subject: [mg100633] Re: [mg100616] Slow/jerky animations inside manipulate
- From: John Fultz <jfultz at wolfram.com>
- Date: Wed, 10 Jun 2009 05:31:33 -0400 (EDT)
- Reply-to: jfultz at wolfram.com
On Tue, 9 Jun 2009 03:57:05 -0400 (EDT), Porscha Louise McRobbie wrote: > Hello, > > I am using Mathematica v. 184.108.40.206. > > I have an Animate command (I'm using GraphicsRow to show two > side-by-side synchronized animations) inside of Manipulate. The > resulting animations play very fast and are jerky. I can adjust the > play speed using AnimationRate, but it must be slowed down by a > ridiculous amount in order to look smooth. I've tried adjusting the > RefreshRate, as well as making time a slider variable and animating > from within the Manipulate control panel, both with little success. > > How can I create smooth animations, appropriate for class demonstrations? > > Many thanks for any help. You shouldn't be focusing on Animate as the source of the problem. It almost certainly isn't. Animate can only refresh as quickly as it can compute its contents. Since you didn't include the graphics being computed, it's impossible for anyone here to make targeted, useful comments about how to speed things up. But here are a few generic ideas... * See if anything can be precomputed outside of the animation. If the animation is a looping animation, you wish to pre-compute each and every frame of the loop, and use ListAnimate to animate the results (the downside is that this will probably create a very large notebook file). Or you might be able to get some benefit from implementing memoization in the function being plotted (look up memoization in the documentation for more information). Or there may be other steps which you can pull out of the Animate to front load more of the computation. * Try some of the standard methods for speeding up graphics visualization. Reduce PlotPoints and MaxRecursion. Remove uses of transparency. * Examine the code for any algorithms which can be rewritten to be more efficient. Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc.