[SciPy-Dev] Extend odeint to handle matrices and complex numbers

Benny Malengier benny.malengier at gmail.com
Tue Nov 17 03:06:10 EST 2015


2015-11-17 0:19 GMT+01:00 Warren Weckesser <warren.weckesser at gmail.com>:

>
>
> On Mon, Nov 16, 2015 at 6:00 PM, Benny Malengier <
> benny.malengier at gmail.com> wrote:
>
>> Warren,
>>
>> It would be most useful to add that to odes,
>> https://github.com/bmcage/odes which interfaces the modern (Krylov
>> precond, ...) cvode code instead of the old codebases included in scipy.
>> We have been working on a new api for odes which returns named tuples,
>> see the examples here:
>> https://github.com/bmcage/odes/tree/master/docs/ipython (chrome might be
>> needed). This as a way to move forward the ode solvers in scipy which don't
>> have a nice/good/liked API (many suggestions for rewrites have been
>> suggested in the past). The solution as named tuple can be accessed as
>> sol.values.t and roots eg sol.roots.t, ...
>>
>> One drawback to deprecate the old solvers in scipy has been the complex
>> solver zvode. Allen Hindmarsh (
>> http://history.siam.org/oralhistories/hindmarsh.htm) did not include a
>> complex solver in the new codes in sundials. Several people have indicated
>> their need for (transparent) complex ODE solvers. Your approach might solve
>> this.
>>
>> Personally, I advise against using old solvers as lsode or vode as
>> available in scipy for actual academic (or industrial) use.
>>
>> Benny
>>
>
>
> Hi Benny,
>
> I'm familiar with `odes`, but I haven't looked at it in a while.  I just
> cloned the repo, and I'll start poking around.  I don't think it will be
> difficult to do a wrapper for `odes` similar to what `odeintw` does for
> scipy's `odeint`.
>
> Warren
>

Great.

Instead of a wrapper an option that activates complex/matrix is also a
possible way. Possibly somewhat more transparent in actual use (eg set
option to true if any of the given parameters are complex, instead of an if
structure to select another integrator obejct (eg odew instead of ode).

There are 3 pull requests being worked on,
https://github.com/bmcage/odes/pulls, which when ready should finalize the
new API. After that a release is planned. All inputs on improvements to the
new API are welcome.

Idea is to later use cvodes instead of cvode as soon as options indicate
user wants also sensitivity output, after which also sensitivities would be
present in the output named tuple. Handling complex/matrix with an option
would fit with this approach also.

Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20151117/60d5e9a7/attachment.html>


More information about the SciPy-Dev mailing list