Professional Documents
Culture Documents
Which can be combined with (2.19) to get a
difference derivative
ikx j 1 ikx j 1
ge ge
Dxu (2.22)
2D
Difference Derivatives in Space
Which leads to
D' x u
2D
g ik(x j D) ik(x j D)
e e
(2.23)
g ikx 1
e j e ikD e ikD
D 2
iu
D' x u sin(kD) (2.24)
D
Apply the first difference operator:
D 2
4 4
D u iuk 1
x O k D (2.25)
6
k 2 D2 d
D' x 1 4 4
O(k D ) (2.26)
6 dx
General Formulation of the Initial-Value
Problem
Time-like derivatives are different than space-like
Must specify an integration procedure on the time mesh
Can apply to any problem with a one-point boundary
condition
The initial-value problem is of fundamental
importance
General Formulation of the Initial-Value
Problem
Given a state vector, u(r, t ) R(r ), we have an initial
value equation that describes the state of the
system
du
dt
Lu (2.33)
Where L is in general some non-linear operator is
defined on the surface for all time
General Formulation of the Initial-Value
Problem
Generic initial value problem
Divide time into intervals
Specific points usually denoted with superscript
Integrate the equation in time in parallel with real
time of the computer
n
t Dt n
(2.39)
1
Figure 2.5. A time mesh. Initial-value problems are integrated over small
time increments tn
General Formulation of the Initial-Value
Problem
Integration relates the n and n+1 state vectors
t n1
u u Ludt
n 1 n
(2.40)
tn
T Dt , D u n
(2.47)
Truncation error
Arises from representation of continuous variable by
discrete points
Dependent on mesh intervals in time and space
Round-off error
Computer only stores a finite number of decimal places
Can round the smallest bit for a cumulative effect
Arithmetic on computer not exact
Modern computing power makes this less of a
problem
Stability of Scheme
t n1
Figure 2.6. The approximation to n f (u (t ), t )dt in the Euler method
t
(equation 2.65). The shaded region shows the approximation to the
integral under the curve.
Euler First-Order Method
Introduce an error
u n 1 n 1 u n n f u n
n , t n Dt (2.66)
f
f u n n , t n f u n , t n
u n
n O n (2.67)
f
n 1 n Dt n O n (2.68)
u n
So the amplification factor is
f
g 1 Dt (2.69)
u n
Euler First-Order Method
t n 2
Figure 2.8. The approximation to n f (u (t ), t )dt in the leapfrog method
t
(equations 2.81).
Leapfrog Method
at n 1 u n 1 u n 1 f u n , t n 2Dt
at n 2 u n 2 u n f u n 1 , t n 1 2Dt
(2.81)
Requires u0 and u1
Very sensitive to accuracy of u1
Can use sub-intervals to first t
Can also use high order expansion
Leapfrog Method
g 1
(2.84)
2
Let = i, then
g i 2
1
gg * 1 (for 1)
(2.85)
t n1
Figure 2.9. The approximation to t n f(u(t),t)dt in the two-step method
(equations 2.91, 2.92). The first step uses the Euler method to "time-
center" the integral at tn+1/2 (dotted region). The second step evaluates the
integral to second-order accuracy (shaded region)
Explicit Two-Step Method
u u f u
n 1 n
,t Dt n 1
(2.92) 2
n 1
2
u u n2 n
1
g 1 2
2
f
Where we assume that f
u
f
u
and u Dt
n 1/ 2 n n
2.0
Dt
f / u n (2.94)
Implicit Second-Order Method
t n1
Figure 2.10. The approximation to t n f (u (t ), t )dt in the implicit second-order
method (equation 2.95). A "time-average" for the function f is used.
Implicit Second-Order Method
f Dt
1
u n 2 (2.97)
g
f Dt
1
u n 1 2
Centered difference
f j 1 f j 1
Dx f j (A.1)
2D
Forward difference
f j 1 f j
D x f j (A.2)
D
Backward difference
f j f j 1
D x f j (A.3)
D
Numerical Integration
f ( x)dx f ( x)dx
xj 0
(A.4)
Apply forward differencing
D
D f f j
f j x j 1 dx
f ( x)dx
D
(A.5)
0
0
1 2 3 i -1 i i +1 NC
NG
i 1-Dx i+1
= 1
q
effective
shape of
particle
Dx with NGP
i i+1
Assigning Charge: Linear Interpolation
A better method is to use linear interpolation to
distribute charge to the two nearest grid points
Fractional charge is placed on grids i and i + 1
q
q(1-Dx)
qDx
Dx
particle
i i+1