title: Using adaptive time step for scipy.integrate.ode when solving ODE systems
body: <p>I have to just read <a href="https://stackoverflow.com/questions/12926393/using-adaptive-step-sizes-with-scipy-integrate-ode">Using adaptive step sizes with scipy.integrate.ode</a> and the accepted solution to that problem, and have even reproduced the results by copy-and-paste in my Python interpreter. </p>
  
  <p>My problem is that when I try and adapt the solution code to my own code I only get flat lines.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>from scipy.integrate import ode
  from matplotlib.pyplot import plot, show
  
  initials = [1,1,1,1,1]
  integration_range = (0, 100)
  
  f = lambda t,y: [1.0*y[0]*y[1], -1.0*y[0]*y[1], 1.0*y[2]*y[3] - 1.0*y[2], -1.0*y[2]*y[3], 1.0*y[2], ]
  
  y_solutions = []
  t_solutions = []
  def solution_getter(t,y): 
     t_solutions.append(t)
     y_solutions.append(y) 
  
  
  backend = "dopri5"
  ode_solver = ode(f).set_integrator(backend)
  ode_solver.set_solout(solution_getter)
  ode_solver.set_initial_value(y=initials, t=0)
  
  ode_solver.integrate(integration_range[1])
  
  plot(t_solutions,y_solutions)
  show()
  </code></pre>
  
  <p>And the plot it yields:
  <a href="https://i.stack.imgur.com/9Aki3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Aki3.png" alt="enter image description here"></a></p>