Solving systems of equations with trigonometric terms

149 Views Asked by At

I am trying to solve (or rather find the least squares solution for) a system of equations with trigonometric terms in them. The system consists of pairs of equations of the form

$a_1 \cos\theta - a_2 \sin\theta + a_3x - a_4z = b_1$

$a_2 \cos\theta + a_1 \sin\theta + a_5y - a_6z = b_2$

The unknowns are $\theta$, $x$, $y$ and $z$, all $a$ and $b$ values are known. The pairs of equations share the same unknowns but have different coefficients.

One method to solve this would be to generate a linear system where $\cos\theta$ and $\sin\theta$ are separate unknowns, but this would mean I need 3 pairs of equations instead of 2 pairs to solve the system. Also, if the coefficients are noisy, then the constraint that $\sin^2\theta + \cos^2\theta = 1$ would not be enforced.