VERB_code_2.3
pc2mu.m
1 function mu = pc2mu (R, pc, alpha, Bf)
2  %%
3  % PC2MU calculates mu in MeV / Gauss
4  %
5  % mu = pc2mu (R, pc, alpha, Bf)
6  %
7  % Input:
8  % R - radial distance, Re
9  % pc - momentum * speed of light, MeV
10  % alpha - pitch angle, rad
11  %% Bf - (optional) magnetic field in Gauss, if no field is specified, Dipole field is used
12  %
13  % Output:
14  % mu in MeV/Gauss
15 
16  % Author: Yuri Shprits
17  % Last change: 20014-01-01 by Dmitriy Subbotin
18  % Email: subbotin@ucla.edu
19  % The work was supported by:
20  % LANL grant 12-LR-235337, PI Yuri Shprits
21  % NASA grant NNX09AF51G, PI Yuri Shprits
22 
23  try
24  Bf;
25  catch
26  import B_Dip;
27  warning('VERB4D:DIPOLE', 'Using Dipole Field')
28  Bf = B_Dip(R);
29  end
30 
31  mc2 = 0.511;
32  mu = pc.^2 .* sin(alpha).^2 ./ (Bf * 2 * mc2);
33 
34 end
35 
functions for write log and support files. Functions are defined in Output.h and descripted in Output...
Definition: Output.cpp:15
double pc2mu(double L, double pc, double alpha)
Convert pc to μ.