# How to solve this trigonometric equation, solvers doesn't work

I would like to solve this equation respect to $\phi$. How can I do it?

\begin{align} 0 &= -zMg \sin\phi \\ &+T_2l_d\sin\left(\phi-\arctan\left(\frac{(l_d-R)\sin\phi-y_q}{(l_d-R)\cos\phi-x_q}\right)\right)\\ &+T_3l_d\sin\left(-\phi+\arctan\left(\frac{-(l_d+R)\sin\phi+y_r}{-(l_d+R)\cos\phi+x_r}\right)\right)\\ &+2y\left(pA-k\left(\left(y\cos\phi-x_d\right)^2+\left(y\sin\phi-y_d\right)^2\right)^{\frac{1}{2}}-c_{eq}\right)\sin\left(\arctan\left(\frac{y\sin\phi-y_d}{y\cos\phi-x_d}\right)-\phi\right) \end{align}

I would like to have some tips about possible solving methods. Thanks

• Only thing I can think of is that you may start developping all those $\sin(\phi+\arctan(\text{stuff}))$ and eventually end up with, up to some cases, equations of the form $$\text{expression of polynomials and radicals}(\sin\phi,\cos\phi)=0,$$ which can then become, with the identity $\sin^2+\cos^2=1$, $$\text{polynomial}(\sin\phi)=0$$ However, it is to be expected that said polynomial(s) will have too large of a degree to even come close to an agebraic solution. – user228113 Mar 28 '18 at 15:14
• I tried to solve this with Mathematica and MATLAB getting no where. And i tried what you suggest but having no results at all – it8 Mar 28 '18 at 15:19
• Just curious, for what is this exactly? – John Glenn Mar 28 '18 at 15:21
• I am studying the static equilibrium of a mechanical device – it8 Mar 28 '18 at 15:22
• It might help to include a diagram of this device. There could be something about the geometry that allows you to avoid this complicated formulation. – Blue Mar 28 '18 at 15:51

Not an answer, but a preliminary pass at simplification. First, we'll reduce a lot of visual clutter with some convenient definitions:

$$s_1 := -z M g \qquad s_2 := T_2 \qquad s_3 = T_3$$ $$m := l_D \qquad r := R \qquad h := p A - c_{eq}$$ $$a := \phantom{-}( m - r ) \sin\phi - y_q \qquad b := \phantom{-}( m - r ) \cos\phi - x_q$$ $$c := -( m + r ) \sin\phi + y_r \qquad d := -( m + r ) \cos\phi + x_r$$ $$e := y \sin\phi - y_d \qquad f := y \cos\phi - x_d$$

With these, the equation becomes \begin{align} 0 &= s_1 \sin\phi + s_2 m \sin\left( \phi - \operatorname{atan}\frac{a}{b} \right) + s_3 m \sin\left(-\phi + \operatorname{atan}\frac{c}{d} \right) \\ &+ 2 y \left( h - k \sqrt{e^2+f^2} \right) \sin\left( \operatorname{atan}\frac{e}{f} - \phi \right) \\ &= s_1 \sin\phi + \frac{s_2 m ( b \sin\phi - a \cos\phi )}{\sigma_{ab}} + \frac{s_3 m (c \cos\phi-d\sin\phi)}{\sigma_{cd}} \\ &+ \frac{2y(h-k\sigma_{ef})(e \cos\phi-f\sin\phi)}{\sigma_{ef}} \end{align} where $\sigma_{xy} := \sqrt{x^2+y^2}$. Clearing fractions gives \begin{align} 0 &= s_1\;\sigma_{ab}\;\sigma_{cd}\sigma_{ef}\;\sin\phi \\ &+ s_2 m\;\sigma_{cd}\;\sigma_{ef}\;( b \sin\phi - a \cos\phi ) \\ &+ s_3 m\;\sigma_{ab}\;\sigma_{ef}\;(c \cos\phi-d\sin\phi) \\ &+ 2y\;\sigma_{ab}\;\sigma_{cd}\;(h-k\sigma_{ef})(e \cos\phi-f\sin\phi) \end{align}

Still ugly. Now, observe that

\begin{align} b \sin\phi - a \cos\phi &= y_q \cos\phi - x_q \sin\phi \\ c \cos\phi - d \sin\phi &= y_r \cos\phi - x_r \sin\phi \\ e \cos\phi - f \sin\phi &= x_d \sin\phi - y_d \cos\phi \end{align}

so that we have

\begin{align} 0 &= s_1\;\sigma_{ab}\;\sigma_{cd}\sigma_{ef}\;\sin\phi \\ &+ s_2 m\;\sigma_{cd}\;\sigma_{ef}\;( y_q \cos\phi - x_q \sin\phi ) \\ &+ s_3 m\;\sigma_{ab}\;\sigma_{ef}\;( y_r \cos\phi - x_r \sin\phi ) \\ &+ 2y\;\sigma_{ab}\;\sigma_{cd}\;(h-k\sigma_{ef})(x_d \sin\phi - y_d \cos\phi) \end{align}

Still ugly, but it has to get worse before there's any hope of getting better. In particular, the "$\sigma_{xy}$" square roots need to be eliminated, via a sequence of squaring and further expansion. I'll save that for later, since I'm not entirely sure I haven't made an error up to this point.

• Well, first of all thank you for the help. I will try to work on your equation tomorrow checking it. If you will visit the forum tomorrow maybe i will ask you something else since now i have to go – it8 Mar 28 '18 at 17:36
• What you did seems correct to me, just an error: $h:=pA+k ceq$ but it doesn't change the point you reach – it8 Mar 29 '18 at 8:44
• @iacopo: Your original question has $eq$ as a subscript on $c$, and doesn't seem have $k$ distributing onto that term, but no matter. The benefit of decluttering is ignoring such extraneous details (and/or typos). ... Be that as it may ... I took a shot at removing the "$\sigma_{xy}$"s, and the equation ultimately expanded into, literally, a million terms. If your parameters ($g$, $M$, $z$, $y$, $l_D$, $R$, etc) are independent, then the expression won't factor or simplify, so symbolically isolating $\phi$ is really a lost cause. You'll need to investigate numerical methods. – Blue Mar 29 '18 at 9:31
• Yes, i tried too and it seems to be impossible or at least it is for me. I tried a simple fsolve with matlab and it works – it8 Mar 29 '18 at 10:58

Square the right hand side and minimize the resulting expression wrt $\phi$ using optimization software that is robust. This quantity may have a number of local minima. You pick the one that its value is closest to zero.