-1
$\begingroup$

I am currently working with this hypergeometric function ${_2}F_1$,

$\rho(r)=\frac{2b}{1-q}(1-(\frac{b}{r})^{1-q})^{\frac{1}{2}}{_2}F_1(\frac{1}{2},1-\frac{1}{q-1},\frac{3}{2},1-(\frac{b}{r})^{1-q})$

I have just started learning and using Mathematica and I just want to ask if I can use Mathematica to construct and implement a simple routine to numerically invert the function $\rho(r)$ into $r(\rho)$? Note that $-\infty<q<1$, and $r,b>0$. Also, at $r=b$, $\rho=0$.

I have already tried the following routine

r[\rho_] := r /. Solve[\rho == (b/(1 - q)) (1 - (b/r)^(1 - q))^(1/2)/(1/
     2) Hypergeometric2F1[1/2, 1 - 1/(q - 1), 1/2 + 1, 
   1 - (b/r)^(1 - q)], r][[1]]
r[1]
$\endgroup$
  • 2
    $\begingroup$ What have you tried? Did you search the documentation? $\endgroup$ – rhermans Aug 21 '18 at 14:20
  • $\begingroup$ I have tried the InverseFunction command but nothing happens. $\endgroup$ – user583893 Aug 21 '18 at 14:29
  • 3
    $\begingroup$ Try to put yourself in our position, there is very little we can do without seeing the specific code you have used and an something more information rich than "nothing happens". Please read my first comment and follow the links. Please share the code that defines $\rho(r)$ $\endgroup$ – rhermans Aug 21 '18 at 14:43
1
$\begingroup$
\[Rho][r_, b_, q_] := (2*b/(1 - q))*(1 - (b/r)^(1 - q))^(1/2)*
  Hypergeometric2F1[1/2, 1 - 1/(q - 1), 3/2, 1 - (b/r)^(1 - q)]
R = InverseFunction[
  Function[{r, b, q}, (2*b/(1 - q))*(1 - (b/r)^(1 - q))^(1/2)*
    Hypergeometric2F1[1/2, 1 - 1/(q - 1), 3/2, 1 - (b/r)^(1 - q)]], 1,
   3]
{Plot[\[Rho][r, 1, -2], {r, 0, 3}], 
 Plot[R[x, 1, -2], {x, 0, 3}, PlotRange -> All]}

fig1

$\endgroup$
  • $\begingroup$ This works. Thank you. $\endgroup$ – user583893 Aug 23 '18 at 11:10

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.