CoordSys3D vs. ReferenceFrame #24674
-
I am working on a dynamics problem where I need to define two reference frames (Inertial and Body-fixed). Apart from rotating the body-fixed coordinate system relative to the inertial coordinate system, I also need to translate the former relative to the latter. Using the mechanics module (sympy.physics.mechanics) I can define the transformations between the two reference frames, but cannot translate/offset the body-fixed coord system. I have come up with two solutions but cannot proceed because they are not documented.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
sympy.vector and sympy.physics.vector are not interoperable in any useful way. sympy.physics.vector ReferenceFrames are only for tracking relative orientations, there is no concept of a translating reference frame. Point objects are what manage translation. The dynamical formulation in the module isn't built on the ideas you find in graphics (i.e. transformation matrix that can manage rotation of a frame and translation of a point in one mathematical element). If you want to use the mechanics package, it is best to follow the formalism it uses: ReferenceFrame for rotation and Point for translation. My book explains some of these things: https://moorepants.github.io/learn-multibody-dynamics/ |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for the quick response. I am actually taking your class (2021/2022 version) and it is what inspired me to pursue my project. |
Beta Was this translation helpful? Give feedback.
sympy.vector and sympy.physics.vector are not interoperable in any useful way.
sympy.physics.vector ReferenceFrames are only for tracking relative orientations, there is no concept of a translating reference frame. Point objects are what manage translation. The dynamical formulation in the module isn't built on the ideas you find in graphics (i.e. transformation matrix that can manage rotation of a frame and translation of a point in one mathematical element).
If you want to use the mechanics package, it is best to follow the formalism it uses: ReferenceFrame for rotation and Point for translation.
My book explains some of these things: https://moorepants.github.io/learn-multibody-dynamics/