Hello,
I'm trying to work out the derivation of the relationship between Euler
angle rates in terms of Euler angles and angular rates in body frame
(e.g. http://dma.ing.uniroma1.it/users/lss_da/MATERIALE/Textbook.pdf
section 1.2.2). I have developed this for the so-called "Tait-Bryant"
rotation as follows:
---<--------------------cut here---------------start------------------->---
import sympy as sy
def x_rotation(theta):
return sy.Matrix([[1, 0, 0],
[0, sy.cos(theta), -sy.sin(theta)],
[0, sy.sin(theta), sy.cos(theta)]])
def y_rotation(theta):
return sy.Matrix([[sy.cos(theta), 0, sy.sin(theta)],
[0, 1, 0],
[-sy.sin(theta), 0, sy.cos(theta)]])
def z_rotation(theta):
return sy.Matrix([[sy.cos(theta), -sy.sin(theta), 0],
[sy.sin(theta), sy.cos(theta), 0],
[0, 0, 1]])
phi, theta, psi = sy.symbols("\\phi, \\theta, \\psi")
omega_x, omega_y, omega_z = sy.symbols("\\omega_x \\omega_y \\omega_z")
p, q, r = sy.symbols("p q r")
phi_dot, theta_dot, psi_dot = sy.symbols(("\\dot\\phi \\dot\\theta "
"\\dot\psi"))
omega_e = sy.Matrix([[omega_x], [omega_y], [omega_z]])
omega_b = sy.Matrix([[p], [q], [r]])
psi_b = ((x_rotation(phi).T * y_rotation(theta).T) *
sy.Matrix([[0], [0], [psi_dot]]))
theta_b = x_rotation(phi).T * sy.Matrix([[0], [theta_dot], [0]])
phi_b = sy.Matrix([[phi_dot], [0], [0]])
pqr = phi_b + theta_b + psi_b
---<--------------------cut here---------------end--------------------->---
The resulting `pqr' matrix is as expected:
Out[57]:
Matrix([
[ \dot\phi - \dot\psi*sin(\theta)],
[\dot\psi*sin(\phi)*cos(\theta) + \dot\theta*cos(\phi)],
[\dot\psi*cos(\phi)*cos(\theta) - \dot\theta*sin(\phi)]])
However, this needs to be broken down into an expression of the form:
A b
where A is the 3x3 transformation matrix, and b is the vector with
\dot\phi, \dot\theta, and \dot\psi. I know what the result should be,
but don't know how to get sympy to do it. Any suggestions welcome.
--
Seb
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/201748a8-3446-45c4-9779-d195c35cafcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.