1 function [J_L] = ElectronFlux(L,Kp,tau, varargin)
2 %ElectronFlux This
function uses the adiabatic conservation of mu to
3 %compute the electron flux as a
function of L.
5 % First, we know the electron flux J as a
function of energy at a fixed mu.
6 % Then, assuming the
PSD (phase space
density) profile is independent of
7 % mu, and J =
PSD*(electron momentum squared) as well as the fact that
8 % the electron momentum is related to mu, we can compute J as a
function
9 % of L. Ask Alexander Drozdov (adrozdov@ucla.edu)
for details on how to
10 % compute
this if stuck. We have used Section 3 of RBM 2004 paper on VERB
11 % code to inform
this code. See rbm.epss.ucla.edu
for link.
13 % L_normalised should be scalar. We ONLY want to reproduce figure 1 of
14 % RBM 2004 paper here, so
this function is designed explicitly
for that.
16 % Here, angle corresponds to 90 degrees in radians.
18 angle = 1.5707; %
this is at angle pi/2
20 L_norm = 7; % the value of L we wish to normalise at
23 % checks to see
if the array provided contains 7
24 error(
'Cannot find L == 7 in the L array');
29 % the phase space
density profile
for all L
31 PSD_prof = varargin{1};
34 PSD_norm = PSD_prof./PSD_prof(L == L_norm); %
PSD normalised at L_norm
36 mu_L =
pc2mu(L,
pfunc(1), angle); % mu
for every L at E = 1 MeV
38 E_7 =
Kfunc(
mu2pc(L_norm, mu_L, angle)); % energy
for every mu at L = 7
40 J_0 = 8222.6.*exp(-7.068.*E_7); % Flux at every L that corresponds to mu_L
42 pc_7 =
mu2pc(L_norm,mu_L,angle); % pc
for every mu at L = 7
44 pc_L =
mu2pc(L,mu_L,angle); % pc
for every mu at every L
46 J_L = (J_0./pc_7.^2).*PSD_norm.*(pc_L.^2); % desired profile
void steady_state(Matrix1D< double > &f, double tau, double Kp, int nx, Matrix1D< double > &L, double f_bnd_out, double f_bnd_in)
double mu2pc(double L, double mu, double alpha)
Convert μ to pc.
double pfunc(double K)
Computation of moumentum from Kinetic energy .
double pc2mu(double L, double pc, double alpha)
Convert pc to μ.
Phase Space Density class.
double density(double L)
Chorus density model.
double Kfunc(double pc)
Computation of Kinetic energy from given momentum .