NB. Case of slab symmetric about midplane. load '/your_path/MTss.ijs' NB. (matrix transforms for symmetric slab geometry) load '/your_path/s_and_p.ijs' load '/your_path/IQMss.ijs' load '/your_path/IQs.ijs' NB. Slab of thickness 2T=2; midplane is at tau=T NB. define tau grid: 1st point (after 0) is 0.01, NB. T=1 is last point, logarithmic spacing, 8 points per decade: tau=: tau_grid 0.01 8 1.0 NB. 18 points: 0 0.01 0.0133352 0.0177828... 0.562341 0.749894 1 NB. Example of solution for lambda=0.5 and parabolic B(tau): L0=. 1 MTss tau NB. get Lam, M & N transforms M0=. 3 MTss tau N0=. 5 MTss tau B=. 1-(tau-1)^2 NB. parabolic source term lam=. (#B)#0.5 NB. constant lambda 's p'=: (L0;M0;N0) s_and_p (lam;B) NB. solve for s & p load 'plot' NB. load J plotting package 'pensize 2' plot tau;>B;s;10*p NB. plot B, s and 10 p vs. tau NB. the above plot will get overwritten quickly NB. define a grid of mu (= cos(theta)) values: mu=: int01 40 I0=. IQMss tau;mu NB. get matrix for I(0,mu) 'I Q pol'=: (I0;mu) IQs s;p NB. evaluate emergent radiation NB. plot I(mu) and -10 times the polarization as function of mu 'pensize 2' plot mu;>I;_10*pol NB. tau1 = first optical depth point NB. npd = number of points/decade NB. T = Half-depth of slab tau_grid=: 3 : 0 'tau1 npd T'=: y T,~(i. +/t