Guest User

Untitled

a guest
Mar 28th, 2015
2,868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. x = [1,2,3,4,5]
  5. y = [0.873,1.14,1.246,1.289,1.305]
  6. plt.plot(x,y,'ro')
  7. plt.axis([0,5,0,3])
  8.  
  9. z = np.polyfit(x,y,1)
  10. p = np.poly1d(z)
  11. plt.plot(x,y,'ro',x,p(x),'r--')
  12. plt.ylabel("Volts")
  13. plt.xlabel("Tau")
  14. plt.title("Capacitor Charging")
  15. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment