Моделирование лаба 2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import numpy as np
import matplotlib.pyplot as plt
def T(m):
import math
l = 1.
m1= m/2.0
m2= m/5.0
m3= m/3.0
j1 = m1*(l/2.0)**2
j2 = m2*(l/2.)**2
j3 = m3*(1/12.)*l**2
j = (1./12.)*l*l*(3*m1+3*m2+m3)
m = m1+m2+m3
lc = abs(m2-m1)*l/2*m
return 2*3.14*(j/m*lc*9.8)**0.5
t1 = np.linspace(0.0, 50.0, 100)
print T(50)
plt.plot(t1, T(t1))