VERB_code_2.2  2
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
variousFunctions.h
Go to the documentation of this file.
1 /**
2  * \file variousFunctions.h
3  * \brief Variouse functions defenition, see namespace VF for details
4  *
5  * \ref deprecated
6  *
7  * \author Developed by Yuri Shprits
8  */
9 
10 #include "../Matrix/Matrix.h"
11 #include "variousConstants.h"
12 
13 /**
14  * \namespace VF
15  * \brief Various functions
16  *
17  * This namespace presented in variousFunctions.h and variousFunctions.cpp.
18  * - α is equatorial pitch-angle
19  * - pc is momentum
20  * - L - L-shell <br>
21  * Also see (\\ref deprecated)
22  *
23  * \todo
24  * - VF::bounce_time_new find out is it relecevistic or not. And fix it!
25  * - VF::Y find out what is this function
26  */
27 namespace VF {
28 
29  /// \brief G-function
30  /// \param alpha - &alpha;
31  double G(double alpha);
32 
33 
34  /// \brief Loss cone calculations
35  /// \param L - L-shell
36  double alc(double L);
37 
38  /// \brief Function for bounce time
39  /// \param alpha - &alpha;
40  double T(double alpha);
41 
42  /// \brief Y(&alpha;) function
43  /// \param alpha - &alpha;
44  double Y(double alpha);
45 
46  /** \brief Interpolation f on specific energy.
47  * \param E - target E
48  * \param f1 - left f(E1)
49  * \param E1 - left E1
50  * \param f2 - right f(E2)
51  * \param E2 - right E2
52  */
53  double f_interp(double E, double f1, double E1, double f2, double E2);
54 
55  /** \brief Caltulating &mu;
56  * \param L - L-shell
57  * \param pc - momentum
58  * \param Alpha - &alpha; */
59  double mu_calc(double L, double pc, double Alpha);
60 
61  /** \brief Caltulating J*c
62  * \param L - L-shell
63  * \param pc - momentum
64  * \param Alpha - &alpha; */
65  double Jc_calc(double L, double pc, double Alpha);
66 
67  /// \brief Chorus density model
68  /// \param L - L-shell
69  double density(double L);
70 
71  //Matrix3D<double> density(Matrix3D<double> &L);
72 
73  /// \brief Simple maximum
74  /// \param v1 - first input double variable
75  /// \param v2 - second input double variable
76  double max(double v1, double v2);
77 
78  /// \brief Double to string.
79  /// \param n - convert this variable to string
80  string dtostr(double n);
81 
82  /// \brief Function determs is it right iteration for the next output.
83  /// \param iter - base iteration to check
84  /// \param d_iter - second iteration to check
85  bool check_time(int iter, int d_iter);
86 
87 
88  // --------------------------------------------------------------
89 
90  /// \brief Electrostatic radial diffusion coefficient
91  /// \param alpha - &alpha;
92  /// \param Ke - Kinetic energy
93  /// \param L - L-shell
94  /// \param Kp - Kp-Index
95  double Dfe (double alpha, double Ke, double L, double Kp);
96 
97  /// \brief Coulomb scattering electron lifetime
98  /// \param L - L-shell
99  /// \param energy - Energy
100  double Coulomb(double L,double energy);
101 
102  /// \brief Empirical electron lifetime
103  /// \param Kp - Kp-Index
104  /// \param L - L-shell
105  /// \param energy - Energy
106  double Precipitation(double Kp,double L,double energy);
107  // --------------------------------------------------------------
108 
109  /// \name Computation of dipole magnetic field
110  // --------------------------------------------------------------
111 
112  /// \brief Dipole magnetic field
113  /// \param Lparam - L-shell
114  double B (double Lparam);
115 
116  // \deprecated Function defined in DiffusionCoefficient.h
117  //double Df (double L, double Kp);
118 
119 
120  /// \name Converting pc to energy
121  // --------------------------------------------------------------
122 
123  /// \brief Computation of Kinetic energy from given momentum .
124  /// \param pc - momentum
125  double Kfunc(double pc);// , double mc2 = 0.511);
126 
127  /// \brief Computation of moumentum from Kinetic energy .
128  /// \param K - Energy (MeV)
129  double pfunc(double K);//, double mc2);
130 
131  /// \name function for bounce
132  // --------------------------------------------------------------
133 
134  /** \brief bounce time
135  * \param L - L-shell
136  * \param pc - momentum
137  * \param alpha - &alpha; */
138  double bounce_time_new(double L, double pc, double alpha);
139 
140  ///\name Specifying outer boundary
141  // --------------------------------------------------------------
142 
143  /** \brief Call various flux model of the outer boundary
144  * \param E7 - Energy in MeV at L=7
145  * \param J_L7_function - name of boundary flux function */
146  double Outer_Boundary_Flux_at_L7(double E7,string J_L7_function);
147 
148  /// \brief Outer boundary spectrum (accurate)
149  /// \param K - Energy
150  double J_L7_corrected (double K);
151 
152  /// \brief Outer boundary spectrum (old)
153  /// \param K - Energy
154  double J_L7_old (double K);
155 
156  /// \brief Interpolate spectrum
157  /// \param K - Energy
158  /// \param x1 - Left energy point
159  /// \param y1 - Left flux point
160  /// \param x2 - Right energy point
161  /// \param y2 - Right flux point
162  double J_L7 (double K, double x1, double y1, double x2, double y2);
163 
164  /// \brief Outer boundary spectrum (accurate with 0 end the end)
165  /// \param K - Energy
166  double J_L7_corrected_0 (double K);
167 
168 
169  /// \name Converting &mu; to pc
170  // --------------------------------------------------------------
171 
172  /** \brief Convert &mu; to pc
173  * \param L - L-shell
174  * \param mu - &mu;
175  * \param alpha - &alpha; */
176  double mu2pc (double L, double mu, double alpha);
177  /** \brief Convert pc to &mu;
178  * \param L - L-shell
179  * \param pc - momentum
180  * \param alpha - &alpha; */
181  double pc2mu (double L, double pc, double alpha);
182 }