[SciPy-user] Solving Two boundary value problems with Python/Scipy

Robert Clewley rclewley at cam.cornell.edu
Fri Oct 6 15:42:35 CDT 2006

> I confess I hadn't really examined PyDSTool very closely; it sounds
> like it addresses exactly what I was suggesting. Perhaps there's no
> need for such a scipy package, if people can just use PyDSTool. Do you
> think there is any point in moving some generic functionality into
> scipy?

Not necessarily, and besides I don't know that my code is really of
high enough quality for it to belong in there. I don't have the
time to completely rewrite it with unit tests, etc., although it *does*
work reliably on the tests for which we can compare output from 
other packages, for instance.

However, my guess is that there's sufficient general applicability of
our numeric Interval, Point and Pointset classes (and possibly our Curve 
a.k.a. Trajectory classes) for other scientific applications that might
make it worthwhile for those to be incorporated, at least.

> I'd at least like to have an ODE solver that can handle
> constraints on the dependent variable.

Indeed, that's what drove us to interfacing with Radau, which does that 

> Wait, interp1d is linear-interpolation-only! I had in mind a
> higher-order spline that took into account not the bending energy at
> each knot but the known derivatives at each point (and possibly the
> order used internally by the integrator) to obtain a solution that
> followed the real solution even more closely at little extra cost.

Absolutely. From what I remember, at the time that I wrote those classes I 
there was only that 1d interpolator around in scipy that suited our needs. 
Well, anyway, the classes are not really hardwired to it and other 
interpolators could be put in very easily. I plan to make the option more 
accessible with our Numpy-based release. For everyday "normal" purposes 
just using small enough time steps in the integration makes linear 
interpolation fine. Plus there's already a "refine" option in the C 
integrators which uses high-order interpolation to provide a fine mesh
before it reaches the interpolator.

>> Our diff function provides that with various options for
>> functions from R^N -> R^M. Here's the signature and docstring
>> from PyDSTool/common.py:
> Er, I suppose I meant the relaxation method of solving boundary-value problems.

Ah, right... yes. Sorry, I was asleep at the wheel when I included that!

> Thanks, and I apologize for not having taken a closer look at it
> before making my suggestions,

No need to apologise. Exploring the vast range of what's out there and
discussing your ideas for new features is what these lists are for.
You've encouraged me to write some classes to help PyDSTool users do BVPs!


More information about the SciPy-user mailing list