2
$\begingroup$

I have an equation:

$$ \frac{1}{g}=\int_0^{\frac{1}{\delta}\sinh \frac{1}{g}} \frac{\tanh\left(0.882\, b\,\delta\sqrt{1+z^2}\right)}{\sqrt{1+z^2}}\mathrm{d}z $$

I want to obtain the relation $b\,\delta)$, where $b>1$ and also $1>\delta>0$. Suppose we have $g=0.26$.

The problem is that, when I fix $g$, given a numerical value of $\delta$, trying to solve for $b$, Mathematica complains about the non-numerical value of the integrand. How can I overcome this? Here is the code I've tried:

g = 0.26;
fF[g_, b_, δ_] := 
  -1/g + 
    NIntegrate[Tanh[0.882*b*δ*Sqrt[1 + z^2]]/Sqrt[1 + z^2], {z, 0, Sinh[1/g]/δ}]
NSolve[fF[g, b, 0.2] == 0, b]

P.S.: the equation is essentially from a post on PSE.

$\endgroup$

closed as off-topic by MarcoB, user9660, dr.blochwave, Jens, Öskå Oct 25 '15 at 20:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, Community, dr.blochwave, Jens, Öskå
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ try FindRoot , and define your function to take only numeric values fF[g_?NumericQ, b_?NumericQ, \[Delta]_?NumericQ] $\endgroup$ – george2079 Oct 23 '15 at 16:33
  • 1
    $\begingroup$ actually just the NumericQ does the trick. NSolve works and is faster than FindRoot $\endgroup$ – george2079 Oct 23 '15 at 16:44
  • $\begingroup$ g = 0.26; fF[g_?NumericQ, b_?NumericQ, \[Delta]_?NumericQ] := -1/g + NIntegrate[ Tanh[0.882*b*\[Delta]*Sqrt[1 + z^2]]/Sqrt[1 + z^2], {z, 0, Sinh[1/g]/\[Delta]}] FindRoot[fF[g, b, 0.2] == 0, {b, 1}] gives you (* {b -> 1.01398} *) $\endgroup$ – Dr. belisarius Oct 23 '15 at 17:14
  • $\begingroup$ @belisariusisforth It get the value, however complains:"Inverse functions are being used by NSolve, so some solutions may not \ be found; use Reduce for complete solution information. " How to get rid of that? $\endgroup$ – an offer can't refuse Oct 24 '15 at 1:04
  • $\begingroup$ Are you using this code?g = 0.26; fF[g_?NumericQ, b_?NumericQ, \[Delta]_?NumericQ] := -1/g + NIntegrate[ Tanh[0.882*b*\[Delta]*Sqrt[1 + z^2]]/Sqrt[1 + z^2], {z, 0, Sinh[1/g]/\[Delta]}] ; FindRoot[fF[g, b, 0.2] == 0, {b, 1}] $\endgroup$ – Dr. belisarius Oct 24 '15 at 1:08