[SciPy-User] Problems with dopri45
Tue Apr 3 11:42:26 CDT 2012
On Tue, Apr 3, 2012 at 11:29 AM, L. Barrott <email@example.com> wrote:
> >On Tue, Apr 3, 2012 at 5:54 AM, L. Barrott <firstname.lastname@example.org> wrote:
> >> Hello,
> >> I have been trying to get scipy to solve a set of coupled odes and in
> >> particular I want to use the dopri 45 method as I want to compare the
> >> results to the ode45 method in MATLAB. The code runs along the lines of:
> >> def func (t, Y, params):
> >> ...
> >> return (Ydot)
> >> with Y a vector. The other ode methods (except dop853 of course) solve
> >> this fine but even if I use the example code on the documentation page
> >> the dopri method returns the following error
> >> create_cb_arglist: Failed to build argument list (siz) with enough
> >> arguments (tot-opt) required by user-supplied function
> >> (siz,tot,opt=2,3,0). ...(traceback stuff) _dop.error: failed in
> >> processing argument list for call-back fcn.
> >> Any ideas where I am going wrong?
> >> Many thanks
> >> LB
> >It would help to see more of your code. Could you include a complete,
> >self-contained script that demonstrates the error?
> Even something as simple as;
> from scipy.integrate import ode
> y0, t0 = [0, 1], 0
> def func (t, y, x):
> return [x, y]
> r = ode(func).set_integrator ('dopri5')
> r.set_initial_value(y0, t0).set_f_params(1)
> t1 = 10
> dt = 0.1
> while r.successful() and r.t < t1:
> Will fail and this is lifted straight from the documentation as far as I
> can see. The full error message is
> create_cb_arglist: Failed to build argument list (siz) with enough
> arguments (tot-opt) required by user-supplied function (siz,tot,opt=2,3,0).
> Traceback (most recent call last):
> File "<stdin>", line 2, in <module>
> File "/usr/lib/python2.7/dist-packages/scipy/integrate/ode.py", line 326,
> in integrate
> File "/usr/lib/python2.7/dist-packages/scipy/integrate/ode.py", line 745,
> in run
> x,y,iwork,idid = self.runner(*((f,t0,y0,t1) + tuple(self.call_args)))
> _dop.error: failed in processing argument list for call-back fcn.
I suspect you are using version 0.9 (or earlier) of scipy. This looks like
a bug that was fixed in 0.10:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User