[SciPy-dev] complex wrapper to ode
Pauli Virtanen
pav@iki...
Mon Feb 23 14:54:20 CST 2009
Mon, 23 Feb 2009 18:25:45 +0000, John Travers wrote:
> Attached is a patch which adds a wrapper class 'zode' to integrate.ode.
> It allows one to conviniently solve systems of odes with complex values
> using the existing real valued solvers vode, dopri5, dop853, instead of
> zode, by simply integrating the real/imag parts.
>
> Is this worth commiting?
Looks good to me, and may be generally useful, so I'm +1
But before committing, I'd suggest a couple of things:
- The name 'zode' is slightly confusing vs. ZVODE and not very
descriptive. Maybe 'complex_ode' would be better?
This would leave us wiggle room later on with the naming...
- Is it possible to do the real -> complex switch automatically,
based on the type of return value from (a trial evaluation of) f?
On a second thought, this might be brittle.
- Since 'ode' supports Jacobians, it'd be nice if the wrapper supported
them, too.
> It appears to me to be considerably faster than
> zvode for my big systems of equations. I'm not sure why, as I
> intuitively thought all the data copying etc. would slow it down.
Is your RHS an analytic function of all of the variables? The ZVODE docs
seem to mention this as a requirement. But I don't know if the ZVODE
implementation itself is supposed to be fast.
--
Pauli Virtanen
More information about the Scipy-dev
mailing list