I have the equation
$$
x(\phi)=\frac{1}{2\sqrt2}\left(\frac{-2}{\phi}+\log\left(\frac{1+\phi}{1-\phi}\right)\right)
$$
I need to find the dependence $\phi(x)$, so I use NSolve
:
B = 20;
NSteps = 2*B*100;
H = N[2*B/NSteps];
X = Range[-B, B, H];
F[i_] := NSolve[x[ϕ] == i && (-1.0 <= ϕ <= 0.0), ϕ];
Monitor[PhiTable = Table[ϕ /. F[i], {i, -B, B, H}], i]
And I get this output:
NSolve
can't find the solution and it gives an empty result at the values from about -15 and lower. I suppose this bug is caused by exponential asymptotic of the function $\phi(x)$.
But when I write
F[i_] := NSolve[x[ϕ] == i, ϕ, Reals];
Monitor[PhiTable = Table[ϕ /. F[i][[1]], {i, -B, B, H}], i]
It finds roots at the begining but freezes at the point 16.44 and higher.
Is there a way to fix it? Or shall I use another function, not NSolve
?
Added:
x[ϕ_] := 1/(2 Sqrt[2]) (-2/ϕ + Log[(1 + ϕ)/(1 - ϕ)]);
x[\[Phi]]
? Could be similar to this question. $\endgroup$