Iceman_5
unread,Dec 8, 2009, 11:45:46 AM12/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PyDy
Hi to all!
I continue to try make progresses but it's difficult. After solving
the problem with the generalized coordinates, now I get the next
error:
Traceback (most recent call last):
File "motor.py", line 39, in <module>
kanes_eqns = N.form_kanes_equations()
File "/home/alberto/Documentos/ENGLOBE_Stirling/python/pydy.py",
line 1904, in form_kanes_equations
self.frstar(subs_dict=subs_dict)
File "/home/alberto/Documentos/ENGLOBE_Stirling/python/pydy.py",
line 1736, in frstar
self.recursive_frstar(self.O, subs_dict=subs_dict)
File "/home/alberto/Documentos/ENGLOBE_Stirling/python/pydy.py",
line 1832, in recursive_frstar
self.recursive_frstar(child, subs_dict=subs_dict)
File "/home/alberto/Documentos/ENGLOBE_Stirling/python/pydy.py",
line 1771, in recursive_frstar
acc = PorF.abs_acc
AttributeError: 'Point' object has no attribute 'abs_acc'
I don't understand the problem. I have to calculate the acceleration
of the important points manually?
Here is my code:
from sympy import *
from pydy import *
# Create a Newtonian reference frame
N = NewtonianReferenceFrame('N')
# Declare parameters, coordinates, and speeds
R, l4, l6, Ixc, Iyc, Izc, Jxyc, Jxzc, Jyzc, Ixd, Iyd, Izd, Jyzd, mc,
md, lgd, betta, F=\
N.declare_parameters('R l4 l6 Ixc Iyc Izc Jxyc Jxzc Jyzc Ixd Iyd Izd
Jyzd mc md lgd betta F')
(q1,),(qd1,) = N.declare_coords('q', 1)
(u1,),(ud1,) = N.declare_speeds('u', 1)
# Orient the three rigid bodies, assign inertias
#Definimos el solido cigüeñal
C = N.rotate("C", 2, q1, I=(Ixc, Iyc, Izc, Jxyc, Jyzc, Jxzc))
#Definimos un sistema de referencia auxiliar en el cigueñal
correspondiente al brazo girado
Caux = N.rotate("Caux", 2, q1+betta)
#Definimos el solido disco 1
D1 = N.rotate('D1', 2, -q1, I=(Ixd, Iyd, Izd, 0, Jyzd, 0))
#Definimos el solido disco 2
D2aux=N.rotate('D2aux', 3, pi)
D2 = D2aux.rotate('D2', 2, -q1-betta, I=(Ixd, Iyd, Izd, 0, Jyzd, 0))
#locate mass centers and assign masses
CG = N.O.locate('CG', 0, C, mc)
D1G= CG.locate('D1G', (-l6/2-l4+lgd)*C[2] + (R/2)*C[3], D1, md)
D2G= CG.locate('D2G', (l6/2+l4-lgd)*Caux[2] + (R/2)*Caux[3], D2, md)
#locate the force application points P and P2
P= D1G.locate('P', -lgd*D1[2] + (R/2)*D1[3], D1, force=F*cos(q1)*N[3])
P2= D2G.locate('P2', -lgd*D2[2] + (R/2)*D2[3], D2, force=-F*sin(q1)*N
[3])
# Define generalized speeds
u_defs = N.define_speeds([Eq(u1, dot(C.ang_vel(), C[2]))])
print u_defs
kanes_eqns = N.form_kanes_equations()
print kanes_eqns