(4. 3 7)
Using expression (4.37) the first element is written as expression (4.38) and the second element is written as being expression (4.39).
[-2.1667,1.9167]{U1 }
1.9167,-2.1667
u2[-2.1667,1.9167]{U2}
1.9167,-2.1667
u3 (4.38) (4.3 9)Directly adding the expressions for first and second elements results in what is known as the system matrix, combining the system matrix with the natural boundary conditions arising from the term on the right hand side of equation (4.24) (in which the test function w is equal to
1
at the first and last node, this can be verified by the reader) results in:-2.1667, 1.9167
, 0{ } �(O)
1.9167,
- 4.3333, 1.9167
:�
= 0o
1.9167 , 2.1667
u3 -'u(
l)
4.3. 1 : The finite element method -FEM
Substituting the values for the known Dirichlet boundary conditions (equations (4.2 1 ) and (4.22)) into the above equation gives the following matrix, equation (4.4 1 ).
I , 0 , 0
{UI} [
11 .9 1 67,-4.33 33,1 .9 1 67 u 2 = 01
o 0 , 1 u3 e
The above system can be written in the more compact form of equation (4.42).
Ku = F
(4.4 1 )
(4.42)
The solution u in equation (4.42 ) is calculated from the inversion of the system matrix
K
over the system vectorF
i.e.(4.43)
This results in the values of
u, = 1 , u2
= 1 .64 andu3 = el
• The actual solution at x= 0.5
is1 .65 ,
so the difference between the analytical and the numerical answer for this example is approximately 0.6 1 percent. The more elements that are used in the calculation the more accurate the final solution (as a general rule of thumb).The above discussion is somewhat over simplified; a good reference discussing the above points in detail is [ J 08]. It is possible to use functions other than polynomials that have higher degrees of continuity, such as Hermite polynomials [ 1 08]; however in this thesis only Co continuity elements are required (as seen form inspection of equations (4.69) and (4.70) in section 4.3.3), so this point will be discussed no further.
The above example used analytically calculated trial functions; this approach is cumbersome and rather limited in scope. A better, and widely accepted, approach is to use isometric elements [ 1 08], [ 1 2 1 ], in which the trial functions can be calculated numerically using Legendre-Gauss integration of Lagrange polynomials [ 1 08]. Isoparmetric elements are integrated in a normalised coordinate system (usually between the dimension less points of - 1 and 1 ), which has been derived from the physical coordinate system using a Jacobian. Isoparametric elements have great versatility in being able to represent curved surfaces and still give accurate results when deformed or compressed [ 1 08], [ 1 23]. There is a variation on the traditional finite elements, derived from Lagrange polynomials (which have internal nodes within the elements), known as Serendipity elements. These elements are particularly advantageous for high order trial
4.3 . 1: The finite element method -FEM
functions, because they only contain exterior nodes (nodes on elemental surfaces) reducing the computational memory and time required to obtain a solution compared to the traditional isoparametric elements.
For problems in the fmite element method that involve both a spatial and temporal dependence there are two techniques that can be used to fmd the transient response of a system, either the mode of superposition or a time marching scheme [ 1 08]. The mode of superposition uses eigenvalue analysis; this method is computation ally (very) expensive and is traditionally used in solving second order equations encountered in structural analysis [ 1 08]. A time marching scheme was chosen as the method of choice, because of its simplicity and ease of implementation. A time marching scheme relies on deriving recursion formulas which relate the solution at one instance of time
t
to the solution at a later timet + /j.t
, based on a finite time step/j.t .
In the Galerkin method the temporal domain is treated in the same manner as the spatial domain [ 1 08], [ 1 2 1 ] and the temporal derivatives are multipl ied by a trial function in much the same manner (with the same restrictions being placed upon the trial function as discussed previously). The only difference is that the sort after solution is in both time and space; this results in the following representation:Mu+Ku
=F
(4.44)10 equation (4.44)
M
is the temporal variation matrix (containing the integrated trial function and temporal derivative terms),K
is the system matrix, andF
is the system vector. The generalised form of a time marching scheme [ 1 08], obtained using a finite difference approximation, is given by equation (4.45) below:[eK + M Jut+1l1
=[
-(1 -e)K +
M Jut + (1 -B)F, + eF,+1l1
(4.45)The subscripts in equation (4.45) represent the solutions/matrices at a given point in time. Equation (4.45) represents a family of recurrence relationships; the particular algorithm chosen depends upon the value of
e
(a dimension less constant). The following algorithms areavailable: the forward difference method if
e
= 0 , the Crank-Nicolson method ife
=� ,
the2
Galerkin method (not to be confused with the Galerkin finite element method) if
e
=�
and the3
4.3. 1 :
1 .
-2 .
The finite element method -FEM
- - - -- -- e -=-1
I������)
- - -1
e = � (GALER K I N) SMOOTH 3 DECAY 6 = � (CRANK- SC I LLATORY N I COLSON) D ECAY e = 0 ( EU LER OSC I LLATORY GROWTH _ _ _ _ _ _ _ _J
Product of eigen value and time stepGraph 4. 6: Graph showing stability behaviour of recurrence formula, using eigenvalue analysis
[1 08J
The forward difference method is an explicit method (conditional ly stable), whose stability is dependent upon the size of the time step that is used; the other methods are implicit (unconditionally stable). Although the Crank-Nicolson method is a second order accurate scheme, giving the least error for any of the implicit schemes, the backwards difference method always gives a smooth decay rate. This allows the backwards difference method to be applied to very fast changing systems with a time step of any size without the concern of oscillations appearing in the solution, as might happen if one of the other implicit schemes were used. Finally, the finite element method will only produce a unique solution if the uniqueness theorem is satisfied [ 1 07], [ 1 1 2] . The uniqueness theorem guarantees that the problem will give a unique solution. A vector quantity will only be uniquely defined if both its curl and divergence are defined and either its Dirichlet or Flux boundary conditions (arising from the weak formulation) are satisfied on the boundaries. A scalar quantity is only uniquely defined if either its gradient or value is specified on the boundaries.
4.3.2: MaxweU's equations and boundary conditions
The mathematical formulas that describe the electromagnetic effects in a plasma accelerator system are those of Maxwell 's equations: Gauss' s law, Gauss 's law of magnetism, Faraday' s law of induction, and Ampere's law.
4.3.2: Maxwell's equations and boundary conditions
Gauss's law, equation (4.46), states that the total electric flux
D
through any closed surface must equal the net chargeq
inside that surface\1 · D = q
(4.46)The electric flux is defmed in terms of the electric field
E
and the total polarisation p by equation (4.47).(4.47)
Gauss's law in magnetism, equation (4.48), states that the net magnetic flux B through any
closed surface must equal zero.
\1 · B = O
(4.48)Faraday's law of induction, equation (4.49), states that the line integral of the electric field
E
through any closed path must equal the change in magnetic flux through any surface bound by that path.
aB
\1 x E = - -
at
(4.49)•
Ampere's law, equation (4.50) in which