Using the solution to an equation in another function
Indeed, the plot can be obtained numerically.
T[R_?NumericQ] := First[r /. NSolve[R^2 (1 - 1/r Erf[r/4]) == r^2, r, Reals]]
Potential[R_?NumericQ] := 1/R^2 (1 - 1/T[R] Erf[T[R]/4])
Plot[Potential[R], {R, 0, 5}, PlotRange -> {0, 5}]
Note that Potential
is singular at R == 0
, so it might be more informative to plot.
Plot[R^2 Potential[R], {R, 0, 5}]
FYI you can do that plot parametrcially and avoid numerically solving for r
:
RR[r_] = R /. Solve[R^2 (1 - 1/r Erf[r/4]) == r^2, R] // First
pot[r_] = 1/RR[r]^2 (1 - 1/r Erf[r/4])
ParametricPlot[{RR[r], RR[r]^2 pot[r]}, {r, -5, 0},
AspectRatio -> 1/GoldenRatio]