0
$\begingroup$

This question already has an answer here:

I need to find $a$ from this equation:

Solve[(2*b)/a - 1/(n*π)*Sin[(2*n*π*b)/a] - 1/2 == 0, a]

but I get the response:

Solve::nsmet: This system cannot be solved with the methods available to Solve.

I have also tried other methods: NSolve, Root, Reduce etc but it is always the same. Is there any way to solve this?

$\endgroup$

marked as duplicate by corey979, MarcoB, m_goldberg, Mr.Wizard Jan 22 '17 at 10:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ Are there any assumptions for n and b? I guess that n is a non-negative integer, but b? $\endgroup$ – mattiav27 Jan 21 '17 at 19:28
  • 1
    $\begingroup$ Obviously this system cannot be solved analyticaly. It's not a MA problem. The solution can be found numericaly only. $\endgroup$ – cyrille.piatecki Jan 21 '17 at 20:25
  • $\begingroup$ This problem is equivalent to Solve[Sin[x] == x, x], which has only one solution. FindInstance[Sin[x] == x, x] gives it, {{x -> 0}}. $\endgroup$ – bbgodfrey Jan 21 '17 at 20:37
  • $\begingroup$ @mattiav27 n is a non-negative integer, b is given and b<a, both non-negative $\endgroup$ – Wojciech Wróblewski Jan 21 '17 at 21:47
1
$\begingroup$

Setting $x=a/b$ the equation is

eqn = (-1/2 + 2 x - Sin[2 x n π]/(n π)) == 0

Hopefully it is obvious that there is a solution $x=1/4$ for even $n$. For odd $n$ the solution will shift away from $1/4$ because of the sin term. Write $x=1/4 + e/{(2 \pi n)}$ and we get this for $e$:

Simplify[eqn /. {x -> 1/4 + e/(2 π n)}, n ∈ Integers && n > 0] // TrigExpand
(* e == Cos[(n π)/2] Sin[e] + Cos[e] Sin[(n π)/2] *)

If $n$ is even we have $e=\sin (e)$ so $e=0$ as previously observed. If $n$ is odd we have $e=\cos(e) sin(n \pi/2)$. In general we can say $e=q \sin(n\pi /2)$ where $q$ is the solution to the transcendental equation $y=\cos(y)$ (This we will have to find numerically).

Thus we can write the solution as

q = y /. FindRoot[y == Cos[y], {y, 0.5}, WorkingPrecision -> 30]
(* 0.739085133215160641655312087674 *)

x = 1/4 + q Sin[n π/2]/(2 π n)

Checking the result for the first few n:

Table[eqn, {n, 10}]
(* {True, True, True, True, True, True, True, True, True, True} *)

Visualize the solutions for $x$ vs $n$:

DiscretePlot[x, {n, 1, 30}, PlotRange -> {0, 0.5}, AxesLabel -> {"n", "x"}]

enter image description here

$\endgroup$
2
$\begingroup$

The only way to solve your equation for a is numerical, assigning values to n and b. Here I choose some random ones.

b = 1; n = 2;
Plot[{-1/(n*π)*Sin[(2*n*π*b)/a], -(2*b)/a + 1/2}, {a, -10,10}]

enter image description here

f[a_] := (2*b)/a - 1/(n*π)*Sin[(2*n*π*b)/a] - 1/2;
FindRoot[f[a] == 0, {a, 3}]

{a -> 4.}

f[4]

0

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.