Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def osc(q, t, w, coefs):
- fu = np.poly1d(coefs)
- x, y = q
- dqdt = [y, fu(x) - w*x]
- return dqdt
- w = 0
- coefs = [.96374654, -0.02022556, -0.07076912, -0.08466473, -0.23191147,
- -0.38058668, -0.90949123, -1.81652677, -4.00159146, -8.99895061]
- a = np.poly1d(coefs)
- print(a)
- q0=[2,1]
- odeint(osc, q0, t, args=(w, coefs), full_output = 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement