title: Array input for an ODEINT function in SciPy
body: <p>I am trying to pass an array into an ODE and then solve that ODE using the ODEINT function. However, I get the following error:</p>
  
  <blockquote>
    <p>RuntimeError: The size of the array returned by func (50) does not match the size of y0 (1)</p>
  </blockquote>
  
  <p>Here is my sample code:</p>
  
  <pre><code>from scipy.integrate import odeint
  import numpy as np
  import matplotlib.pyplot as plt
  
  
  #First ODE
  def eq1 (x,t):
      return (0.5*(x)+2*x**2)
  
  #Second ODE
  def eq2 (y,t,m):
      p = np.sqrt(y)+m*y**2
      return p
  
  t = np.linspace(0,1,50)
  IC = [2] # Initial Condition
  m = [0.1]*len(t) # A random variable
  
  #Solver for the first ODE
  one = odeint(eq1,IC,t) 
  plt.plot (t,one)
  
  #Solver for the Second ODE
  two = odeint (eq2,IC,t,(m,))
  plt.plot (t,two)
  </code></pre>
  
  <p>The first solver works fine, but the second one throws an error. Based on the error message, I understand that the dimension of the IC is not same as that of the variable m. Hence, if I comment out the lines related to the solver of the first ODE and change IC as <code>IC = [2]*len(m)</code>, the error message goes away. How3ever, <code>two.shape</code> is (50,50). I do not know which dimension of the solution (two) is the actual answer.</p>
  
  <p>I would really appreciate some guidance.
  Thank You!</p>