Memory use, forcing GC, %oXX vars keeping references



On Mon, Jan 22, 2007 at 09:43:25AM +0000, Jaime E. Villate wrote:
> On Sat, 2007-01-20 at 10:38 -0800, Daniel Lakeland wrote:
> > I've been using the "rk" function with very small step sizes, I tend
> > to get back lists of several thousand or a million entries.

> I have a modified version of rk that only saves the results of
> some of the steps (for example, steps 0,100,200,...). I use it when
> I have to study chaotic systems with very small step sizes. I will
> soon commit a new version of rk with an extra option to do that.

While you're at it, can I suggest that you include in rk the option to
let the user supply a predicate function that tells rk when to stop?
This would be super useful if for example you are trying to find when
a particular solution goes to zero for the first time, or to stop when
the solution becomes "un-physical" (ie. one of the vars is negative,
or something like that).

The predicate function should have access to probably the current
values of the independent vars, the previous values of the independent
vars, and the current values of the derivative expressions. This lets
you check for when a solution crosses a threshold, when one of the
derivatives has "blown up", or when the current values are
outside acceptable ranges.

This can save a lot of time vs just letting rk integrate and finding
out after a few minutes that all you wanted to know was in the first
10% of the computation.

-- 
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan