title: scipy.integrate.ode, issue with function returning tuple
body: <p>So I've written a function to use a particular solver type to integrate a couple system of ODEs. For some reason, which I can't quite get a handle on, the function I wrote to define the RHS of the ODE is returning a tuple when run inside the integrating function (or so the error indicates), but whenever I test the array it returns separately, the array seems to be...well... and array, which is supposed to work fine.</p>
  
  <pre><code>def solve_decay_system(t, u_0, solver_type="dopri5", K_1=0.0, K_2=0.0, K_3=0.0):
  
      def decay(u, K_1 = K_1, K_2=K_2, K_3=K_3):
  
          dydt = numpy.array([-K_1 * u[0], K_1 * u[0] - K_2 * u[1], K_2 * u[1] - K_3*u[2], K_3*u[2]])
          dydt = numpy.array(dydt)
          print dydt, type(dydt)
          return dydt
          #return [1, 2, 3, 4]
  
      u = numpy.empty((4, t.size))
      u_0 = numpy.array([1.0, 0.0, 0.0, 0.0])
      u[0, 0] = u_0[0]
      u[1, 0] = u_0[1]
      u[2, 0] = u_0[2]
      u[3, 0] = u_0[3]
  
      integrator = integrate.ode(decay)
      integrator.set_integrator(solver_type)
      integrator.set_initial_value(u[:, 0])
      integrator.set_f_params(u, K_1, K_2, K_3)
  
      for (n, t_n) in enumerate(t[1:]):
          print n
          integrator.integrate(t_n)
          if not integrator.successful():
              break
  
          u[:, n + 1] = integrator.y
  
  
      return u
  </code></pre>
  
  <p>Any suggestions as to how to resolve this would be very helpful. Here is the resultant error, for reference:</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-230-8f9be46c3d95&gt; in &lt;module&gt;()
  ----&gt; 1 solve_decay_system(t, u_0, solver_type="dopri5", K_1=0.0, K_2=0.0,     K_3=0.0)
  
  &lt;ipython-input-229-a05ddca0f334&gt; in solve_decay_system(t, u_0, solver_type,     K_1, K_2, K_3)
       24     for (n, t_n) in enumerate(t[1:]):
       25         print n
  ---&gt; 26         integrator.integrate(t_n)
       27         if not integrator.successful():
       28             break
  
  C:\Users\Ben\Anaconda2\lib\site-packages\scipy\integrate\_ode.pyc in     integrate(self, t, step, relax)
      409         except SystemError:
      410             # f2py issue with tuple returns, see ticket 1187.
  --&gt; 411             raise ValueError('Function to integrate must not return     a tuple.')
      412 
      413         return self._y
  
  ValueError: Function to integrate must not return a tuple.
  </code></pre>