1
$\begingroup$

I used Manipulate and FindRoot to solve the transcendental equation

x*Tanh[x] == (y + Pi/2)/Tan[y]

where y is varied in steps of .0001 up to 1.57 using Manipulate. I now want extract x values for corresponding y. Can anyone please suggest anything?

$\endgroup$
  • $\begingroup$ Please include the code in Mathematica format that you are using. $\endgroup$ – bbgodfrey Jul 14 '17 at 19:00
1
$\begingroup$

For many different y's:

FindRoot[x*Tanh[x] == (# + Pi/2)/Tan[#], {x, 1}] & /@ Range[0.1, 1, 0.1]

{{x -> 16.6522}, {x -> 8.73561}, {x -> 6.04784}, {x -> 4.6622}, {x -> 3.79441}, 
 {x -> 3.18395}, {x -> 2.71951}, {x -> 2.34523}, {x -> 2.02959}, {x -> 1.75288}}

replace all the "Range" values with your desired y's...

| improve this answer | |
$\endgroup$
0
$\begingroup$

Have a look at this equation

ContourPlot[x*Tanh[x] == (y + Pi/2)/Tan[y], {x, -12, 12}, {y, 0, 1.60}, 
     MaxRecursion -> 5, PlotPoints -> 20]

enter image description here

Define FindRoot for both wings of the solution

fr[y_ /; 0 <= y <= Pi/2] := {x /. FindRoot[x*Tanh[x] == (y + Pi/2)/Tan[y], {x, 1}], 
                             x /. FindRoot[x*Tanh[x] == (y + Pi/2)/Tan[y], {x, -1}]}

fr[.01]

(*     {158.074, -158.074}     *)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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