Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math as m
- from matplotlib import pyplot as plt
- th0 = float(raw_input())
- l=float(raw_input())
- g=9.807
- print l
- print th0
- def wi(wold,ths,dt) : wold - g/l*m.sin(ths*(m.pi/180))*dt
- def thi(thold, wold, dt) : thold + wold*dt
- print wi(0,th0,0.1)
- thetas=[]
- omegas=[]
- w=0
- th=th0
- for i in range(20):
- thetas.append(th)
- w=wi(w,th,0.1)
- th=(th,w,0.1)
- w = 0
- th = th0
- for i in range(20):
- omegas.append(w)
- w=wi(w,th,0.01)
- th=(th,w,0.01)
- print thetas
- print omegas
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement