Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- def piston_position (t, r1, l):
- return (r1 * np.cos(t) + ((l**2) - (r1**2) * (np.sin(t)**2)**0.5)
- t = np.linespace(0,361,50)
- y5 = piston_position(t,3,15)
- plt.plot(t,y5)
- plt.show()
- import numpy as np
- import matplotlib.pyplot as plt
- def yFall (t,v0,y0):
- return (-9.8*t*t/2+v0*t+y0)
- t = np.linspace(0,3,11)
- y5 = yFall(t,5,30)
- plt.plot(t,y5, 'b^--', mfc = 'r')
- plt.title ("position")
- plt.ylabel ("time")
- plt.xlabel ("speed")
- plt.show()
Add Comment
Please, Sign In to add comment