VERB_code_2.3
mu2pc.m
1 function pc = mu2pc (R, mu, alpha, Bf)
2  %%
3  % MU2PC calculates pc, which is momentum * speed of light (MeV)
4  %
5  % pc = mu2pc (R, mu, alpha, Bf)
6  %
7  % Input:
8  % R - radial distance, Re
9  % mu in MeV / Gauss
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  % p*c in MeV
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  pc = sqrt( 2.0 .* mu .* mc2 .* Bf ) ./ sin(alpha);
33 
34 end
functions for write log and support files. Functions are defined in Output.h and descripted in Output...
Definition: Output.cpp:15
double mu2pc(double L, double mu, double alpha)
Convert μ to pc.