title: How does scipy.integrate.ode.integrate() work?
body: <p>I have obviously read through the <a href="https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.integrate.ode.html#scipy.integrate.ode" rel="nofollow noreferrer">documentation</a>, but I have not been able to find a more detailed description of what is happening under the covers. Specifically, there are a few behaviors that I am very confused about: </p>
  
  <h3>General setup</h3>
  
  <pre><code>import numpy as np
  from scipy.integrate import ode
  
  #Constants in ODE
  N = 30                                 
  K = 0.5                               
  w = np.random.normal(np.pi, 0.1, N)
  
  #Integration parameters
  y0 = np.linspace(0, 2*np.pi, N, endpoint=False)   
  t0 = 0                                                                         
  
  #Set up the solver
  solver = ode(lambda t,y: w + K/N*np.sum( np.sin( y - y.reshape(N,1) ), axis=1))
  solver.set_integrator('vode', method='bdf')
  solver.set_initial_value(y0, t0)
  </code></pre>
  
  <h3>Problem 1: <code>solver.integrate(t0)</code> fails</h3>
  
  <p>Setting up the integrator, and asking for the value at <code>t0</code> the first time returns a successful integration. Repeating this returns the correct number, but the <code>solver.successful()</code> method returns false:</p>
  
  <pre><code>solver.integrate(t0)
  &gt;&gt;&gt; array([ 0.        ,  0.20943951,  0.41887902, ...,  5.65486678,
              5.86430629,  6.0737458 ])
  
  solver.successful()
  &gt;&gt;&gt; True
  
  solver.integrate(t0)
  &gt;&gt;&gt; array([ 0.        ,  0.20943951,  0.41887902, ...,  5.65486678,
              5.86430629,  6.0737458 ])
  
  solver.successful()
  &gt;&gt;&gt; False
  </code></pre>
  
  <p>My question is, what is happening in the <code>solver.integrate(t)</code> method that causes it to succeed the first time, and fail subsequently, and what does it mean to have an “unsuccessful” integration? Furthermore, why does the integrator fail silently, and continue to produce useful-looking outputs until I ask it explicitly whether it was successful?</p>
  
  <p>Related, is there a way to reset the failed integration, or do I need to re-instantiate the solver from scratch?</p>
  
  <h3>Problem 2: solver.integrate(t) immediately returns an answer for almost any value of <code>t</code></h3>
  
  <p>Even though my initial value of <code>y0</code> is given at <code>t0=0</code>, I can request the value at <code>t=10000</code> and get the answer immediately. I would expect that the numerical integration over such a large time span should take at least a few seconds (e.g. in Matlab, asking to integrate over 10000 time steps would take several minutes). </p>
  
  <p>For example, re-run the setup from above and execute:</p>
  
  <pre><code>solver.integrate(10000)
  &gt;&gt;&gt; array([ 2153.90803383,  2153.63023706,  2153.60964064, ...,  2160.00982959,
              2159.90446056,  2159.82900895])
  </code></pre>
  
  <p>Is Python really that fast, or is this output total nonsense?</p>