_an_bn_nb

miepython.mie_jit._an_bn_nb(m, x, n_pole)[source]

Compute arrays of Mie coefficients a_n and b_n for a sphere.

When n_pole=0, the routine estimates the size of the arrays based on Wiscombe’s formula. The length of the arrays is chosen so that the error when the series is summed is around 1e-6.

If n_pole>0, then the array sizes will be n_pole+1. This is useful when trying to isolate the behavior of a particular multipole.

To support resonance calculations, one can specify the number of terms to be calculated. In general, using too few or too many terms increases the error rate. So if you specify the number of terms be aware that you are playing with fire.

Parameters:
  • m – the complex index of refraction of the sphere

  • x – the size parameter of the sphere

  • n_pole – the number of An and Bn terms (0 does autosizing)

Returns:

a, b – arrays of Mie coefficents An and Bn