Brilliant!  Thank you.


On Wednesday, February 15, 2017 at 3:35:24 PM UTC-6, Jason Moore wrote:
>
> If you take the Jacobian with respect to your b vector I think you should 
> get A.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Wed, Feb 15, 2017 at 1:17 PM, Sebastian Luque <spl...@gmail.com 
> <javascript:>> wrote:
>
>> 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 sympy+un...@googlegroups.com <javascript:>.
>> To post to this group, send email to sy...@googlegroups.com <javascript:>
>> .
>> 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
>>  
>> <https://groups.google.com/d/msgid/sympy/201748a8-3446-45c4-9779-d195c35cafcb%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/4e28b2c6-5d6f-49a3-b75e-19fa1424c924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to