Cannot solve an trigonometric equation

107 Views Asked by At

I have an equation that reads like this:

$$\frac{l \cdot \sin{\alpha} + ((h - 2 \cdot r) \cdot \cos(\frac{\alpha} { 2}) + 3 \cdot r - r \cdot \cos(\alpha))}{ 2 \cdot \sin{\frac{\alpha} { 2}}}= w$$

I would like to solve it symbolically for $\alpha$, however, by using sympy, sagemath, mathematica, mathcad no solution can be found. I am only interested in $0<\alpha<\pi$ range and only in real solutions. All other variables are positive reals.

If I plot this equation by inserting arbitrary values following plot can be seen: a graph

From the plot, it does not seem like a complicated curve and it looks similar to 1/x. Why is it that I cannot find a solution, and what should I do to be able to derive one?

Any help is appreciated!

2

There are 2 best solutions below

4
On

Just to expand on my comment, let $\alpha=2\theta$. Your equation is $$l\sin 2\theta+(h-2r)\cos \theta+3r-r\cos 2\theta = 2w\sin\theta$$

Using double angle formulae, this is

$$2l\sin \theta \cos \theta +(h-2r)\cos \theta+3r - r\left(1-2\sin^2 \theta\right) = 2w\sin\theta$$

Substituting $x=\sin\theta$, $$(2lx+h-2r)\sqrt{1-x^2}+3r - r\left(1-2x^2\right) = 2wx$$

You can expand this into a quartic in $x$ and solve from there, but it's not very nice.

For reference, the fully expanded version with solution is here.

1
On

You cannot solve symbolically because you need to deal with a quadric (4th-order polynomial).

If you zoom out you will see the complexity arise

fig1

Take the equation and move the denominator on the right-hand-side to bring the equation into the following form:

$$ A \cos \tfrac{\alpha}{2} + B \sin \tfrac{\alpha}{2} + C \cos \alpha + D \sin \alpha + E = 0 $$

where $A \ldots E$ are coefficients based on the parameters given.

Next, the problem needs to be expressed in terms of simple angles, and so use the substitution $\theta \rightarrow \tfrac{\alpha}{2}$, or

$$ A \cos (\theta) + B \sin (\theta) + C \cos (2 \theta) + D \sin (2\theta) + E = 0 $$

and using the trig identities $\cos(2 \theta) \equiv 2 \cos^2 \theta - 1$ and $\sin(2 \theta) \equiv 2 \sin \theta \cos \theta$

$$ A \cos (\theta) + B \sin (\theta) + 2 C \cos^2 \theta + 2 D \sin \theta \cos \theta -C + E = 0 $$

Now use a tan-half-angle substitution

Substitution(s)
$t = \tan \left( \tfrac{\theta}{2} \right)$
$ \theta = 2 \tan^{-1}(t)$
$\cos \theta = \tfrac{1-t^2}{1+t^2}$
$\sin \theta = \tfrac{2 t}{1+t^2}$

which transforms the equation into

$$ \small A \left( \frac{1-t^2}{1+t^2} \right) + B \left( \frac{2 t}{1+t^2} \right) + 2 C \left( \frac{1-t^2}{1+t^2} \right)^2 \theta + 2 D \left( \frac{2 t}{1+t^2} \right) \left( \frac{1-t^2}{1+t^2} \right) -C + E = 0 $$

and finally, eliminate the denominators by multiplying both sides and expanding out

$$ \small (A+C+E)+(2 (B+2 D)) t+(2 (E-3 C)) t^2+(2 (B-2 D)) t^3+(-A+C+E) t^4 = 0 $$

which is a 4th-order polynomial in terms of $t$.

If you do find a solution (numerically or whatnot) then you go back to $\alpha$ with

$$ \alpha = 2 \theta = 2 ( 2 \tan^{-1} t) = 4 \tan^{-1} t $$


Tan-half-angle substitutions are widely used in robotics to transform trig expressions into polynomials.