[SciPy-User] speeding up integrate.odeint with weave/blitz

Christian Schmuck gmane.comp.python.scientific.user@christian-schmuck...
Wed Dec 22 09:51:15 CST 2010


I've been trying the 'for' macro myself. I couldn't get it working though.
Here the very simple code example, I tried:

from PyDSTool import Generator, args

DSargs = args(name='ODEtest')
DSargs.varspecs = {'y[i]': 'for(i, 0, 2, -y[i])'}

testODE = Generator.Dopri_ODEsystem(DSargs)

And here the error:
KeyError                              Traceback (most recent call last)

/home/schmuck/Arbeit/py_test/t4.py in <module>()
      5 DSargs.varspecs = {'y[i]': 'for(i, 0, 2, -y[i])'}
----> 7 testODE = Generator.Dopri_ODEsystem(DSargs)

/Dopri_ODEsystem.pyc in __init__(self, kw)
    331         else:
    332             nobuild = False
--> 333         ODEsystem.__init__(self, kw)
    334         self.diagnostics.outputStatsInfo = {
    335             'last_step': 'Predicted step size of the 
last accepted step (useful for a subsequent call to dop853).',

/ODEsystem.py in __init__(self, kw)
     73             self.variables[xname] = Variable(indepdomain=tdepdomain,
     74                    depdomain=Interval(xname,
---> 75                    self.xtype[xname],
     76                    self.xdomain[xname],
     77                    self._abseps))

KeyError: 'y0'
WARNING: Failure executing file: <t4.py>

Has anyone ever used the for macro successfully and could he or she
give a short, working example? I'm still a newbie with python and 
pyDSTool but I've done some debugging with winpdb and I've got 
the sneaky feeling that there is a bug.


More information about the SciPy-User mailing list