A question about scattering coefficients calculation

51 views
Skip to first unread message

Shuyu Wei

unread,
Oct 29, 2014, 1:53:36 PM10/29/14
to holopy...@googlegroups.com
Hi,
I'm trying to do some simple Lorenz-Mie scattering calculations using Holopy 2.0.0. I tried to validate its result using other programs and found some differences. These differences might be originated from  scattering coefficients. Here i use parameters on page 114 of  Bohren and Huffman's book to calculate scattering coefficients.

>>> import holopy
>>> holopy.scattering.theory.mie_f.miescatlib.scatcoeffs(3,1.33,10)
array
([[  6.12610216e-01 -4.87153917e-01j,
         
9.82586415e-01 -1.30806543e-01j,
         
4.84667736e-02 -2.14750426e-01j,
         
3.71060641e-03 -6.08016267e-02j,
         
5.90102383e-05 -7.68158552e-03j,
         
3.92278940e-08 -1.98060325e-04j,
         
1.85779630e-10 -1.36301001e-05j,
         
4.04295855e-13 -6.35842634e-07j,
         
1.01987227e-16 -1.00988726e-08j,
         
9.18046539e-20 -3.02992828e-10j],
       
[  7.72430111e-01 -4.19263443e-01j,
         
9.90415140e-01 -9.74319809e-02j,
         
9.35527208e-03 -9.62691590e-02j,
         
5.33068064e-04 -2.30821122e-02j,
         
8.80046426e-06 -2.96654459e-03j,
         
6.48966325e-10 -2.54748175e-05j,
         
1.08236451e-11 -3.28993087e-06j,
         
3.58723829e-14 -1.89400060e-07j,
         
3.89359251e-19 -6.23986579e-10j,
         
2.75291319e-21 -5.24682112e-11j]])


The results are quite different from the those on the book. I also tried Maetzler's MATLAB code on this page http://omlc.org/software/mie/, and got the same results with the book.

So, do I misunderstand this function? Or this is really a bug?

Jerome Fung

unread,
Oct 29, 2014, 2:11:52 PM10/29/14
to Shuyu Wei, holopy...@googlegroups.com
Hi Shuyu,

Thank you for your question.  I wrote the part of the code you're looking at, and I see a problem with your example: scatcoeffs takes the relative index m as the first argument and the size parameter x as the second argument.  Your example above has it switched; when I run

holopy.scattering.theory.mie_f.miescatlib.scatcoeffs(1.33, 3., 10)

my results for the a_n and b_n agree with those in Bohren & Huffman.  Sorry this isn't more clearly documented, and please let us know if this doesn't fix it for you.

Best,
Jerome Fung

Reply all
Reply to author
Forward
0 new messages