28 s1_1=zeros(nang,dtype=complex128)
29 s1_2=zeros(nang,dtype=complex128)
30 s2_1=zeros(nang,dtype=complex128)
31 s2_2=zeros(nang,dtype=complex128)
32 pi=zeros(nang,dtype=complex128)
33 tau=zeros(nang,dtype=complex128)
36 print (
'error: nang > mxnang=1000 in bhmie')
50 xstop = x + 4.*x**0.3333 + 2.0
52 nmx = max(xstop,ymod) + 15.0
65 print (
"error: nmx > nmxx=%f for |m|x=%f" % ( nmxx, ymod) )
68 dang = .5*pii/ (nang-1)
71 amu=arange(0.0,nang,1)
74 pi0=zeros(nang,dtype=complex128)
75 pi1=ones(nang,dtype=complex128)
81 d=zeros(nn+1,dtype=complex128)
84 d[nn-n-1] = (en/y) - (1./ (d[nn-n]+en/y))
99 for n
in range(0,nstop):
101 fn = (2.*en+1.)/(en* (en+1.))
107 psi = (2.*en-1.)*psi1/dx - psi0
108 chi = (2.*en-1.)*chi1/dx - chi0
118 an = (d[n]/drefrl+en/dx)*psi - psi1
119 an = an/ ((d[n]/drefrl+en/dx)*xi-xi1)
120 bn = (drefrl*d[n]+en/dx)*psi - psi1
121 bn = bn/ ((drefrl*d[n]+en/dx)*xi-xi1)
124 qsca += (2.*en+1.)* (
abs(an)**2+
abs(bn)**2)
125 gsca += ((2.*en+1.)/ (en* (en+1.)))*(
real(an)*
real(bn)+imag(an)*imag(bn))
128 gsca += ((en-1.)* (en+1.)/en)*(
real(an1)*
real(an)+imag(an1)*imag(an)+
real(bn1)*
real(bn)+imag(bn1)*imag(bn))
134 tau=en*amu*pi-(en+1.)*pi0
135 s1_1 += fn* (an*pi+bn*tau)
136 s2_1 += fn* (an*tau+bn*pi)
144 s1_2+= fn*p* (an*pi-bn*tau)
145 s2_2+= fn*p* (bn*pi-an*tau)
156 pi1 = ((2.*en+1.)*amu*pi- (en+1.)*pi0)/ en
163 s1=concatenate((s1_1,s1_2[-2::-1]))
164 s2=concatenate((s2_1,s2_2[-2::-1]))
166 qsca = (2./ (dx*dx))*qsca
167 qext = (4./ (dx*dx))*
real(s1[0])
172 qback = 4*(
abs(s1[2*nang-2])/dx)**2
175 return s1,s2,qext,qsca,qback,gsca