title: How can I plot a differential equation in python?
body: <p>I want to plot the solution of my differential equation but I got this:</p>
  
  <blockquote>
    <p>'<em>ValueError: x and y must have same first dimension, but have shapes
    (360,) and (1,)</em>'</p>
  </blockquote>
  
  <p>When I write <code>_plt.plot(t,final[:1])_</code> I got</p>
  
  <blockquote>
    <p>'<em>Equality object is not subscriptable</em>'</p>
  </blockquote>
  
  <p>statement. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  from sympy.abc import * 
  import sympy as sy
  
  L= float(input('L:'))
  R= float(input('R:'))
  
  v=220*sy.sqrt(2)
  i=sy.Function('i')
  
  q=sy.dsolve(sy.Eq(sy.Derivative(i(t)*L,t)+i(t)*R,v*sy.sin(t)),i(t)).evalf()
  constant=sy.solve(q.subs(i(t),0),dict=True)
  
  t=np.linspace(0,360,360)
  final=q.subs(constant[0]).evalf()
  
  plt.plot(t,final)
  plt.show()
  </code></pre>
  
  <p>What should I do?</p>