problems in useing joints in sympy.physics.mechanics #25613
-
I'm trying to understand the joints framework within sympy.physics.mechanics to define mechanical problems and generate the equation of motion. Im using the Multi Degree of Freedom Holonomic System. as a reference. from sympy import symbols
from sympy.physics.mechanics import Body, PinJoint, WeldJoint, JointsMethod, inertia, dynamicsymbols
### gen. Koord. und Symbole erstellen
q1, u1 =dynamicsymbols('phi, phi.')
l, g, k, Izz = symbols('l, g, c, Izz')
m = symbols('m')
### Körper erstellen:
wall1 = Body('N1')
#Izz=m*l**2
IB = inertia(wall1.frame, 0, 0, Izz)
rod = Body('R', mass=m, central_inertia=IB)
point_mass = Body('P', mass=m/4)
bodies = (wall1, rod, point_mass)
### create joints
rev = PinJoint('J', wall1, rod, coordinates=q1, speeds=u1,
joint_axis=wall1.z,
child_point=l/2*rod.x)
fix = WeldJoint('K', rod, point_mass, parent_point=l*(3/2)*rod.frame.x)
joints = (rev, fix)
### add Forces/loads
left_end = rod.masscenter.locatenew('left_end', -l*(3/2) * rod.frame.x)
#spring forces
rod.apply_force(-k*(q1*2*l)*rod.y, point=left_end)
rod.apply_force(-k*(q1*2*l)*rod.y, point=left_end)
### calc EOM
method = JointsMethod(wall1.frame, rev, fix)
method.form_eoms() from sympy import*
from sympy.physics.mechanics import*
### gen. Coord
q1, u1 = dynamicsymbols('phi, phi.')
l, m, c, g, Izz, k =symbols('l, m, c, g, Izz, k')
#Izz = (1/3)*m*l**2
### bodies
wall1 = Body('A')
I = inertia(wall1.frame, 0, 0, Izz)
stab = Body('C', mass=m, central_inertia=I)
bodies = (stab, wall1)
### joints
rev1 = PinJoint('J1', wall1, stab, coordinates=q1, speeds=u1,
joint_axis=wall1.z, child_point=-l*1/2*stab.x)
### forces
right_end = stab.masscenter.locatenew('right_end', (l/2) * stab.frame.x)
stab.apply_force(m*g/2*stab.y, point=right_end) #spring preload
stab.apply_force(k*(sin(q1)*l)*stab.y, point=right_end)
stab.apply_force(-wall1.y*stab.mass*g)
### EOM
method = JointsMethod(wall1, rev1)
method.form_eoms() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This makes a pin joint a distance of l/2 from the rod's mass center:
This glues the point mass to l*3/2 away from the rod's mass center.
So it seems your rod is The total inertia of this rod + mass will then be:
which is:
|
Beta Was this translation helpful? Give feedback.
This makes a pin joint a distance of l/2 from the rod's mass center:
This glues the point mass to l*3/2 away from the rod's mass center.
So it seems your rod is
3*l
long and the mass center of the rod is located at the rod's geometric center but the pin joint is locatedl/2
from its mass center. And then point mass isl*3/2
from the rod's mass center.The total inertia of this rod + mass w…