VERB_code_2.2
2
|
Various functions. More...
Functions | |
double | alc (double L) |
Loss cone calculations. More... | |
double | T (double alpha) |
Function for bounce time. More... | |
double | G (double alpha) |
G-function. More... | |
double | Y (double alpha) |
Y(α) function. More... | |
double | Dfe (double alpha, double Ke, double L, double Kp) |
Electrostatic radial diffusion coefficient. More... | |
double | Coulomb (double L, double energy) |
Coulomb scattering electron lifetime. More... | |
double | Precipitation (double Kp, double L, double energy) |
Empirical electron lifetime. More... | |
double | Jc_calc (double L, double pc, double Alpha) |
Caltulating J*c. More... | |
double | f_interp (double E, double f1, double E1, double f2, double E2) |
Interpolation f on specific energy. More... | |
double | mu_calc (double L, double pc, double Alpha) |
Caltulating μ. More... | |
double | density (double L) |
Chorus density model. More... | |
double | max (double v1, double v2) |
Return maximum. More... | |
string | dtostr (double n) |
Convert double to string. More... | |
bool | check_time (int iter, int d_iter) |
Small routine for checking if it is right iteration for the next output. More... | |
function for bounce | |
double | bounce_time_new (double L, double pc, double alpha) |
bounce time More... | |
Computation of dipole magnetic field | |
double | B (double Lparam) |
Dipole magnetic field. More... | |
Specifying outer boundary | |
double | Outer_Boundary_Flux_at_L7 (double E7, string J_L7_function) |
Call various flux model of the outer boundary. More... | |
double | J_L7 (double K, double x1, double y1, double x2, double y2) |
Interpolate spectrum. More... | |
double | J_L7_corrected (double K) |
Outer boundary spectrum (accurate) More... | |
double | J_L7_corrected_0 (double K) |
Outer boundary spectrum (accurate with 0 end the end) More... | |
double | J_L7_old (double K) |
Outer boundary spectrum (old) More... | |
Converting pc to energy | |
double | pfunc (double K) |
Computation of moumentum from Kinetic energy . More... | |
double | Kfunc (double pc) |
Computation of Kinetic energy from given momentum . More... | |
Converting μ to pc | |
double | mu2pc (double L, double mu, double alpha) |
Convert μ to pc. More... | |
double | pc2mu (double L, double pc, double alpha) |
Convert pc to μ. More... | |
Various functions.
This namespace presented in variousFunctions.h and variousFunctions.cpp.
double VF::alc | ( | double | L) |
Loss cone calculations.
Loss cone in rad.
L | - L-shell |
Definition at line 23 of file variousFunctions.cpp.
double VF::T | ( | double | alpha) |
Function for bounce time.
T(α) - function, related to bounce time
[Orlova and Shprits, On the bounce-averaging of scattering rates and the calculation of bounce period ,2011]
alpha | - α |
Definition at line 32 of file variousFunctions.cpp.
double VF::G | ( | double | alpha) |
G-function.
This function used in Fokker-Plank equation. from Jacobian from mu;,J to alpha;, p and bounce avarage. G-function
alpha | - α |
Definition at line 40 of file variousFunctions.cpp.
References T().
double VF::bounce_time_new | ( | double | L, |
double | pc, | ||
double | alpha | ||
) |
double VF::Y | ( | double | alpha) |
Y(α) function.
Y(α) function. More accurate approximation.
alpha | - α |
Definition at line 58 of file variousFunctions.cpp.
double VF::B | ( | double | Lparam) |
Dipole magnetic field.
Computation of dipole magnetic field in Gauss.
Lparam | - L-shell |
Definition at line 72 of file variousFunctions.cpp.
double VF::Dfe | ( | double | alpha, |
double | Ke, | ||
double | L, | ||
double | Kp | ||
) |
Electrostatic radial diffusion coefficient.
-------------------------------------------------------------------------------—
Electrostatic radial diffusion coefficient [see Brautigam and Albert(2000),JGR]
-------------------------------------------------------------------------------—
This model seems to overestimate radial diffusion rate, so we need to scale down
by adjusting a parameter "scale_factor".
-------------------------------------------------------------------------------—
(1) Inputs : alpha in radian, Ke in MeV, L and Kp in dimensionless unit
(2) Outputs : DLLe in 1/day or Re^2/day
-------------------------------------------------------------------------------—
alpha | - α |
Ke | - Kinetic energy |
L | - L-shell |
Kp | - Kp-Index |
Definition at line 87 of file variousFunctions.cpp.
double VF::Coulomb | ( | double | L, |
double | energy | ||
) |
Coulomb scattering electron lifetime.
-----------------------------------------------------------------—
Coulomb scattering electron lifetime [Lyons and Thorne, 1973, JGR]
-----------------------------------------------------------------—
(1) Inputs : L in dimensionless, energy in MeV
(2) Outputs: tau in days
-----------------------------------------------------------------—
L | - L-shell |
energy | - Energy |
Definition at line 137 of file variousFunctions.cpp.
double VF::Precipitation | ( | double | Kp, |
double | L, | ||
double | energy | ||
) |
Empirical electron lifetime.
------------------------------------------------------------------—
Empirical electron lifetime related to the resonant scattering by
plasmaspheric hiss, lightining-generated whistlers
and VLF transmitter signals, which is valid only in the slot region
between 2.5 and Lpp (plasmapause location) [see Su et al, 2010, JGR]
------------------------------------------------------------------—
(1) Inputs : energy in MeV, Kp and L in dimensionless
(2) Outputs : tau in days
------------------------------------------------------------------—
This model is valid up to Lpp, so class "PSD::SourcesAndLosses" checks if input L is larger than Lpp or not. For L<2.5 , for L>=2.5
Kp | - Kp-Index |
L | - L-shell |
energy | - Energy |
Definition at line 168 of file variousFunctions.cpp.
double VF::Outer_Boundary_Flux_at_L7 | ( | double | E7, |
string | J_L7_function | ||
) |
Call various flux model of the outer boundary.
-----------------------------------------------------------------—
Subroutine to call various flux model of the outer boundary at L=7
-----------------------------------------------------------------—
(1) Inputs : EL - energy(MeV) at L=7
J_L7_function - name of boundary flux function
(2) Outputs : JL - flux at L=7
-----------------------------------------------------------------—
E7 | - Energy in MeV at L=7 |
J_L7_function | - name of boundary flux function |
Definition at line 188 of file variousFunctions.cpp.
References J_L7(), J_L7_corrected(), J_L7_corrected_0(), and J_L7_old().
double VF::pfunc | ( | double | K) |
Computation of moumentum from Kinetic energy .
Computation of moumentum from Kinetic energy.
K | - Energy (MeV) |
Definition at line 212 of file variousFunctions.cpp.
References VC::mc2.
double VF::Kfunc | ( | double | pc) |
Computation of Kinetic energy from given momentum .
Computation of Kinetic energy from given momentum.
pc | - momentum |
Definition at line 220 of file variousFunctions.cpp.
References VC::mc2.
double VF::J_L7 | ( | double | K, |
double | x1, | ||
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Interpolate spectrum.
Interpolate outer boundary. This function used by VF::J_L7_corrected, VF::J_L7_corrected_0 ... The output is interpolation of the initial spectrum for specific point.
K | - Energy |
x1 | - Left energy point |
y1 | - Left flux point |
x2 | - Right energy point |
y2 | - Right flux point |
Definition at line 228 of file variousFunctions.cpp.
References VC::exp.
double VF::J_L7_corrected | ( | double | K) |
Outer boundary spectrum (accurate)
Specifying outer boundary, more accurate function.
K | - Energy |
Definition at line 245 of file variousFunctions.cpp.
References J_L7().
double VF::J_L7_corrected_0 | ( | double | K) |
Outer boundary spectrum (accurate with 0 end the end)
Specifying outer boundary, more accurate function, zero at infinity
K | - Energy |
Definition at line 259 of file variousFunctions.cpp.
References J_L7(), and VC::zero_f.
double VF::J_L7_old | ( | double | K) |
Outer boundary spectrum (old)
old version
K | - Energy |
Definition at line 271 of file variousFunctions.cpp.
References VC::exp.
double VF::mu2pc | ( | double | L, |
double | mu, | ||
double | alpha | ||
) |
Convert μ to pc.
Calculating pc from L, μ, alpha.
L | - L-shell |
mu | - μ |
alpha | - α |
Definition at line 283 of file variousFunctions.cpp.
double VF::pc2mu | ( | double | L, |
double | pc, | ||
double | alpha | ||
) |
Convert pc to μ.
Calculating μ from L, pc, alpha.
L | - L-shell |
pc | - momentum |
alpha | - α |
Definition at line 292 of file variousFunctions.cpp.
double VF::Jc_calc | ( | double | L, |
double | pc, | ||
double | Alpha | ||
) |
Caltulating J*c.
Caltulating J*c from L, pc, α.
L | - L-shell |
pc | - momentum |
Alpha | - α |
Definition at line 301 of file variousFunctions.cpp.
References Y().
double VF::f_interp | ( | double | E, |
double | f1, | ||
double | E1, | ||
double | f2, | ||
double | E2 | ||
) |
Interpolation f on specific energy.
Getting f on specific energy. Linear interpolation of logarithm.
E | - target E |
f1 | - left f(E1) |
E1 | - left E1 |
f2 | - right f(E2) |
E2 | - right E2 |
Definition at line 313 of file variousFunctions.cpp.
References VC::exp.
double VF::mu_calc | ( | double | L, |
double | pc, | ||
double | Alpha | ||
) |
Caltulating μ.
Caltulating μ from L, pc, α.
L | - L-shell |
pc | - momentum |
Alpha | - α |
Definition at line 329 of file variousFunctions.cpp.
double VF::density | ( | double | L) |
Chorus density model.
Chorus density model? (deprecated?)
L | - L-shell |
Definition at line 337 of file variousFunctions.cpp.
double VF::max | ( | double | v1, |
double | v2 | ||
) |
Return maximum.
Simple maximum.
v1 | - first input double variable |
v2 | - second input double variable |
Definition at line 355 of file variousFunctions.cpp.
string VF::dtostr | ( | double | n) |
Convert double to string.
Double to string.
n | - convert this variable to string |
Definition at line 360 of file variousFunctions.cpp.
bool VF::check_time | ( | int | iter, |
int | d_iter | ||
) |
Small routine for checking if it is right iteration for the next output.
Function determs is it right iteration for the next output.
iter | - base iteration to check |
d_iter | - second iteration to check |
Definition at line 367 of file variousFunctions.cpp.