I want to eventually solve this with these three parameters being given from a list or table. It is not returning a solution, but I know that there is a 0 of this function (from looking at the plot)
NSolve[-((2 #2^2 #1 (1 - BesselK[0, r #3]/BesselK[0, #2 #3])^2)/
r^3) + (2 (1 + #2^2/r^2) #1 #3 (1 - BesselK[0, r #3]/
BesselK[0, #2 #3]) BesselK[1, r #3])/BesselK[0, #2 #3] == 0.0,
r] &[0.1, 5, 1.5]
What am I doing wrong?
FindRoot
instead, which is designed for general numerical root-finding. WhereNSolve
works,FindRoot
is still likely to be faster (I think). You have to provide a guess, however.FindRoot[yourEquation, {r, 4}] &[0.1, 5, 1.5]
$\endgroup$ – march Apr 20 '17 at 22:40