[SciPy-dev] Patch fixing problems in integrate/ode.py for banded systems

Jesper Friis jesper.friis at material.ntnu.no
Fri Mar 3 09:56:46 CST 2006


Here is a small patch (just 2 lines) that enters the size of the upper 
and lower diagonals in the work arrays before calling DVODE. Without 
this patch DVODE will return immediately, complaining about illegal input.

Another minor problem with the interface to DVODE is that the function 
calculating the Jacobian is expected to return a matrix of size NROWPD 
by len(y), where NROWPD unfortunately is not provided as an argument to 
the Jacobian function in the python interface. For trigonal systems 
NROWPD is e.g. 4 and not 3 as one would expect. On the other hand is an 
error message is printed when a matrix of the wrong size is returned,
so this problem is easy to fix...



--- scipy-0.4.6/Lib/integrate/ode.py.org        2006-03-03 
13:20:36.000000000 +0100
+++ scipy-0.4.6/Lib/integrate/ode.py    2006-03-03 16:17:17.000000000 +0100
@@ -337,6 +337,8 @@
          rwork[6] = self.min_step
          self.rwork = rwork
          iwork = zeros((liw,),'i')
+        if self.ml != None: iwork[0] = self.ml
+        if self.mu != None: iwork[1] = self.mu
          iwork[4] = self.order
          iwork[5] = self.nsteps
          iwork[6] = 2           # mxhnil




More information about the Scipy-dev mailing list