Inertia of a rod

74 views
Skip to first unread message

Philippe Fichou

unread,
Oct 24, 2015, 12:00:59 PM10/24/15
to sympy
Hey, all
Consider a pendulum of length OA = 2a, of mass m as a rigid body of center of mass G (OG = a) which turn around (O,z). The angle between the reference frame R and the rod is q.
The inertia of the body is I = (G,0,ma^2/3,ma^2/3)
When I ask Sympy for the angular momentum about point O, it says m*a**2/3*q'*R.z, the same as point G.
I should have 4*m*a**2/3*q'*R.z.
Anybody can help me ?

Here is the code:

from sympy import symbols
from sympy.physics.mechanics import *

m,a = symbols('m a')
q = dynamicsymbols('q')

R = ReferenceFrame('R')
R1 = R.orientnew('R1', 'Axis', [q, R.z])
R1.set_ang_vel(R,q.diff() * R.z)

I = inertia(R1,0,m*a**2/3,m*a**2/3)

O = Point('O')

A = O.locatenew('A', 2*a * R1.x)
G = O.locatenew('G', a * R1.x)

S = RigidBody('S',G,R1,m,(I,G))

O.set_vel(R, 0)
A.v2pt_theory(O, R, R1)
G.v2pt_theory(O, R, R1)

print(S.angular_momentum(O,R))
print(S.angular_momentum(G,R))

Thanks !

Philippe

Philippe Fichou

unread,
Oct 24, 2015, 1:33:34 PM10/24/15
to sympy
I propose an answer to  my own question. Would there not an error in Sympy ? I can read here 
that:

Angular momentum of the rigid body.

The angular momentum H, about some point O, of a rigid body B, in a frame N is given by

H = I* . omega + r* x (M * v)

where I* is the central inertia dyadic of B, omega is the angular velocity of body B in the frame, N, r* is the position vector from point O to the mass center of B, and v is the velocity of point O in the frame, N.


I think v is not the velocity of point O, but velocity of the center of mass ?

Am I wrong ?


Thanks for your help

Philippe

Jason Moore

unread,
Oct 25, 2015, 1:50:01 AM10/25/15
to sy...@googlegroups.com
I think you are correct. Here is the output if you change the angular momentum function to use the velocity of the mass center:

In [1]: %paste

from sympy import symbols
from sympy.physics.mechanics import *

m,a = symbols('m a')
q = dynamicsymbols('q')

R = ReferenceFrame('R')
R1 = R.orientnew('R1', 'Axis', [q, R.z])
R1.set_ang_vel(R,q.diff() * R.z)

I = inertia(R1,0,m*a**2/3,m*a**2/3)

O = Point('O')

A = O.locatenew('A', 2*a * R1.x)
G = O.locatenew('G', a * R1.x)

S = RigidBody('S',G,R1,m,(I,G))

O.set_vel(R, 0)
A.v2pt_theory(O, R, R1)
G.v2pt_theory(O, R, R1)

print(S.angular_momentum(O,R))
print(S.angular_momentum(G,R))

## -- End pasted text --
4*a**2*m*q'/3*R1.z
a**2*m*q'/3*R1.z

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/8f3af7d6-95b2-4185-8cda-ebc292dec582%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jason Moore

unread,
Oct 25, 2015, 2:30:25 AM10/25/15
to sy...@googlegroups.com
I just submitted this PR: https://github.com/sympy/sympy/pull/10037 with a fix.

Philippe Fichou

unread,
Oct 25, 2015, 2:43:49 AM10/25/15
to sympy
Thank you Jason for your reply and to fix proposal,
Philippe
Reply all
Reply to author
Forward
0 new messages