Escolar Documentos
Profissional Documentos
Cultura Documentos
html
Importando as bibliotecas:
Agora, vamos definir as coordenadas generalizadas do sistema. Neste caso, usaremos três
coordenadas generalizadas.
q1,q2,q0=me.dynamicsymbols('q1 q2 q0')
q1d,q2d=me.dynamicsymbols('q1 q2',1)
u1,u2=me.dynamicsymbols('u1 u2')
1 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
q_lista=[q1,q2]
Velocidades generalizadas:
u_lista=[u1,u2]
kde=[q1d-u1,q2d-u2]
Referenciando os sistemas:
N=me.ReferenceFrame('N')
A=me.ReferenceFrame('A')
B=me.ReferenceFrame('B')
Orientando o A:
A.orient(N,'Axis',[q0,N.y])
A.set_ang_vel(N,omega*N.y)
Orientando o B:
B.orient(A,'Axis',[q2,A.x])
B.set_ang_vel(A,u2*B.x)
Ponto O:
O=me.Point('O')
O.set_vel(N,0)
Cento de massa:
CM=me.Point('CM')
RCM=q1*N.z
CM.set_pos(O,RCM)
CM.set_vel(N,RCM.dt(N))
Ponto um:
2 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
P1=me.Point('P1')
RP1=-L/2*B.y-r*B.z
P1.set_pos(O,RP1+RCM)
P1.set_vel(N,(RP1+RCM).dt(N))
Ponto dois:
P2=me.Point('P2')
RP2=L/2*B.y-r*B.z
P2.set_pos(O,RP2+RCM)
P2.set_vel(N,(RP2+RCM).dt(N))
Neste caso, foi adicionado um ponto 'P3' e 'P4'. Onde está localizada a massa de
desbalanceamento.
P3=me.Point('P3')
RP3=-L/5*B.y+r*B.z
P3.set_pos(O,RP3+RCM)
CM.set_vel(N,(RP3+RCM).dt(N))
P4=me.Point('P3')
RP4=L/3*B.y+r*B.z
P4.set_pos(O,RP4+RCM)
CM.set_vel(N,(RP4+RCM).dt(N))
P1.vel(N)
P2.vel(N)
P1.pos_from(O).dot(N.z)
3 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
P2.pos_from(O).dot(N.z)
B.dcm(N)
A.dcm(N)
Ix = M*(3*r**2+L**2)/12
Iy = M*r**2/12
Iz = Ix
I = me.inertia(B,Ix,Iy,Iz)
I
eixo=me.RigidBody('eixo',CM,B,M,(I,CM))
A massa desbalanceadora foi considerada como uma partícula. Desta forma, usaremos o
seguinte comando para identificá-la.
Ppart_d1=me.Particle('Ppart_d',P3,m1)
Ppart_d2=me.Particle('Ppart_d',P4,m2)
4 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
C=[eixo,Ppart_d1,Ppart_d2]
FCM=-M*g*N.z
Fe1= -k*(P1.pos_from(O).dot(N.z))*N.z # Força Elástica no Mancal 1
Fe2= -k*(P2.pos_from(O).dot(N.z))*N.z # Força Elástica no Mancal 2
Fa1= -c*(P1.vel(N).dot(N.z))*N.z #Força de amortecimento no Mancal 1
Fa2= -c*(P2.vel(N).dot(N.z))*N.z #Força de amortecimento no Mancal 2
Fp_desb1=-m1*g*N.z #Força peso da massa 1 de desbalanceamento
Fp_desb2=-m2*g*N.z #Força peso da massa 2 de desbalanceamento
FR=[(CM,FCM),(P1,Fe1),(P2,Fe2),(P1,Fa1),(P2,Fa2),(P3,Fp_desb1),(P4,Fp_desb2)]
FR
[(CM, - M*g*N.z),
(P1, - k*(-L*sin(q2(t))*cos(q0(t))/2 - r*cos(q0(t))*cos(q2(t)) + q1(t))*N.z),
(P2, - k*(L*sin(q2(t))*cos(q0(t))/2 - r*cos(q0(t))*cos(q2(t)) + q1(t))*N.z),
(P1,
- c*(-L*u2(t)*cos(q0(t))*cos(q2(t))/2 + r*u2(t)*sin(q2(t))*cos(q0(t)) - (-L*
omega*sin(q2(t))/2 - omega*r*cos(q2(t)))*sin(q0(t)) + Derivative(q1(t), t))*N.
z),
(P2,
- c*(L*u2(t)*cos(q0(t))*cos(q2(t))/2 + r*u2(t)*sin(q2(t))*cos(q0(t)) - (L*om
ega*sin(q2(t))/2 - omega*r*cos(q2(t)))*sin(q0(t)) + Derivative(q1(t), t))*N.
z),
(P3, - g*m1*N.z),
(P3, - g*m2*N.z)]
KM= me.KanesMethod(N,q_ind=q_lista,u_ind=u_lista,kd_eqs=kde)
(Fr,Frstar)=KM.kanes_equations(C,FR)
Eq_Mov = Fr + Frstar
Eq_Mov
5 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
⎡ −Mg − M (− 3 − ω (
L u2 2 (t) Lω sin (q2 (t))
+ ωr cos (q2 (t))) sin (q2 (t))) sin (q2 (t)) cos (q0 (t)
⎢
3
⎢ + M ( 2Lω u2 (t) cos (q2 (t)) − 2ωr u2 (t) sin (q2 (t))) sin (q0 (t)) − c (− L u2 (t) cos (q0 (t)) cos (q2 (t)) +
⎢
⎢
⎢
3 2
⎢
⎢ − c( + r u2 (t) sin (q2 (t)) cos (q0 (t)) − (
L u (t) cos (q (t)) cos (q (t)) L
⎢
2 0 2
⎢
2
⎢
⎢ (−
L sin (q2 (t)) cos (q0 (t))
⎢ − − r cos (q0 (t)) cos (q2 (t)) + q1 (t))
⎢
k 2
⎢
⎢ − m1 ( L u2 (t) − ω (− Lω sin (q2 (t)) + ωr cos (q2 (t))) sin (q2 (t))) sin (q2 (t)) cos (q0 (t)) −
⎢
2
⎢
⎢
5 5
⎢
⎢ + m1 (− − 2ωr u2 (t) sin (q2 (t))) sin (q0 (t)) − m2 (− 3
2Lω u2 (t) cos (q2 (t)) L u2 2
⎢
⎢
5
⎢
⎢ − m2 (−ω (
Lω sin (q2 (t))
⎢
+ ωr cos (q2 (t))) cos (q2 (t)) − r u2 2 (t)) cos (q0 (t)) cos (q2 (t)) +
⎢
3
⎢
⎢ − (M ( − r sin (q2 (t)) cos (q0 (t))) + m1 (−
⎢
L cos (q0 (t)) cos (q2 (t)) L cos (q0 (t)) cos (q2 (t))
− r sin
⎢
⎢
3 5
⎢
⎢
Lω sin (q2 (t)) L u (t) cos (q0 (
+ωr cos (q2 (t))) cos (q2 (t))−r u2 2 (t)) Lc(− 2
⎢
LM(−ω(
LMg cos (q (t)) cos (q (t)) 3 2
⎢
0 2
− − +
⎢
3 3
⎢
⎢
L u (t) cos (q0 (t)) cos (q2 (t)) Lω sin (q2 (t))
⎢
Lc( 2 +r u2 (t) sin (q2 (t)) cos (q0 (t))−( −ωr cos (q2 (t))) sin (q0 (t
⎢
2 2
−
⎢
⎢
2
⎢
⎢
L sin (q2 (t)) cos (q0 (t)) L sin (q2 (t)) cos (q0 (t))
−r cos (q0 (t)) cos (q2 (t))+q1 (t)) cos (q0 (t)) cos (q2 (t)) −r cos (
⎢
Lk(− 2
Lk( 2
⎢
+ −
⎢
2
⎢
⎢ Lm2 (−ω(
Lω sin (q2 (t))
⎢
+ωr cos (q2 (t))) cos (q2 (t))−r u2 2 (t))
⎢
3
⎢
− + Mgr sin (q2 (t)) cos
⎢
3
⎢
⎢ + Mr (− 3 − ω (
2 Lω sin (q2 (t))
L u2 (t)
⎢
⎢
3
⎢
⎢ − cr (− + r u2 (t) sin (q2 (t)) cos (q0 (t)) − (−
L u2 (t) cos (q0 (t)) cos (q2 (t)) Lω
⎢
⎢
2
⎢
⎢ − cr ( + r u2 (t) sin (q2 (t)) cos (q0 (t)) − (
L u2 (t) cos (q0 (t)) cos (q2 (t)) Lω sin (q2 (t))
⎢
− ωr cos (q2 (t
⎢
2 2
⎢
⎢ (q2 (t)) cos (q0 (t)) − kr (−
⎢
L sin (q2 (t)) cos (q0 (t))
− r cos (q0 (t)) cos (q2 (t)) + q1 (t)) sin (q2 (t)
⎢
⎢
2
⎢
⎢ ( − ω (−
L u2 2 (t) Lω sin (q2 (t))
⎢
(q 0 (t)) + m 1 r + ωr cos (q2 (t))) sin (q2 (t)
⎢
5 5
⎢
⎢ − (M ( − r sin (q2 (t)) cos (q0 (t))) + m1 (−
L cos (q0 (t)) cos (q2 (t)) L cos (q0 (t)) cos (q2 (t))
⎢
− r sin
⎢
3 5
⎢
⎣ − (M ( L9 + r2 ) +
M(L2 +3r2 )
+ m1 (
2
12
6 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
M é a massa do eixo;
g é a aceleração da gravidade;
r é o raio do eixo;
k é constante elástica da mola (N/m);
c é o coeficiente de amortecimento;
Omega (ω) é a velocidade angular do eixo;
m1 é massa 1 de desbalanceamento;
m2 é massa 2 de desbalanceamento.
constantes={M:2.5,g:9.8,L:0.250,r:0.02,k:1000,c:0.05,omega:100, m1:0.25, m2:0.30
import numpy as np
cond_in={q1:0,q2:np.pi/2,u1:0,u2:1}
import pydy.system as dy
Atribuindo o sistema
Integrando o sistema
Q=sistema.integrate()
plt.figure(figsize=(10,8))
plt.plot(tn,Q[:,0])
plt.xlabel('t[s]')
plt.ylabel('q1[m]')
plt.grid(True)
plt.title('Variação do Centro de Massa em relação ao tempo')
plt.show()
7 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
plt.figure(figsize=(10,8))
plt.plot(tn,Q[:,1])
plt.xlabel('t[s]')
plt.ylabel('q2[m]')
plt.grid()
plt.title('Variação do Centro de Massa em relação ao tempo')
plt.show()
8 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
plt.figure(figsize=(10,8))
plt.plot(tn,Q[:,2])
plt.xlabel('t[s]')
plt.ylabel('u1[m]')
plt.grid()
plt.title('Variação do Centro de Massa em relação ao tempo')
plt.show()
9 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
plt.figure(figsize=(10,8))
plt.plot(tn,Q[:,3])
plt.xlabel('t[s]')
plt.ylabel('u2[m]')
plt.grid()
plt.title('Variação do Centro de Massa em relação ao tempo')
plt.show()
10 of 11 31/05/2021 16:51
quarta analise-Copy1 file:///C:/Users/Vanusa/AppData/Local/Temp/quarta analise-Copy1-1.html
11 of 11 31/05/2021 16:51