NB. Solve for Source function of two-level atom NB. Usage: Two_Level tau;B(tau);epsilon(tau) Two_Level=: monad define 'tau B eps'=. y n=. # dtau=: DEL tau B=. BIN B eta=. BIN (1-eps)%eps B%. (unit n)+ (eta%dtau)*MMs tau ) unit=: =@i. NB. unit n --> n x n unit matrix NB. Construct logarithmic grid over the interval [0,2T], NB. symmetric about central palne at tau=T. NB. tau1 <- first optical depth point, e.g. tau1=: 0.01 NB. npd <- number of points/decade, e.g. npd=: 5 NB. T <- Half-depth of slab, e.g. T=: 4 tau_grid2=: monad define 'tau1 npd T'=. y t=. T,~(i. +/t