Chapter 4
NUMERICAL METHODS
The system of differential equations given in Chapter 3 for the particle motion represent a well-posed initial value problem (IVP), which may be solved with standard numerical integration techniques. The spatial domain in which the equations are solved is described in the first section of this chapter. The second describes the numerical transformation between spherical polar and dipole coordinates. The third section explains the method of numerical integration. Auxiliary operations that augment the integration are described in the final section. The programs, subroutines and functions discussed in the chapter are included as a reference in Appendix D .
4.1
C
OMPUTATIONAL
D
OMAIN
The computational domain is specified by the numerical simulations performed by
Streltsov and Lotko [1997] and Streltsov et al . [1998]. Dipole coordinates are used to define a flux tube spanning 7 .
25
L
7 .
75 which is bounded by the northern and southern ionospheres each assumed to be located at approximately 320 kilometers above the Earth’s surface. These ionospheric boundaries are actually constant dipole surfaces, which approximate surfaces of constant radial distance at high latitudes. The curvilinear flux tube geometry shown in Figure 3-1 maps to the box grid illustrated in
Figure 4-1 by the relations of Section 3.1.
26
27
Title: grid.eps
Creator:
MATLAB, The Mathw orks , Inc .
Preview :
This EPS picture w as not saved w ith a preview included in it.
Comment:
This EPS picture w ill print to a
PostScript printer, but not to other ty pes of printers .
Figure 4-1 . Dipolar computational domain, shown in box grid orientation, illustrates the discretization along the L and
coordinate axes.
Streltsov and Lotko [1997] discretize the field-aligned coordinate,
, into 151 equally spaced points along a magnetic field line. The distance between parallel grid points, h
dμ , is constant. The largest value of h
, in equation (3.3), is found at the equator.
The box grid points [ Streltsov and Lotko , 1997; Streltsov et al ., 1998] in Figure 4-1 then appear closer together in the
L plane. Streltsov et al .
[1997] discretize in the transverse direction, L , with 211 grid points equally spaced points across the flux tube.
The fields are periodic in time; hence, it is sufficient to know, for the test-particle integration, the spatiotemporal dependence of the fields for one wave period only.
28
Streltsov and Lotko [1997] and Streltsov et al . [1998] discretize uniformly in time over one wave period. The third-harmonic FLR used in the test-particle calculations has a period of 20.067 seconds discretized into thirteen frames representing uniform time intervals of 1.5436 seconds.
4.2
C
OORDINATE
T
RANSFORMATION
Transformation between dipolar and spherical polar coordinates is required to evaluate the background magnetic field and to map the spherical coordinates ( r ,
θ
) onto the computational domain (
, L ). Section 3.1 defines the functions that map the dipolar coordinates onto the computational mesh intersections when the spherical polar coordinates are known. The reverse transformation, from dipolar to spherical is obtained by the numerical solution of the following fourth order polynomial equation, f
R
4
2
1
L
R
1
0 . 4.1
The root, R , is the dimensionless radial coordinate, r R
E
. Once R is known, the relationship
μ cos
θ
R
2
from (3.2) is employed to calculate the polar angle,
.
4.3
N UMERICAL I NTEGRATION
The ordinary differential equations (ODE) for the particle motion, in the coordinates
( L ,
) are first order in time and the ODE for the
coordinate component is second order in time. Specifying the initial particle position ( L
0
,
0
,
0
) along with the initial velocity, v
0
, and equatorial pitch angle,
0
, the system of ODE’s may be solved as an
IVP. Standard numerical solutions to well-posed IVP problems implemented here
29 include Runga-Kutta methods, built on Taylor polynomials in two variables and multistep methods. Their derivations are found in most standard books of numerical methods (e.g., see Burden and Faires [1993]).
The system of differential equations, defined in terms of the dipole coordinates, transform to the difference-equations, v
v
h
f ( L ,
)
j
1
j
v
j
1
t
μ j
1
μ j
μ d j
1
μ j p
1
t
v
L h
L
L j
1
L j
L j
1
t
v
φ h
j
1
j
j
1
t .
The
terms are approximated by Runga-Kutta method, to initialize the solution, and
Adams Fourth-Order Predictor-Corrector multi-step method for the duration. Two terms appear in the difference-equation for
, the change of position along the field line due to the drift velocity,
μ d j
1
t
, and the change in position from the parallel acceleration,
μ j p
1
t
, contributions from equations (2.8) and (2.9), respectively.
4.3.1
F
OURTH
O
RDER
R
UNGA
-K
UTTA
M
ETHOD
The Runga-Kutta fourth order scheme for an IVP solution was chosen as the basis of the model numerical integration. Advantages of Runga-Kutta methods include a high order of local truncation error associated with the Taylor methods and the elimination of computational evaluation of function derivatives. This is accomplished by
30 combining a number of intermediate values corresponding to the method order (i.e. four intermediate values for fourth order) to approximate the solution.
The solution for this model accommodates the second order differential equation for parallel acceleration and the m th -ordered system of IVP equations by solving them analogously to the single IVP. Burden and Faires [1993] describe a method comprised of a matrix solution, [ W ij
]. The m
n matrix represents the entire solution set for a system with m dependent variables at all n grid points. The four intermediate values of the RK4 method, which are functions of all the dependent variables, k
1 , i
through k
4 , i
, combine to form the approximate solution to u i
at time t j
.
4.3.2
A
DAMS
F
OURTH
-O
RDER
P
REDICTOR
-C
ORRECTOR
M
ETHOD
The predictor-corrector scheme used in the fourth-order integration, initialized with the approximations of each dependent variable from the previous four iterations, greatly reduces computation time and memory. After the first four time steps, the
Runga-Kutta fourth-order method is abandoned; the multi-step method predicts a value for the next time step using the previous approximations. This ‘prediction’ is incorporated into the approximation of a ‘correction’ for each dependent variable.
4.4
A
UXILIARY
P
ROCEDURES
The main algorithm was designed to perform general test-particle simulations with arbitrary electromagnetic wave-fields and differential equations of motion, provided both are defined in dipolar coordinates. This is accomplished without changing the
31 actual integration scheme by allowing the functions that represent the equations of motion to be passed into the integration scheme as a separate subroutine.
Consideration of correct units, coordinate systems and accurate field values rely on the following auxiliary subroutines and functions to manage the numerical integration.
4.4.1
F
IELD
I
NITIALIZATION AND
I
NTERPOLATION
The model by Streltsov et al.
[1998] gives normalized wave field values at all grid points and time intervals of the wave period. Each wave field is treated as a threedimensional matrix with the indices ( i , j , k ) corresponding to coordinates (
, L , t ).
Between grid points in space or time, the field values are evaluated by a linear interpolation scheme, with an error not exceeding an average of 0.005 percent when compared to known values (i.e. when two grid points are used to interpolate to a third between them). Because the test-particle model is allowed to run for an arbitrary amount of time and only one wave period of pre-computed field values was used, the overall simulation time is normalized to a corresponding time within the span of a single wave period.
Background magnetic field is evaluated functionally because it is specified as a known continuous function of the spatial coordinates. Functional evaluation gives better accuracy than specifying the background magnetic field on a grid and having to interpolate.
32
4.4.2
N ORMALIZATION P ARAMETERS
The three-dimensional matrices representing the electromagnetic fields and function evaluations of the differential equations are all normalized during initialization and, subsequently, their non-dimensional forms are utilized in the integration scheme.
The length and velocity parameters to which distances and velocities are normalized are,
R
E
6371 km and v
5930 km/s , the velocity of an 100 eV electron. The time
, electric field, E
, and magnetic field, B
, are defined in terms of
and v
;
τ
R
E v
, E
mv
2
eR
E
, B
E
v
.
Using these parameter values, the variables and constants in the simulation are rendered dimensionless, eliminating conversion errors. The system differential functions transform into the dimensionless forms, v
f ( L ,
μ
)
v h
L
v
L h
L
v h
φ
v
f ( L ,
μ
)
τ v
v
h
L
v
L
h
L
v
φ h
.
33