The single scattering albedo is a = 1 a=1 a = 1 , and the total optical depth τ ⋆ = 0.01 \tau^{\star}=0.01 τ ⋆ = 0.01 . The setting satisfies single-scattering approximation, a × τ ⋆ = 0.01 ≪ 1 a \times \tau^{\star}=0.01\ll1 a × τ ⋆ = 0.01 ≪ 1 . The incident solar flux is an unpolarized light, F = [ 0.5 , 0.5 , 0 , 0 ] F=[0.5, 0.5, 0, 0] F = [ 0.5 , 0.5 , 0 , 0 ] . In the following case example, the angles are set as follows, θ ′ = 0 o , μ ′ = 1 , ϕ ′ = 0 o ; θ = [ 0 o , 18 0 ∘ ] , μ = [ − 1 , 1 ] , ϕ = 6 0 o \theta^{\prime}=0^{o}, \mu^{\prime}=1, \phi^{\prime}=0^{o} ; \theta=\left[0^{o}, 180^{\circ}\right], \mu=[-1,1], \phi=60^{o} θ ′ = 0 o , μ ′ = 1 , ϕ ′ = 0 o ; θ = [ 0 o , 18 0 ∘ ] , μ = [ − 1 , 1 ] , ϕ = 6 0 o , where θ ′ , ϕ ′ \theta^{\prime}, \phi^{\prime} θ ′ , ϕ ′ are the polar angle and azimuth angle of the incident light Ω ′ \Omega^{\prime} Ω ′ , and the θ , ϕ \theta , \phi θ , ϕ are for the corresponding observe angles Ω \Omega Ω .
Copy a = 1 ;
tau = 0.01 ;
F = [ .5 ; .5 ; 0 ; 0 ];
thetap = 0.00001 ;
mup = cos (thetap * pi / 180 ) ;
phip = 0 ;
phi = 60 ;
Compute the Legendre-Gauss nodes ( c t h e t a ctheta c t h e t a ) and weights ( W e i g h t Weight W e i g h t ) on an interval [-1,1] with truncation order nthetas ( n t h e t a = 400 ntheta=400 n t h e t a = 400 ) using an outside function lgwt
, and retrieve the corresponding t h e t a s thetas t h e t a s . Function lgwt
takes integral using Legendre-Gauss Quadrature.
Copy nthetas = 400 ;
[ctheta , Weight] = lgwt (nthetas, - 1 , 1 ) ;
theta = acos (ctheta) * 180 / pi;
The angle Θ \Theta Θ between the directions of incidence Ω \Omega Ω and observation Ω ′ \Omega^{\prime} Ω ′ is given by
cos Θ = cos θ ′ cos θ + sin θ ′ sin θ cos ( ϕ ′ − ϕ ) \cos \Theta=\cos \theta^{\prime} \cos \theta+\sin \theta^{\prime} \sin \theta \cos \left(\phi^{\prime}-\phi\right) cos Θ = cos θ ′ cos θ + sin θ ′ sin θ cos ( ϕ ′ − ϕ ) There are two representations for the phase matrix, P S \mathbf{P}_{S} P S and P C \mathbf{P}_{C} P C , where P S \mathbf{P}_{S} P S is used for the Stocks vector representation I S = [ I , Q , U , V ] T \mathbf{I}_{S}=[I, Q, U, V]^{T} I S = [ I , Q , U , V ] T , and P C \mathbf{P}_{C} P C is for I C = [ I ∥ , I ⊥ , U , V ] T \mathbf{I}_{C}=\left[I_{ \|}, I_{\perp}, U, V\right]^{T} I C = [ I ∥ , I ⊥ , U , V ] T representation (or Chandrasekhar's representation). The connection between these two representations is simply I S = D I C \mathbf{I}_{S} = \mathbf{DI}_{C} I S = DI C , where the matrix D \mathbf{D} D is given by:
D ≡ ( 1 1 0 0 1 − 1 0 0 0 0 1 0 0 0 0 1 ) \mathbf{D} \equiv\left(\begin{array}{cccc}{1} & {1} & {0} & {0} \\ {1} & {-1} & {0} & {0} \\ {0} & {0} & {1} & {0} \\ {0} & {0} & {0} & {1}\end{array}\right) D ≡ 1 1 0 0 1 − 1 0 0 0 0 1 0 0 0 0 1 The phase matrix P C \mathbf{P}_{C} P C in I C = [ I ∥ , I ⊥ , U , V ] T \mathbf{I}_{C}=\left[I_{ \|}, I_{\perp}, U, V\right]^{T} I C = [ I ∥ , I ⊥ , U , V ] T representation is related to the phase matrix P S \mathbf{P}_{S} P S in I S = [ I , Q , U , V ] T \mathbf{I}_{S}=[I, Q, U, V]^{T} I S = [ I , Q , U , V ] T as P C = D − 1 P S D \mathbf{P}_{C}=\mathbf{D}^{-1} \mathbf{P}_{S} \mathbf{D} P C = D − 1 P S D , and D − 1 \mathbf{D}^{-1} D − 1 is given by:
D − 1 = ( 1 2 1 2 0 0 1 2 − 1 2 0 0 0 0 1 0 0 0 0 1 ) \mathbf{D}^{-1}=\left(\begin{array}{cccc}{\frac{1}{2}} & {\frac{1}{2}} & {0} & {0} \\ {\frac{1}{2}} & {-\frac{1}{2}} & {0} & {0} \\ {0} & {0} & {1} & {0} \\ {0} & {0} & {0} & {1}\end{array}\right) D − 1 = 2 1 2 1 0 0 2 1 − 2 1 0 0 0 0 1 0 0 0 0 1
Copy cTheta = mup * ctheta + sqrt (( 1 - mup ^ 2 ) * ( 1 - ctheta. ^ 2 )) * cos ((phip - phi) / 180 * pi) ;
Theta = acos (cTheta) * 180 / pi;
D = [ 1 1 0 0 ;...
1 - 1 0 0 ;...
0 0 1 0 ;...
0 0 0 1 ];
In this test case, we only include one wavelength at 500 nm, number of moment 300+1, and load the six columns of greek constants from Mie_tool output
file, without delta fit.
Copy number of wavelength
numwl = 1 ;
% number of moment
nmom = 300 + 1 ;
fname1 = 'mie_output_small2.dat' ;
fid1 = fopen (fname1) ;
rawdata1 ( 1 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 3 ) ;
% rawdata1 ( 2 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 4 ) ;
% rawdata1 ( 3 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 4 ) ;
% rawdata1 ( 4 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 4 ) ;
% rawdata1 ( 5 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 4 ) ;
% rawdata1 ( 6 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 4 ) ;
% rawdata1 ( 7 , :) = textscan (fid1, ' %f %f %f %f %f %f ' , nmom, 'headerLines' , 4 ) ;
fclose (fid1) ;
rawdata2 = cell2mat (rawdata1) ;
µdata2 = zeros (nmom, 6 , numwl) ;µ
The expression for the Fourier coefficients can be written as
A m ( τ , u ′ , u ) = ∑ ℓ = m 2 N − 1 P ℓ m ( u ) Λ ℓ ( τ ) P ℓ m ( u ′ ) \mathbf{A}^{m}\left(\tau, u^{\prime}, u\right)=\sum_{\ell=m}^{2 N-1} \mathbf{P}_{\ell}^{m}(u) \boldsymbol{\Lambda}_{\ell}(\tau) \mathbf{P}_{\ell}^{m}\left(u^{\prime}\right) A m ( τ , u ′ , u ) = ℓ = m ∑ 2 N − 1 P ℓ m ( u ) Λ ℓ ( τ ) P ℓ m ( u ′ ) where
Λ ℓ ( τ ) = ( α 1 ℓ β 1 ℓ 0 0 β 1 ℓ α 2 ℓ 0 0 0 0 α 3 ℓ β 2 ℓ 0 0 − β 2 ℓ α 4 ℓ ) \boldsymbol{\Lambda}_{\ell}(\tau)=\left(\begin{array}{cccc}{\alpha_{1}^{\ell}} & {\beta_{1}^{\ell}} & {0} & {0} \\ {\beta_{1}^{\ell}} & {\alpha_{2}^{\ell}} & {0} & {0} \\ {0} & {0} & {\alpha_{3}^{\ell}} & {\beta_{2}^{\ell}} \\ {0} & {0} & {-\beta_{2}^{\ell}} & {\alpha_{4}^{\ell}}\end{array}\right) Λ ℓ ( τ ) = α 1 ℓ β 1 ℓ 0 0 β 1 ℓ α 2 ℓ 0 0 0 0 α 3 ℓ − β 2 ℓ 0 0 β 2 ℓ α 4 ℓ The matrices P ℓ m ( ± μ ) P_{\ell}^{m}( \pm \mu) P ℓ m ( ± μ ) are defined through
P ℓ m ( u ) = ( P ℓ m , 0 ( u ) 0 0 0 0 P ℓ m , + ( u ) P ℓ m , − ( u ) 0 0 P ℓ m , − ( u ) P ℓ m , + ( u ) 0 0 0 0 P ℓ m , 0 ( u ) ) \mathbf{P}_{\ell}^{m}(u)=\left(\begin{array}{cccc}{P_{\ell}^{m, 0}(u)} & {0} & {0} & {0} \\ {0} & {P_{\ell}^{m,+}(u)} & {P_{\ell}^{m,-}(u)} & {0} \\ {0} & {P_{\ell}^{m,-}(u) P_{\ell}^{m,+}(u)} & {0} \\ {0} & {0} & {0} & {P_{\ell}^{m, 0}(u)}\end{array}\right) P ℓ m ( u ) = P ℓ m , 0 ( u ) 0 0 0 0 P ℓ m , + ( u ) P ℓ m , − ( u ) P ℓ m , + ( u ) 0 0 P ℓ m , − ( u ) 0 0 0 0 P ℓ m , 0 ( u ) with P ℓ m , ± ( u ) = 1 2 [ P ℓ m , − 2 ( u ) ± P ℓ m , 2 ( u ) ] P_{\ell}^{m, \pm}(u)=\frac{1}{2}\left[P_{\ell}^{m,-2}(u) \pm P_{\ell}^{m, 2}(u)\right] P ℓ m , ± ( u ) = 2 1 [ P ℓ m , − 2 ( u ) ± P ℓ m , 2 ( u ) ] . The functions P ℓ m , 0 ( u ) P_{\ell}^{m, 0}(u) P ℓ m , 0 ( u ) and P ℓ m , ± 2 ( u ) P_{\ell}^{m, \pm 2}(u) P ℓ m , ± 2 ( u ) are the generalized spherical functions.
We define P ℓ m , n ( u ) = 0 for ℓ < max { ∣ m ∣ , ∣ n ∣ } P_{\ell}^{m,n}(u)=0 \quad \text { for } \ell<\max \{|m|,|n|\} P ℓ m , n ( u ) = 0 for ℓ < max { ∣ m ∣ , ∣ n ∣ } .
For ℓ > max { ∣ m ∣ , ∣ n ∣ } \ell>\max \{|m|,|n|\} ℓ > max { ∣ m ∣ , ∣ n ∣ } the functions are calculated as follow (i i i is the imaginary unit).
P m m , 0 ( u ) = ( 2 i ) − m [ ( 2 m ) ! m ! m ! ] 1 / 2 ( 1 − u 2 ) m / 2 ( m ≥ 0 ) P 2 0 , ± 2 ( u ) = − 1 4 6 ( 1 − u 2 ) ( m = 0 ) P 2 1 , ± 2 ( u ) = ± ( 2 i ) − 1 ( 1 − u 2 ) 1 / 2 ( 1 ± u ) ( m = 1 ) P m m , ± 2 ( u ) = − ( 2 i ) − m [ ( 2 m ) ! ( m + 2 ) ! ( m − 2 ) ! ] 1 / 2 × ( 1 − u ) ( m ∓ 2 ) / 2 ( 1 + u ) ( m ± 2 ) / 2 ( m ≥ 2 ) \begin{aligned} P_{m}^{m, 0}(u)=(2 i)^{-m}\left[\frac{(2 m) !}{m ! m !}\right]^{1 / 2}\left(1-u^{2}\right)^{m / 2} \quad(m \geq 0) \end{aligned}
\\
\begin{aligned} P_{2}^{0, \pm 2}(u)=\frac{-1}{4} \sqrt{6}\left(1-u^{2}\right) \quad(m=0)\end{aligned}
\\
\begin{aligned} P_{2}^{1, \pm 2}(u)=\pm(2 i)^{-1}\left(1-u^{2}\right)^{1 / 2}(1 \pm u) \quad(m=1)\end{aligned}
\\
\begin{aligned} P_{m}^{m, \pm 2}(u)=&-(2 i)^{-m}\left[\frac{(2 m) !}{(m+2) !(m-2) !}\right]^{1 / 2} \times(1-u)^{(m \mp 2) / 2}(1+u)^{(m \pm 2) / 2} \quad(m \geq 2) \end{aligned} P m m , 0 ( u ) = ( 2 i ) − m [ m ! m ! ( 2 m )! ] 1/2 ( 1 − u 2 ) m /2 ( m ≥ 0 ) P 2 0 , ± 2 ( u ) = 4 − 1 6 ( 1 − u 2 ) ( m = 0 ) P 2 1 , ± 2 ( u ) = ± ( 2 i ) − 1 ( 1 − u 2 ) 1/2 ( 1 ± u ) ( m = 1 ) P m m , ± 2 ( u ) = − ( 2 i ) − m [ ( m + 2 )! ( m − 2 )! ( 2 m )! ] 1/2 × ( 1 − u ) ( m ∓ 2 ) /2 ( 1 + u ) ( m ± 2 ) /2 ( m ≥ 2 ) and the recurrence relations
( ℓ + 1 ) 2 − m 2 P ℓ + 1 m , 0 ( u ) = ( 2 ℓ + 1 ) u P ℓ m , 0 ( u ) − ℓ 2 − m 2 P ℓ − 1 m , 0 ( u ) \sqrt{(\ell+1)^{2}-m^{2}} P_{\ell+1}^{m, 0}(u)=(2 \ell+1) u P_{\ell}^{m, 0}(u)-\sqrt{\ell^{2}-m^{2}} P_{\ell-1}^{m, 0}(u) ( ℓ + 1 ) 2 − m 2 P ℓ + 1 m , 0 ( u ) = ( 2 ℓ + 1 ) u P ℓ m , 0 ( u ) − ℓ 2 − m 2 P ℓ − 1 m , 0 ( u ) The equations above are taken from de Hann's 1987 paper, eq. 74 to 81
, in The adding method for multiple scattering calculations of polarized light \textit{The adding method for multiple scattering calculations of polarized light} The adding method for multiple scattering calculations of polarized light . http://articles.adsabs.harvard.edu//full/1987A%26A...183..371D/0000378.000.html
The rotations of reference plane are implicitly accounted for in the expansion method. In the following code, line 3~line6
uses functions defined outside.
plm0
calculates cases with m=0 and n=0, plm2
calculates cases with m=2 and n=2, plmn2
calculates cases with m=2, n=-2, and plm2
calculates cases with m=0 and n=2.
Copy nterms = length (data2) ;
p00 = plm0 ( 0 ,nterms - 1 ,ctheta) ; % m = 0 , n = 0
p22 = plm2 ( 2 ,nterms - 1 ,ctheta) ; % m = 2 , n = 2
p2n2 = plmn2 ( 2 ,nterms - 1 ,ctheta) ; % P subscript m = 2 , n =- 2
p02 = plm2 ( 0 ,nterms - 1 ,ctheta) ; % P subscript m = 0 , n = 2
Read in the phase moments from the 'mie_output_small2.dat'
file to alphas and betas (line 2~8
). Suppressing the a = b a = b a = b dependence, the following equations are for cases of non-spherical particles.
a 1 ( Θ ) = ∑ ℓ = 0 2 N − 1 α 1 ℓ P ℓ 0 , 0 ( cos Θ ) a 2 ( Θ ) + a 3 ( Θ ) = ∑ ℓ = 2 2 N − 1 ( α 2 ℓ + α 3 ℓ ) P ℓ 2 , 2 ( cos Θ ) a 2 ( Θ ) − a 3 ( Θ ) = ∑ ℓ = 2 2 N − 1 ( α 2 ℓ − α 3 ℓ ) P ℓ 2 , − 2 ( cos Θ ) a 4 ( Θ ) = ∑ ℓ = 0 2 N − 1 α 4 l P ℓ 0 , 0 ( cos Θ ) b 1 ( Θ ) = ∑ ℓ = 2 2 N − 1 β 1 ℓ P ℓ 0 , 2 ( cos Θ ) b 2 ( Θ ) = ∑ ℓ = 2 2 N − 1 β 2 ℓ P ℓ 0 , 2 ( cos Θ ) \begin{aligned}
a_{1}(\Theta)=\sum_{\ell=0}^{2 N-1} \alpha_{1}^{\ell} P_{\ell}^{0,0}(\cos \Theta)
\\
a_{2}(\Theta)+a_{3}(\Theta)=\sum_{\ell=2}^{2 N-1}\left(\alpha_{2}^{\ell}+\alpha_{3}^{\ell}\right) P_{\ell}^{2,2}(\cos \Theta)
\\
a_{2}(\Theta)-a_{3}(\Theta)=\sum_{\ell=2}^{2 N-1}\left(\alpha_{2}^{\ell}-\alpha_{3}^{\ell}\right) P_{\ell}^{2,-2}(\cos \Theta)
\\
a_{4}(\Theta) &=\sum_{\ell=0}^{2 N-1} \alpha_{4}^{l} P_{\ell}^{0,0}(\cos \Theta)
\\
b_{1}(\Theta) &=\sum_{\ell=2}^{2 N-1} \beta_{1}^{\ell} P_{\ell}^{0,2}(\cos \Theta)
\\
b_{2}(\Theta) &=\sum_{\ell=2}^{2 N-1} \beta_{2}^{\ell} P_{\ell}^{0,2}(\cos \Theta)
\end{aligned} a 1 ( Θ ) = ℓ = 0 ∑ 2 N − 1 α 1 ℓ P ℓ 0 , 0 ( cos Θ ) a 2 ( Θ ) + a 3 ( Θ ) = ℓ = 2 ∑ 2 N − 1 ( α 2 ℓ + α 3 ℓ ) P ℓ 2 , 2 ( cos Θ ) a 2 ( Θ ) − a 3 ( Θ ) = ℓ = 2 ∑ 2 N − 1 ( α 2 ℓ − α 3 ℓ ) P ℓ 2 , − 2 ( cos Θ ) a 4 ( Θ ) b 1 ( Θ ) b 2 ( Θ ) = ℓ = 0 ∑ 2 N − 1 α 4 l P ℓ 0 , 0 ( cos Θ ) = ℓ = 2 ∑ 2 N − 1 β 1 ℓ P ℓ 0 , 2 ( cos Θ ) = ℓ = 2 ∑ 2 N − 1 β 2 ℓ P ℓ 0 , 2 ( cos Θ ) The general form of Stokes scattering matrix Fs (which is the ensemble-averaged Mueller matrix averaging over a small volume containing an ensemble of particles) is of the form:
F S ( Θ ) = ( a 1 ( Θ ) b 1 ( Θ ) 0 0 b 1 ( Θ ) a 2 ( Θ ) 0 0 0 0 a 3 ( Θ ) b 2 ( Θ ) 0 0 − b 2 ( Θ ) a 4 ( Θ ) ) \mathbf{F}_{S}(\Theta)=\left(\begin{array}{cccc}{a_{1}(\Theta)} & {b_{1}(\Theta)} & {0} & {0} \\ {b_{1}(\Theta)} & {a_{2}(\Theta)} & {0} & {0} \\ {0} & {0} & {a_{3}(\Theta)} & {b_{2}(\Theta)} \\ {0} & {0} & {-b_{2}(\Theta)} & {a_{4}(\Theta)}\end{array}\right) F S ( Θ ) = a 1 ( Θ ) b 1 ( Θ ) 0 0 b 1 ( Θ ) a 2 ( Θ ) 0 0 0 0 a 3 ( Θ ) − b 2 ( Θ ) 0 0 b 2 ( Θ ) a 4 ( Θ ) Note that there are six independent elements for non-spherical particles.
Copy for i = 1 : 1 % 1 : numwl
data2 (:, :, i) = rawdata2 (( 1 + nmom * (i - 1 ):nmom * i), 1 :end) ;
alpha1 (:, i, 2 ) = data2 (:, 1 , i) ;
alpha2 (:, i, 2 ) = data2 (:, 2 , i) ;
alpha3 (:, i, 2 ) = data2 (:, 3 , i) ;
alpha4 (:, i, 2 ) = data2 (:, 4 , i) ;
beta1 (:, i, 2 ) = data2 (:, 5 , i) ;
beta2 (:, i, 2 ) = data2 (:, 6 , i) ;
a1 (:, i, 1 ) = alpha1 (:,i, 2 ) ' * p00; % E q.68
a4 (:, i, 1 ) = alpha4 (:,i, 2 ) ' * p00; % E q.71
b1 (:, i, 1 ) = beta1 (:,i, 2 ) ' * p02; % E q.72
b2 (:, i, 1 ) = beta2 (:,i, 2 ) ' * p02; % E q.73
a2 (:, i, 1 ) = .5 * (( alpha2 (:,i, 2 ) + alpha3 (:,i, 2 ) ) ' * p22 + (alpha2(:,i, 2) - alpha3(:,i, 2))' * p2n2); % Eq . 69 + 70
a3 (:, i, 1 ) = .5 * (( alpha2 (:,i, 2 ) + alpha3 (:,i, 2 ) ) ' * p22 - (alpha2(:,i, 2) - alpha3(:,i, 2))' * p2n2); % Eq . 69 + 70
end
If we want to study spherical particles, there are four independent components, a 1 ( Θ ) , a 3 ( Θ ) , b 1 ( Θ ) , b 2 ( Θ ) a_{1}(\Theta), a_{3}(\Theta), b_{1}(\Theta), b_{2}(\Theta) a 1 ( Θ ) , a 3 ( Θ ) , b 1 ( Θ ) , b 2 ( Θ ) , given a 2 ( Θ ) = a 1 ( Θ ) , a 4 ( Θ ) = a 1 ( Θ ) . a_{2}(\Theta)=a_{1}(\Theta), a_{4}(\Theta)=a_{1}(\Theta). a 2 ( Θ ) = a 1 ( Θ ) , a 4 ( Θ ) = a 1 ( Θ ) .
The code should be adjusted as follows
F S ( Θ ) = ( a 1 ( Θ ) b 1 ( Θ ) 0 0 b 1 ( Θ ) a 1 ( Θ ) 0 0 0 0 a 3 ( Θ ) b 2 ( Θ ) 0 0 − b 2 ( Θ ) a 3 ( Θ ) ) \mathbf{F}_{S}(\Theta)=\left(\begin{array}{cccc}{a_{1}(\Theta)} & {b_{1}(\Theta)} & {0} & {0} \\ {b_{1}(\Theta)} & {a_{1}(\Theta)} & {0} & {0} \\ {0} & {0} & {a_{3}(\Theta)} & {b_{2}(\Theta)} \\ {0} & {0} & {-b_{2}(\Theta)} & {a_{3}(\Theta)}\end{array}\right) F S ( Θ ) = a 1 ( Θ ) b 1 ( Θ ) 0 0 b 1 ( Θ ) a 1 ( Θ ) 0 0 0 0 a 3 ( Θ ) − b 2 ( Θ ) 0 0 b 2 ( Θ ) a 3 ( Θ )
Copy for i = 1 : 1 % 1 : numwl
data2 (:, :, i) = rawdata2 (( 1 + nmom * (i - 1 ):nmom * i), 1 :end) ;
alpha1 (:, i, 2 ) = data2 (:, 1 , i) ;
alpha2 (:, i, 2 ) = data2 (:, 2 , i) ;
alpha3 (:, i, 2 ) = data2 (:, 3 , i) ;
alpha4 (:, i, 2 ) = data2 (:, 4 , i) ;
beta1 (:, i, 2 ) = data2 (:, 5 , i) ;
beta2 (:, i, 2 ) = data2 (:, 6 , i) ;
a1 (:, i, 1 ) = alpha1 (:,i, 2 ) ' * p00; % E q.68
a4 (:, i, 1 ) = alpha4 (:,i, 2 ) ' * p00; % E q.71
b1 (:, i, 1 ) = beta1 (:,i, 2 ) ' * p02; % E q.72
b2 (:, i, 1 ) = beta2 (:,i, 2 ) ' * p02; % E q.73
a2 (:, i, 1 ) = a1 (:,i, 1 )
a3 (:, i, 1 ) = a4 (:,i, 1 )
end
Note:
In here, a more precise way to do it is to output the a1 to a4 and b1, b2 directly from the mie code. The method above, to compute them from alpha1~alpha4 and beta1 beta2 is actually taking a detour.
So far, we have calculated the scattering matrix F S \mathbf{F}_{S} F S . The phase matrix P S \mathbf{P}_{S} P S is related to the scattering matrix by P S ( u ′ , ϕ ′ , u , ϕ ) = R S ( π − σ 2 ) F S ( Θ ) R S ( − σ 1 ) \mathbf{P}_{S}\left(u^{\prime}, \phi^{\prime}, u, \phi\right)=\mathbf{R}_{S}\left(\pi-\sigma_{2}\right) \mathbf{F}_{S}(\Theta) \mathbf{R}_{S}\left(-\sigma_{1}\right) P S ( u ′ , ϕ ′ , u , ϕ ) = R S ( π − σ 2 ) F S ( Θ ) R S ( − σ 1 ) . R S \mathbf{R}_{S} R S is a rotation matrix used to rotate reference planes, and it transforms phase matrix from the scattering plane to local meridian plane of reference.
R S ( η ) = [ 1 0 0 0 0 cos ( 2 η ) − sin ( 2 η ) 0 0 sin ( 2 η ) cos ( 2 η ) 0 0 0 0 1 ] \mathbf{R}_{S}(\eta)=\left[\begin{array}{cccc}{1} & {0} & {0} & {0} \\ {0} & {\cos (2 \eta)} & {-\sin (2 \eta)} & {0} \\ {0} & {\sin (2 \eta)} & {\cos (2 \eta)} & {0} \\ {0} & {0} & {0} & {1}\end{array}\right] R S ( η ) = 1 0 0 0 0 cos ( 2 η ) sin ( 2 η ) 0 0 − sin ( 2 η ) cos ( 2 η ) 0 0 0 0 1 Then use P C = D − 1 P S D \mathbf{P}_{C}=\mathbf{D}^{-1} \mathbf{P}_{S} \mathbf{D} P C = D − 1 P S D (line 10
in the following code snippet).
F C ( Θ ) = D − 1 F S ( Θ ) D \mathbf{F}_{C}(\Theta)=\mathbf{D}^{-1} \mathbf{F}_{S}(\Theta) \mathbf{D} F C ( Θ ) = D − 1 F S ( Θ ) D , where F C ( Θ ) \mathbf{F}_{C}(\Theta) F C ( Θ ) is the Chandrasekhar's Stocks vector representation.
Another way to find P C \mathbf{P}_{C} P C is by first finding the transformed rotation matrix elements R ~ S ( π − σ 2 ) \tilde{\mathbf{R}}_{S}\left(\pi-\sigma_{2}\right) R ~ S ( π − σ 2 ) and R ~ S ( − σ 1 ) \tilde{\mathbf{R}}_{S}\left(-\sigma_{1}\right) R ~ S ( − σ 1 ) , and P C = R ~ S ( π − σ 2 ) P S R ~ S ( − σ 1 ) \mathbf{P}_{C}=\tilde{\mathbf{R}}_{S} (\pi-\sigma_{2})\mathbf{P}_{S} \tilde{\mathbf{R}}_{S}(-\sigma_{1}) P C = R ~ S ( π − σ 2 ) P S R ~ S ( − σ 1 ) .
The radiative transfer equitation for diffuse polarized radiation, described in terms of the Stokes equations is given by
μ d I ⃗ ( τ , μ , ϕ ) d τ = I ⃗ ( τ , μ , ϕ ) − a ( τ ) 4 π ∫ 0 2 π d ϕ ′ ∫ − 1 1 d μ ′ P ⃗ ( τ , μ , ϕ ; μ ′ , ϕ ′ ) I ⃗ ( τ , μ ′ , ϕ ′ ) + S ⃗ ( τ , μ , ϕ ) \mu \frac{d \vec{I}(\tau, \mu, \phi)}{d \tau}=\vec{I}(\tau, \mu, \phi)-\frac{a(\tau)}{4 \pi} \int_{0}^{2 \pi} d \phi^{\prime} \int_{-1}^{1} d \mu^{\prime} \vec{P}\left(\tau, \mu, \phi ; \mu^{\prime}, \phi^{\prime}\right) \vec{I}\left(\tau, \mu^{\prime}, \phi^{\prime}\right)+\vec{S}(\tau, \mu, \phi) μ d τ d I ( τ , μ , ϕ ) = I ( τ , μ , ϕ ) − 4 π a ( τ ) ∫ 0 2 π d ϕ ′ ∫ − 1 1 d μ ′ P ( τ , μ , ϕ ; μ ′ , ϕ ′ ) I ( τ , μ ′ , ϕ ′ ) + S ( τ , μ , ϕ )
Ignore the multiple-scattering term, we have μ d I ⃗ ( τ , μ , ϕ ) d τ = I ⃗ ( τ , μ , ϕ ) + S ⃗ ( τ , μ , ϕ ) \mu \frac{d \vec{I}(\tau, \mu, \phi)}{d \tau}=\vec{I}(\tau, \mu, \phi)+\vec{S}(\tau, \mu, \phi) μ d τ d I ( τ , μ , ϕ ) = I ( τ , μ , ϕ ) + S ( τ , μ , ϕ )
The source term is defined as S ⃗ ( τ , μ , ϕ ) = a ( τ ) F s 4 π P ⃗ ( μ ′ , ϕ ′ ; μ , ϕ ) e − τ / μ 0 \vec{S}(\tau, \mu, \phi)=\frac{a(\tau) F^{s}}{4 \pi} \vec{P}\left(\mu^{\prime}, \phi^{\prime} ; \mu, \phi\right) e^{-\tau / \mu_{0}} S ( τ , μ , ϕ ) = 4 π a ( τ ) F s P ( μ ′ , ϕ ′ ; μ , ϕ ) e − τ / μ 0
The diffused intensity in upward direction can be derived as I ⃗ d + ( τ , μ , ϕ ) = a ( τ ) μ 0 F s 4 π ( μ + μ 0 ) P ⃗ ( μ ′ , ϕ ′ ; μ , ϕ ) [ e − τ / μ 0 − e − [ ( τ ∗ − τ ) / μ + τ ∗ / μ 0 ] ] \vec{I}_{d}^{+}(\tau, \mu, \phi)=\frac{a(\tau) \mu_{0} F^{s}}{4 \pi\left(\mu+\mu_{0}\right)} \vec{P}\left(\mu^{\prime}, \phi^{\prime} ; \mu, \phi\right)\left[e^{-\tau / \mu_{0}}-e^{-\left[\left(\tau^{*}-\tau\right) / \mu+\tau^{*} / \mu_{0}\right]}\right] I d + ( τ , μ , ϕ ) = 4 π ( μ + μ 0 ) a ( τ ) μ 0 F s P ( μ ′ , ϕ ′ ; μ , ϕ ) [ e − τ / μ 0 − e − [ ( τ ∗ − τ ) / μ + τ ∗ / μ 0 ] ]
For the intensity at the top of the layer ( τ = 0 \tau=0 τ = 0 ), the above equation becomes
I ⃗ d + ( 0 , μ , ϕ ) = a ( τ ) μ 0 F s 4 π ( μ + μ 0 ) P ⃗ ( μ ′ , ϕ ′ ; μ , ϕ ) [ 1 − e − ( τ ∗ / μ + τ ∗ / μ 0 ) ] \vec{I}_{d}^{+}(0, \mu, \phi)=\frac{a(\tau) \mu_{0} F^{s}}{4 \pi\left(\mu+\mu_{0}\right)} \vec{P}\left(\mu^{\prime}, \phi^{\prime} ; \mu, \phi\right)\left[1-e^{-\left(\tau^{*} / \mu+\tau^{*} / \mu_{0}\right)}\right] I d + ( 0 , μ , ϕ ) = 4 π ( μ + μ 0 ) a ( τ ) μ 0 F s P ( μ ′ , ϕ ′ ; μ , ϕ ) [ 1 − e − ( τ ∗ / μ + τ ∗ / μ 0 ) ] Isolate the Azimuthal dependence, we get the Chandraskhar's representation of I ⃗ d + ( τ , μ , ϕ ) \vec{I}_{d}^{+}(\tau, \mu, \phi) I d + ( τ , μ , ϕ )
I ( τ , u , ϕ ) = ∑ m = 0 2 N − 1 { I c m ( τ , u ) cos m ( ϕ 0 − ϕ ) + I s m ( τ , u ) sin m ( ϕ 0 − ϕ ) } Q δ ( τ , u , ϕ ) = ∑ m = 0 2 N − 1 { Q c δ m ( τ , u ) cos m ( ϕ 0 − ϕ ) + Q s δ m ( τ , u ) sin m ( ϕ 0 − ϕ ) } \begin{aligned} \mathbf{I}(\tau, u, \phi)=& \sum_{m=0}^{2 N-1}\left\{\mathbf{I}_{c}^{m}(\tau, u) \cos m\left(\phi_{0}-\phi\right)+\mathbf{I}_{s}^{m}(\tau, u) \sin m\left(\phi_{0}-\phi\right)\right\} \\ \mathbf{Q}_{\delta}(\tau, u, \phi)=& \sum_{m=0}^{2 N-1}\left\{\mathbf{Q}_{c \delta}^{m}(\tau, u) \cos m\left(\phi_{0}-\phi\right)+\mathbf{Q}_{s \delta}^{m}(\tau, u) \sin m\left(\phi_{0}-\phi\right)\right\} \end{aligned} I ( τ , u , ϕ ) = Q δ ( τ , u , ϕ ) = m = 0 ∑ 2 N − 1 { I c m ( τ , u ) cos m ( ϕ 0 − ϕ ) + I s m ( τ , u ) sin m ( ϕ 0 − ϕ ) } m = 0 ∑ 2 N − 1 { Q cδ m ( τ , u ) cos m ( ϕ 0 − ϕ ) + Q sδ m ( τ , u ) sin m ( ϕ 0 − ϕ ) } As for the Stocks representation, we just need to read out the I ⃗ d + ( 0 , μ , ϕ ) \vec{I}_{d}^{+}(0, \mu, \phi) I d + ( 0 , μ , ϕ ) calculated using the equation from the above.
I C = [ I ℓ , I r , U , V ] T = I S = [ I ∥ , I ⊥ , U , V ] T \mathbf{I}_{C}=\left[I_{\ell}, I_{r}, U, V\right]^{T}=\mathbf{I}_{S}=\left[I_{ \|}, I_{\perp}, U, V\right]^{T} I C = [ I ℓ , I r , U , V ] T = I S = [ I ∥ , I ⊥ , U , V ] T
Copy for j = 1 : length (phi)
for i = 1 : length (theta)
Fs(:,:,(j-1)*181+i) = [a1(i,1), b1(i,1), 0, 0; b1(i,1), a2(i,1), 0, 0; 0, 0, a3(i,1), b2(i,1); 0, 0, -b2(i,1), a4(i,1)];
[ Rs1 (:,:,(j - 1 ) * 181 + i), Rs2 (:,:,(j - 1 ) * 181 + i) ] = Rs (mup, ctheta (i), cTheta (i)) ;
Fc (:,:,(j - 1 ) * 181 + i) = D ^- 1 * Fs (:,:,(j - 1 ) * 181 + i) * D;
Ps (:,:,(j - 1 ) * 181 + i) = Rs2 (:,:,(j - 1 ) * 181 + i) * Fs (:,:,(j - 1 ) * 181 + i) * Rs1 (:,:,(j - 1 ) * 181 + i) ;
Pc (:,:,(j - 1 ) * 181 + i) = D ^- 1 * Ps (:,:,(j - 1 ) * 181 + i) * D;
Rs1_1 (:,:,(j - 1 ) * 181 + i) = D ^- 1 * Rs1 (:,:,(j - 1 ) * 181 + i) * D;
Rs2_1 (:,:,(j - 1 ) * 181 + i) = D ^- 1 * Rs2 (:,:,(j - 1 ) * 181 + i) * D;
Pc_1 (:,:,(j - 1 ) * 181 + i) = Rs2_1 (:,:,(j - 1 ) * 181 + i) * Fc (:,:,(j - 1 ) * 181 + i) * Rs1_1 (:,:,(j - 1 ) * 181 + i) ;
Id (:,i,j) = a * mup / 4 / pi / ( abs ( ctheta (i)) + mup) * ( 1 - exp ( - (tau / abs ( ctheta (i)) + tau / mup)) ) * Pc (:,:,(j - 1 ) * 181 + i) * F;
Im (j,i) = 1 * ( real ( Id ( 1 ,i,j)) + real ( Id ( 2 ,i,j)) );
Qm (j,i) = 1 * ( real ( Id ( 1 ,i,j)) - real ( Id ( 2 ,i,j)) );
Il (j,i) = real ( Id ( 1 ,i,j)) ;
Ir (j,i) = real ( Id ( 2 ,i,j)) ;
U (j,i) = real ( Id ( 3 ,i,j)) ;
V (j,i) = real ( Id ( 4 ,i,j)) ;
end
```
some codes to plot the graphs
```
end
Now it's time to scale it to two-slab and multi-slab cases.
Single Multi-layer Slab
For a multilayered slab the corresponding solution is
I p + ( τ , μ , ϕ ) = μ 0 ( μ 0 + μ ) ∑ n = p L { X n + ( μ , ϕ ) × [ e − [ τ n − 1 / μ 0 + ( τ n − 1 − τ ) / μ ] − e − [ τ n / μ 0 + ( τ n − τ ) / μ ] ] } \begin{aligned} \mathbf{I}_{p}^{+}(\tau, \mu, \phi)=& \frac{\mu_{0}}{\left(\mu_{0}+\mu\right)} \sum_{n=p}^{L}\left\{\mathbf{X}_{n}^{+}(\mu, \phi)\right.\\ &\left. \times\left[e^{-\left[\tau_{n-1} / \mu_{0}+\left(\tau_{n-1}-\tau\right) / \mu\right]}-e^{-\left[\tau_{n} / \mu_{0}+\left(\tau_{n}-\tau\right) / \mu\right]}\right]\right\} \end{aligned} I p + ( τ , μ , ϕ ) = ( μ 0 + μ ) μ 0 n = p ∑ L { X n + ( μ , ϕ ) × [ e − [ τ n − 1 / μ 0 + ( τ n − 1 − τ ) / μ ] − e − [ τ n / μ 0 + ( τ n − τ ) / μ ] ] } with τ n − 1 \tau_{n-1} τ n − 1 replaced by τ \tau τ for n=p. p is the layer at which level that we are trying to evaluate, τ p \tau_{p} τ p is the optical depth from the top of the slab to the p-th layer, and n is the total number of layer.
Single, Two-layer slab
τ \tau τ is the depth measured from the top slab to any layer p. The subscript numbers get larger as more layers are accumulated downwards.
As an example, for a 2 layer slab, with τ 1 = 0.0025 , τ 2 = 0.005 , and we are evaluating an optical depth at τ = 0.0024 , which means p = 1 , the equations are \tau_{1}=0.0025, \tau_{2}=0.005, \text{and we are evaluating an optical depth at }\tau=0.0024, \text{which means }p=1, \text{the equations are} τ 1 = 0.0025 , τ 2 = 0.005 , and we are evaluating an optical depth at τ = 0.0024 , which means p = 1 , the equations are
I 1 + = μ 0 ( μ 0 + μ ) X 1 ( e − τ μ 0 − e − ( τ 1 μ 0 + τ 1 − τ μ ) ) μ 0 ( μ 0 + μ ) + X 2 ( e − ( τ 1 μ 0 + τ 1 − τ μ ) − e − ( τ 2 μ 0 + τ 2 − τ μ ) ) \begin{array}{l}{I_{1}^{+}=\frac{\mu_{0}}{\left(\mu_{0}+\mu\right)} X_{1}\left(e^{-\frac{\tau}{\mu{0}}}-e^{-\left(\frac{\tau_{1}}{\mu_{0}}+\frac{\tau_{1}-\tau}{\mu}\right)}\right)} \\ \frac{\mu_{0}}{\left(\mu_{0}+\mu\right)} {+X_{2}\left(e^{-\left(\frac{\tau_{1}}{\mu_{0}}+\frac{\tau_{1}-\tau}{\mu}\right)}-e^{-\left(\frac{\tau_{2}}{\mu_{0}}+\frac{\tau_{2}-\tau}{\mu}\right)}\right)} \end{array} I 1 + = ( μ 0 + μ ) μ 0 X 1 ( e − μ 0 τ − e − ( μ 0 τ 1 + μ τ 1 − τ ) ) ( μ 0 + μ ) μ 0 + X 2 ( e − ( μ 0 τ 1 + μ τ 1 − τ ) − e − ( μ 0 τ 2 + μ τ 2 − τ ) ) If evaluate on the bottom layer, say τ = 0.0026 , which means p = 2 \tau=0.0026, \text{which means }p=2 τ = 0.0026 , which means p = 2
I 2 + = μ 0 ( μ 0 + μ ) X 2 ( e − τ μ 0 − e − ( τ 2 μ 0 + τ 2 − τ μ ) ) I_{2}^{+}=\frac{\mu_{0}}{\left(\mu_{0}+\mu\right)} X_{2}\left(e^{-\frac{\tau}{\mu_{0}}}-e^{-\left(\frac{\tau_{2}}{\mu_{0}}+\frac{\tau_{2}-\tau}{\mu}\right)}\right) I 2 + = ( μ 0 + μ ) μ 0 X 2 ( e − μ 0 τ − e − ( μ 0 τ 2 + μ τ 2 − τ ) ) Therefore, to achieve this functionality, just need to
(1) Evaluate the range to know what p is
(2) Loop from p to n
The results are the same.
Similar results can be achieved