help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LSODE speed up question


From: Olaf Till
Subject: Re: LSODE speed up question
Date: Sat, 26 Apr 2008 09:38:04 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Fri, Apr 25, 2008 at 03:47:33PM -0400, Ayesha Kalra wrote:
> Hi all,
> I am using LSODE in a C++ program to solve a system of ~300 ODEs (500 time
> steps). I used LSODE in C++ so that I could get some performance enhancement
> over using LSODE in Octave itself, however, there was no improvement in
> performance (measured in time (in sec) taken to solve the system of
> equations.

I am not sure, but to my understanding you will not enhance
performance by calling octaves LSODE code from C++ instead from Octave
... the only thing that should matter is whether your function "f"
(and a possibly supplyed Jacobian-function) is compiled or must be
interpreted.

> It may be noted that in both cases, I am NOT supplying the Jacobian
> to LSODE.  Can anyone tell me what is the bottleneck step for LSODE,
> if it is calculation of Jacobian of the system,

Actually supplying a Jacobian should do a speedup. Curiously though, I
have not in the past managed to get a speedup by this ... but spent not
much time in checking supplyed Jacobians for errors.

> I will try to
> calculate it explicitly using some kind of Automatic Differentiation
> library and then supply it to LSODE (I am not sure, how to do this
> right now, any ideas/suggestions are welcome).

Maxima is mostly used for that in the free-software area. You will
need some time though to get accustomed to that program.

> 
> Or, is there anything else I need to look/change to speed up solution by
> LSODE in C++.
> 

Although LSODE might sometimes be able to solve ODEs with
discontinuities in the derivative, this will cause at least
delays. The derivative should be continuous. For speed, it may even be
better if the derivative is continuously differentiable, since any
"edges" in it will probably cause LSODE to reduce the step size to
exactly localize the edge.

A system of 300 ODEs seems a tough job to me ...

Olaf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]