Repository navigation
physics.mechanics, Kane's method. Quaternions #30767
|
I am playing around with a simulation and opty seems to find faster solutions when I describe the rotations with quaternions, rather than with normal angles (Euler angles?) Would it make sense to add something like |
Answered by
sayedrisat
Oct 18, 2026
Replies: 2 comments 1 reply
This comment was marked as disruptive content.
This comment was marked as disruptive content.
|
Thanks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A helper could be useful, especially if the goal is to make the quaternion formulation easier to set up in
KanesMethod. I would make the rotation convention explicit, though: three angles alone do not determine a unique quaternion unless the axis order and whether the rotations are body-fixed or space-fixed are specified. The meaning ofspeedsalso needs to be clear: are these Euler-angle derivatives, or components of angular velocity in a chosen frame? Those are not interchangeable in general.SymPy Mechanics already lets you describe the same frame using either Euler rotations or quaternion coordinates, e.g.
B.orient_body_fixed(N, angles, 'XYZ')versusB.orient_quaternion(N, q0, q1, q2,…