I've been doing(adsbygoogle = window.adsbygoogle || []).push({}); linearalgebra for so long, that I've become quite a dunce at solvingnonlinearsystems of equations.

tl;dr:Can anyone suggest a fruitful plan of attack for the following system of equations?

[tex]

\begin{align}

\cos\phi_1 \cos\phi_2 \cos\phi_3 + \sigma \sin\phi_1 \sin\phi_2 \sin\phi_3 = {}& K_0 \\

\sin\phi_1 \cos\phi_2 \cos\phi_3 - \sigma \cos\phi_1 \sin\phi_2 \sin\phi_3 = {}& K_1 \\

\cos\phi_1 \sin\phi_2 \cos\phi_3 + \sigma \sin\phi_1 \cos\phi_2 \sin\phi_3 = {}& K_2 \\

\cos\phi_1 \cos\phi_2 \sin\phi_3 - \sigma \sin\phi_1 \sin\phi_2 \cos\phi_3 = {}& K_3

\end{align}

[/tex]

This is 4 equations in 3 unknowns, but they are not independent; it turns out that [itex]K_0^2 + K_1^2 + K_2^2 + K_3^2 = 1[/itex] (as you can easily verify).

Details below...

The motivating problem: I've applied three consecutive rotations in 3D; the planes of these rotations are mutually orthogonal. These equations give the components of therotor([itex]K_0, K_1, K_2, K_3[/itex]) in terms of thehalf-angles of rotation([itex]\phi_i, \phi_2, \phi_3[/itex]). [itex]\sigma = \pm 1[/itex] is a constant which specifies the handedness of the bivector triple. (I wanted to be general, but at this point I'd accept a method which just picks a convenient handedness.)

Below, I'll list the approaches I've tried in case anyone's interested. I just wanted to put the tl;dr version up at the top.

I'm aware that solutions exist online, but I don't find them satisfying because they don't tell mehowto solve something like this. (At least, the ones I've seen.) And I'm taking this as an opportunity to brush up some rusty skills.

Approach 1: Squaring and canceling

I thought it might be helpful to square the equations. That way, I could consider [itex]S_i \equiv \sin^2(\phi_i)[/itex] as my unknowns, replace [itex]\cos^2(\phi_i)[/itex] with [itex](1 - S_i)[/itex], and forget about the trig for a while. Therearethose pesky linear terms, but these equations have a very specific structure which helps: the linear term isalways[itex]\pm 2 \sigma \cos\phi_1 \cos\phi_2 \cos\phi_3 \sin\phi_1 \sin\phi_2 \sin\phi_3 [/itex]. So we can cancel it out and we're left with onlysquaredtrigonometric functions.

Unfortunately, the remaining three equations are not independent. No matter how I combine them, all the variables always drop out and I'm left with [itex]\sum K_i^2 = 1[/itex], which I already knew.

Approach 2: Adding equations; using trig addition formulae

If I add the equations for [itex]K_1[/itex] and [itex]K_3[/itex], and also the equations for [itex]K_0[/itex] and [itex]K_2[/itex], I get the following:

[tex]

\begin{align}

\sin(\phi_1 + \phi_3)(\cos\phi_2 - \sigma \sin\phi_2) = {}& K_1 + K_3 \\

\cos(\phi_1 - \sigma\phi_3)(\cos\phi_2 + \sin\phi_2) = {}& K_0 + K_2

\end{align}

[/tex]

If I bite the bullet and pick [itex]\sigma = -1[/itex] (giving up for now on my general solution), these two equations divide quite nicely to give

[tex]

\tan(\phi_1 + \phi_3) = \frac{K_1 + K_3}{K_0 + K_2}

[/tex]

This looks pretty promising! I can take the [itex]\arctan[/itex] of both sides to get alinearequation in [itex]\phi_1[/itex] and [itex]\phi_3[/itex]. If I get two more equations like this, I'll have alinearsystem -- and there aretwo more waysto combine these four equations!

Unfortunately, those other two ways don't look very fruitful to me. Even with the same choice of [itex]\sigma = -1[/itex], I get:

[tex]

\begin{align}

\cos\phi_1 \sin(\phi_3 + \phi_2) - \sin\phi_1\sin(\phi_3 - \phi_2) = {}& K_2 + K_3 \\

\cos\phi_1 \cos(\phi_3 - \phi_2) + \sin\phi_1\cos(\phi_3 + \phi_2) = {}& K_0 + K_1

\end{align}

[/tex]

It's just not clear to me how I would change these two equations into alinearequation for [itex]\phi_2[/itex] and [itex]\phi_3[/itex].

Other ideas?

I'd really appreciate any guidance. I've been somewhat obsessing over this problem. :)

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Solving nonlinear equations for yaw/pitch/roll given rotor/quaternio

Loading...

Similar Threads - Solving nonlinear equations | Date |
---|---|

I Solving System of Equations w/ Gauss-Jordan Elimination | Sep 18, 2017 |

I Solving a system of linear equations using back substitution | Aug 30, 2017 |

Need resources for solving nonlinear matrix equations | Jun 12, 2013 |

Solving a system of 3 nonlinear equations | Jan 23, 2013 |

Algorithm for solving system of nonlinear equations | Feb 25, 2007 |

**Physics Forums - The Fusion of Science and Community**