Inertia dyadics are fixed to the frame they are originally defined in;
you cannot rotate a fixed vector/dyadic in its frame, but you can
rotate the frame they are fixed in relative to another frame. What you
can then do, for both dyadics and vectors, is express them in this
different rotated frame.

This shows how to get the inertia matrix for an inertia dyadic,
rotated into whatever frame you want.

In [1]: from sympy import *
In [2]: from sympy.physics.mechanics import *
In [3]: q1 = dynamicsymbols('q1')
In [4]: Ixx, Iyy, Izz = symbols('Ixx Iyy Izz')
In [5]: N = ReferenceFrame('N')
In [6]: A = N.orientnew('A', 'Axis', [q1, N.x])
In [7]: I = inertia(N, Ixx, Iyy, Izz)
In [8]: rotI = lambda I, f: Matrix([j & I & i for i in f for j in
f]).reshape(3,3)
In [9]: rotI(I, N)
Out[9]:
[Ixx,   0,   0]
[  0, Iyy,   0]
[  0,   0, Izz]
In [10]: rotI(I, A)
Out[10]:
[Ixx,
0,                                                      0]
[  0,                  Iyy*cos(q1(t))**2 + Izz*sin(q1(t))**2, -
Iyy*sin(q1(t))*cos(q1(t)) + Izz*sin(q1(t))*cos(q1(t))]
[  0, -Iyy*sin(q1(t))*cos(q1(t)) +
Izz*sin(q1(t))*cos(q1(t)),                  Iyy*sin(q1(t))**2 +
Izz*cos(q1(t))**2]

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to