Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memory and NDSolve

68 views
Skip to first unread message

PV

unread,
Feb 7, 2008, 4:46:57 AM2/7/08
to
Hello All,
This is a general question that has reared up its head following my
earlier question and discussion,
(for the interested::
http://groups.google.ca/group/comp.soft-sys.math.mathematica/browse_thread/thread/be4cfdb2c357400b?hl=en#b3d4099a15314475)
I have a large matrix (1920*1920), simple first order differential
equation that I try to solve using NDSolve. I need the value of the
solution at just one point. The Interpolating Function object
generated by NDSolve progressively becomes messier and larger crashing
my code for the lack of memory.
I have tried to free the memory occupied by the solution but that does
not happen at all. Is there a better way to circumvent this problem?
Cheers
Prasanna

PS: I remember Mr.Jens Kuska having replied to a similar post long ago
with a Runge-Kutta integrator that evaluates the soln at just one
point. I downloaded that but that does not seem to work with Matrix
DEs since it may have been written for an older Mathematica version!

Oliver Ruebenkoenig

unread,
Feb 7, 2008, 6:34:01 AM2/7/08
to

Hi,

To integrate systems of differential algebraic equations or polynomial
equations look at the IMTEK Mathematica Supplement:

http://www.imtek.uni-freiburg.de/simulation/mathematica/IMSweb/imsTOC/Differential%20Equation%20Systems/System%20Theory/TimeIntegrateDocu.html

or a BDF solver:
http://www.imtek.uni-freiburg.de/simulation/mathematica/IMSweb/imsTOC/Differential%20Equation%20Systems/System%20Theory/BDFDocu.html
(see example 4)

you might want to try a sub-space projection. this projects your original
system of 1920 degrees of freedom to say 100 degrees of freedom, which of
course are much faster to time integrate and use less memory.

http://www.imtek.uni-freiburg.de/simulation/mathematica/IMSweb/imsTOC/Differential%20Equation%20Systems/Model%20Order%20Reduction/ArnoldiDocu.html

hth,
Oliver

Oliver Ruebenkoenig, <ruebenko AT uni-freiburg.de>

ma...@wolfram.com

unread,
Feb 10, 2008, 5:09:28 AM2/10/08
to
If you only want the solution at the end of the interval, and not
all the intermediary steps, then use the syntax:

NDSolve[eqs, vars, {t, tf, tf}]

instead of

NDSolve[eqs, vars, {t, ti, tf}]

The result is still returned as an InterpolatingFunction but it only contains
the data at the end of the integration tf.

If you make sure to use the same variable for the solution in the loop
then previous references will be freed when the new solution is allocated.

Mark Sofroniou,
Wolfram Research

0 new messages