I am trying to use the solution to $R^2 \left(1-\frac{1}{r}\text{Erf}[r/4]\right)=r^2$ for $r$ in the function
Potential$(R)=\frac{1}{R^2}\left(1-\frac{1}{r}\text{Erf}\left(r/4\right)\right)$
and plot this between $R=0$ and $R=5$. Essentially for each value of $R$, I want to solve the first equation for $r$ and then insert that $r$ into the second equation and plot. I use the code
T[R_] = First[r /. Solve[R^2 (1 - 1/r Erf[r/4]) == r^2, r, Reals]]
Potential[R_] = 1/R^2 (1 - 1/T[R] Erf[T[R]/4])
Plot[Potential[R], {R, 0, 5}]
However, T[R_] outputs $r$, which is not what I want, and then Potential[R_] outputs $(1 - (2 Erf[r/4])/r)/R^2$. Any ideas? I have tried using NSolve instead of Solve but this does not help.
r
simply becauseSolve
cant solve that. Do you imagine that equation should have an analytic solution? $\endgroup$NSolve
can numerically handle many things, whereSolve
can not obtain an analytic soluton. $\endgroup$