Sets of trigonometric equations: solve for $x$

Solution 1:

Too long for a comment.

If this is coming from some experiments, I suppose that you have in fact equations like $$\sin(\alpha_n+x)+\sin(\beta_n-x)=c_{1n}$$ where the $c_{1n}$ are almost a constant.

If you assume that the $c_{1n}$ are exactly a constant. then the problem is simple. Take two of the equations and solve for $x$. But, how can you be sure that the obtained solution will satisfy all other equations ?

This problem looks to me very similar to a data reconciliation problem and more than likely it would need to be solved using optimization.

The rhs being constant or not, you can write all the equations as

$$\sin(\alpha_n+x)+\sin(\beta_n-x)=c_{n}\qquad \text{for} \qquad n=1,2,\cdots, q\tag 1$$ Expanding the sines, defines $$a_n=\cos(\alpha_n)-\cos(\beta_n)\qquad \text{and} \qquad b_n=\sin(\alpha_n)+\sin(\beta_n)$$ which makes $(1)$ to be $$a_n \sin(x)+b_n \cos(x)=c_n \tag 2$$ In a preliminary step, let $S=\sin(x)$ and $C=\cos(x)$ and treat the problem as a bilinear regression (ignoring the relation between $S$ and $C$). This is easy to solve using matrix calculations or the normal equations $$S \sum_{n=1}^q a_n^2+C \sum_{n=1}^q a_nb_n= \sum_{n=1}^q a_nc_n$$ $$S \sum_{n=1}^q a_nb_n+C \sum_{n=1}^q b_n^2= \sum_{n=1}^q b_nc_n$$

Two linear equations the solution of which giving $S$ and $C$ independently of eachother. The problem is that, more than likely $$S^2+C^2 \neq 1$$ but the obtained values will be very reasonable starting guesses of the final step.

Now, consider the norm $$\Phi(S)= \sum_{n=1}^q \Big[a_n S+b_n \sqrt{1-S^2}-c_n\Big]^2$$ which is what you need to minimize to obtain the most probable value of $S=\sin(x)$.

Compute the deivative and set it equal to $0$. This will give the equation in $S$ $$S \sum_{n=1}^q (a_n^2-b_n^2)+\sqrt{1-S^2}\sum_{n=1}^q a_nb_n+\frac{S}{\sqrt{1-S^2}}\sum_{n=1}^q b_nc_n-\frac{S^2}{\sqrt{1-S^2}}\sum_{n=1}^q a_nb_n-\sum_{n=1}^q a_nc_n=0$$ which will be easy to solve using Newton method.

For an illustration example, I shall use three equations. $$\sin \left(x+\frac{\pi }{4}\right)+\sin \left(\frac{\pi }{3}-x\right)=1.40\tag 3$$ $$\sin \left(x+\frac{\pi }{8}\right)+\sin \left(\frac{\pi }{5}-x\right)=0.85\tag 4$$ $$\sin \left(x+\frac{\pi }{12}\right)+\sin \left(\frac{\pi }{6}-x\right)=0.67\tag 5$$

Solving $(3)$ gives $x=0.620904$; solving $(4)$ gives $x=0.63382$; solving $(5)$ gives $x=0.635439$; they are close but different.

Using the proposed procedure will give $x_{\text{opt}}=0.626170$. Recomputing the three rhs will give $1.39605$, $0.853664$ , $0.673401$.

Edit

If the $c_n$, $\alpha_n$ and $\beta_n$ are perfectly known, there is not much choice.

Using the tangent half-angle substitution $x=2\tan^{-1}(t)$, each equation is a quadratic in $t$ $$(b_n+c_n)t^2-2a_nt +(c_n-b_n)=0\implies t_n^{\pm}=\frac{a_n\pm\sqrt{a_n^2+b_n^2-c_n^2}}{b_n+c_n}$$ Solve all of them and perform some statistical analysis.

Update

There is something which could be interesting to try which takes into account the structure of your data.

The idea will be to obtain the best $x_1$ for $c_1$, $x_2$ for $c_2$ and $x_3$ for $c_3$.

Say for $c_1$, consider the $\frac 12n(n-1)$ equations $$f_{ij}=(a_i-a_j) \sin(x)+(b_i-b_j) \cos(x)$$ which, in the ideal case should be equal to $0$ and now consider the norm $$\Phi(x)=\sum_{i=1}^{n-1}\sum_{j=i+1}^{n} \Big[(a_i-a_j) \sin(x)+(b_i-b_j) \cos(x)\Big]^2$$ and this becomes a simple optimization problem in one dimension.

For illustration purposes, for $c=1$ and the following parameters $$\left( \begin{array}{cc} \alpha_n & \beta_n \\ 0.12 & 0.92 \\ 0.23 & 0.82 \\ 0.34 & 0.74 \\ 0.46 & 0.66 \\ 0.57 & 0.59 \\ 0.68 & 0.54 \end{array} \right)$$

This leads to $x=0.453886$ and for this value $\Phi_{\text{min}}=2.324\times 10^{-4}$.

Working a bit more, we can get the explicit solution. Let $A_{k}=(a_i-a_j)$ and $B_{k}=(b_i-b_j)$

$$\tan(2x)=2\frac{ \sum_{k=1}^{\frac 12n(n-1)}A_k\,B_k} {\sum_{k=1}^{\frac 12n(n-1)}\left(B^2_k-A^2_k\right) } \quad \implies x=$$