Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def osc(q, t, w, coefs):
  2. fu = np.poly1d(coefs)
  3. x, y = q
  4. dqdt = [y, fu(x) - w*x]
  5. return dqdt
  6. w = 0
  7. coefs = [.96374654, -0.02022556, -0.07076912, -0.08466473, -0.23191147,
  8. -0.38058668, -0.90949123, -1.81652677, -4.00159146, -8.99895061]
  9. a = np.poly1d(coefs)
  10. print(a)
  11. q0=[2,1]
  12. odeint(osc, q0, t, args=(w, coefs), full_output = 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement