# Spheroidal Eigenfrequency

I am trying to create a Mathematica function which will calculate the eigenfequencies of a spheroidal cavity. The expressions I use are based both on the book "Spheroidal Wave functions in Electromagnetic Theory" by Le-Wei Li, ‎Xiao-Kang Kang and ‎Mook-Seng Leong, p. 249-251, and on the their developed code found on Professor Le-Wei Li's website. Specifically, at first I am trying to find the roots of the Radial Prolate Function of 1st kind, $$R_{mn}^{(1)}(c,\xi)$$, by the FindRoot command where the initial guesses will be in the region of zeros of spherical Bessel functions. Then these roots are placed in a list and by the least squares method values $$c(\xi)$$ and $$\xi$$ are fitted onto a function $$f=c(\xi)\xi=g_0\left(1+\frac{g_1}{g_0}\frac1{\xi^2}+\frac{g_2}{g_0}\frac1{\xi^4}+\frac{g_3}{g0}\frac1{\xi^6}+\cdots\right)$$ So, at first I want to get the coefficients $$g_0,g_1,g_2,g_3$$ and then use them to get my frequency function.Here's my code which doesn't seem to work though:

< ProgrammingInMathematicaSpheroidF
*First create a function that calculates spherical bessel zeros*
SphBesselRoot[l_, k_] := N[BesselJZero[l + 1/2, k]];
FindRoot[SpheroidRF[1, n, c, 1000, Type -> 1, kind -> "prolate"], {c,
SphBesselRoot[n, 1]}]
LeastSquares[FindRoot[i],{i,1,n}]
*Create then the tables of coefficients g0,g1,g2,g3 seperately*
f[n_, s_, d_, ksi_] := 3*10^8*TEg0[[n, s]]/(\[Pi] d ksi)
(1 + TEg1g0[[n,   s]] (1/ksi^2)^2 + TEg2g0[[n, s]] (1/ksi^2)^3 + TEg3g0[[n, s]] (1/ksi^2)^4)
Table[f[n, s, d, ksi], {n, 1, 20}, {s, 1, 20}]


Any suggestions?

• Is ProgrammingInMathematicaSpheroidF a package? Without access to it, it's hard to see how we can tell what is happening. – bill s Oct 14 '16 at 23:44
• Is it this one? Also, did you know that SpheroidalS1[] is built-in? You can now do things like FindRoot[SpheroidalS1[1, n, c, 1000], {c, BesselJZero[n + 1/2, 1]}]. – J. M. will be back soon Oct 15 '16 at 2:16
• Thank you for your help! Concerning your second comment, the answer is yes to your first question. I didn't know the SpheroidalS1 function which seems fine to me so I guess we can go with it. I used your code which worked perfectly but still I can't figure out how we proceed from here. Any ideas? – George Giannoulis Oct 16 '16 at 15:21