I need help solving for a variable in modifed bessel function of the second kind and I have no idea. Can anyone help? Below is the equation and and what I’ve put in Mathematica.
here is your equation to start from:
eq10 = 1/2 + ((2 Sqrt[k])/d) BesselK[1, (d/(2 Sqrt[k]))] /
BesselK[0, (d/(2 Sqrt[k]))] == 1/(4 a);
It can be rewritten by substituting
(d/(2 Sqrt[k])) → z :
eq11 = 1/2 + (1/z) BesselK[1, z] /BesselK[0, z] == 1/(4 a);
You want to solve it numerically using FindRoot, therefore you have to reformat the equation in a way that the right handside is equal to zero. And you replace the symbol a by its value:
eq12 = eq11[[1]] - 1/(4 a) /. { a → 0.0382}
Now solve using FindRoot:
sol1 = FindRoot[eq12, {z, 1.}]
To get back to k, you enter sol1 in this equation:
sol2 = k → (d / (2 z))^2 /. sol1 /. d → 0.000012401
Finally you want to check that the result is correct:
eq10 /. sol2 /. { a → 0.0382, d → 0.000012401}
k_n is a modified Bessel function of the third kind, proportional to K_{n+1/2). Also Sqrt is coded incorrectly. Here’s what I get for numerical solution of your problem: