Here is the code:
# coding=utf8
#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('D1G', (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))
P2= D2G.locate('P', -lgd*D2[2] + (R/2)*D2[3], D2, force=-F*sin(q1))
On 6 dic, 23:46, Luke <
hazelnu...@gmail.com> wrote:
> Alberto,
> Could you post the rest of your code? From what you show, things
> look correct, but my guess is that the way you obtained q1 might not
> be correct.
> ~Luke
>
> On Sun, Dec 6, 2009 at 11:22 AM, <
py...@googlegroups.com> wrote:
> > Today's Topic Summary
>
> > Group:
http://groups.google.com/group/pydy/topics
>
> > Starting with PyDy [1 Update]
>
> > Topic: Starting with PyDy
>
> > Albertus <
icema...@wanadoo.es> Dec 06 12:55AM +0100