VERB_code_2.3
B_Dip.m
1 function B_mag = B_Dip(R, lambda, B0)
2  %%
3  % B_DIP calculates dipole magnetic field in equatorial plane
4  %
5  % Input:
6  % R - radial distance, Re
7  % lambda - latitude, rad (lambda = 0 if not specified)
8  % B0 - (optional) magnetic field at Earth's surface in Gauss
9  %
10  % Output:
11  % B_mag - magnetic field in Gauss
12 
13  % Author: Dmitriy Subbotin
14  % Email: subbotin@ucla.edu
15  % Last change: 20014-01-01 by Dmitriy Subbotin
16  % The work was supported by:
17  % LANL grant 12-LR-235337, PI Yuri Shprits
18  % NASA grant NNX09AF51G, PI Yuri Shprits
19 
20  if nargin < 2
21  lambda = 0;
22  end
23  if nargin < 3
24  B0 = 0.31;%2; %Gauss
25  end
26 
27  %B_r = -2 * B0 ./ (L.^3) .* sin(lambda);
28  %B_t = -B0 ./ (L.^3) .* cos(lambda);
29  B_mag = B0 ./ (R.^3) .* sqrt(1 + 3 * sin(lambda).^2) ./ cos(lambda).^6;
30 
31 end
32 
functions for write log and support files. Functions are defined in Output.h and descripted in Output...
Definition: Output.cpp:15