of 14
7/27/2019 EMTP simul(28)
1/14
352 Power systems electromagnetic transients simulation
RungeKutta (fourth-order):
x(t + t) = x(t) + t
16
k1 +13
k2 +13
k3 +16
k4
(C.4)
k1 = f(x(t),t)
k2 = f
x(t) +
t
2k1,x(t) +
t
2
k3 = f
x(t) +
t
2k2,x(t) +
t
2
k4 = f (x(t) + t k3,x(t) + t)
(C.5)
AdamsBashforth (third-order):
x(t + t) = x(t) + t
2312
f(x(t),t) 1612
f (x(t t),t t)
+ 512
f (x(t 2t),t 2t)
(C.6)
AdamsMoulton (fourth-order):
x(t + t) = x(t) + t
924
f (x(t+ t),t+ t) + 1924
f(x(t),t)
524 f (x(t t),t t) + 124 f (x(t 2t),t 2t)
(C.7)
The method proposed by Gear is based on the equation:
x(t + t ) =
ki=0
i x(t + (1 i)t) (C.8)
This method was modified by Shichman for circuit simulation using a variable time
step. The Gear second-order method is:
x(t + t) =4
3x(t)
1
3x(t t) +
2t
3f (x(t+ t),t+ t) (C.9)
Numerical integration can be considered a sampled approximation of continu-
ous integration, as depicted in Figure C.1. The properties of the sample-and-hold
(reconstruction) determine the characteristics of the numerical integration formula.
Due to the phase and magnitude errors in the process, compensation can be applied
to generate a new integration formula. Consideration of numerical integration from a
sample data viewpoint leads to the following tunable integration formula [4]:
yn+1 = yn + t(fn+1 + (1 )fn) (C.10)
where is the gain parameter, is the phase parameter and yn+1 represents the
y value at t + t.
7/27/2019 EMTP simul(28)
2/14
Numerical integration 353
s
1
s
Zero-order
hold
1
s
Continuous
Discrete approximation
x (s)
x (s)
x(Z) x(S) x(S) x(Z)
1 est
.
x (s) x (s).
x(t).
x(t+ t) x(t+ t) x(nt + t).
...
x (nt).
Sample Reconstruction Compensation SampleIntegration
e st
Figure C.1 Numerical integration from the sampled data viewpoint
Table C.1 Classical integration formulae as special cases of thetunable integrator
Integration Rule Formula
0 Forward Euler yn+1 = yn + tfn
1
2
Trapezoidal yn+1 = yn +t
2fn+1 + fn
1 Backward Euler yn+1 = yn + tfn+13
2AdamsBashforth 2nd order yn+1 = yn +
t
2
3fn+1 fn
Tunable yn+1 = yn + t
fn+1 + (1 )fn
If = 1 and = (1 + )/2 then the trapezoidal rule with damping is obtained
[5]. The selection of integer multiples of half for the phase parameter produces theclassical integration formulae shown in Table C.1. These formulae are actually the
same integrator, differing only in the amount of phase shift of the integrand.
With respect to the differential equation:
yn+1 = f ( y , t ) (C.11)
Table C.2 shows the various integration rules in the form of an integrator and
differentiator.
Using numerical integration substitution for the differential equations of an induc-
tor and a capacitor gives the Norton equivalent values shown in Tables C.3 and C.4
respectively.
7/27/2019 EMTP simul(28)
3/14
7/27/2019 EMTP simul(28)
4/14
Numerical integration 355
Table C.4 Linear capacitor
Integration rule Geff IHistory
Trapezoidal2C
t
2C
tvn in
Backward EulerC
t
C
tvn
Gear 2nd order3C
2t
2C
tvn +
C
2tvn1
TunableC
t
(1 y)
yin
C
+ vn
where O(t4) represents fourth and higher order terms. The derivative at n + 1 can
also be expressed as a Taylor series, i.e.
dyn+1
dt=
dyn
dt+ t
d2yn
dt2+
t2
2
d3yn
dt3+ O(t4) (C.13)
If equation C.12 is used in the trapezoidal rule then the trapezoidal estimate is:
yn+1 = yn +t
2
dyn
dt+
dyn+1
dt
= yn +t
2
dyn
dt+
t
2
dyn
dt+ t
d2yn
dt2+
t2
2
d3yn
dt3+ O(t4)
= yn + tdyn
dt+
t2
2
d2yn
dt2+
t3
4
d3yn
dt3+
t
2O(t4) (C.14)
The error caused in going from yn to yn+1 is:
n+1 = yn+1 yn+1 =t3
6
d3yn
dt3
t3
4
d3yn
dt3
t
2O(t4)
=t3
12
d3yn
dt3
t
2O(t4) =
t3
12
d3y
dt3
where tn tn+1.
The resulting error arises because the trapezoidal formula represents a truncation
of an exact Taylor series expansion, hence the term truncation error.
To illustrate this, consider a simple RC circuit where the voltage across the resistoris of interest, i.e.
vR(t) = RCdvC (t)
dt= RC
d(vS(t) RiR(t))
dt(C.15)
7/27/2019 EMTP simul(28)
5/14
356 Power systems electromagnetic transients simulation
Table C.5 Comparison of numerical integration algorithms(T = /10)
Step Exact F. Euler B. Euler Trapezoidal Gear second-order
1 45.2419 45.0000 45.4545 45.2381
2 40.9365 40.5000 41.3223 40.9297 40.9273
3 37.0409 36.4500 37.5657 37.0316 37.0211
4 33.5160 32.8050 34.1507 33.5048 33.4866
5 30.3265 29.5245 31.0461 30.3139 30.2891
Table C.6 Comparison of numerical integration algorithms (T = )
Step Exact F. Euler B. Euler Trapezoidal Gear second-order
1 18.3940 0.0000 25.0000 16.6667 18.3940
2 6.7668 0.0000 12.5000 5.5556 4.7152
3 2.4894 0.0000 6.2500 1.8519 0.0933
4 0.9158 0.0000 3.1250 0.6173 0.8684
5 0.3369 0.0000 1.5625 0.2058 0.7134
If the applied voltage is a step function at t = 0 then dvS(t)/dt = 0 and equation C.15
becomes:
vR (t) = RCdvR (t)
dt=
dvR (t)
dt(C.16)
The results for step lengths of/10 and (vs = 50 V) are shown in Tables C.5 and C.6
respectively. Gear second-order is a two-step method and hence the value at T is
required as initial condition.
For the trapezoidal rule the ratio (1 t/(2 ))/ (1 + t/(2 )) remains less than
1, so that the solution does tend to zero for any time step size. However for t > 2
it does so in an oscillatory manner and convergence may be very slow.
C.3 Stability of integration methods
Truncation error is a localised property (i.e. local to the present time point and time
step) whereas stability is a global property related to the growth or decay of errors
introduced at each time point and propagated to successive time points. Stability
depends on both the method and the problem.Since general stability analysis is difficult the normal approach is to compare the
stability of different methods for a single test equation, such as:
y = f ( y , t ) = y (C.17)
7/27/2019 EMTP simul(28)
6/14
Numerical integration 357
Table C.7 Stability region
Integration rule Formula Region of stability
Trapezoidal vR (t + t) =(1 t/(2 ))
(1 + t/(2 ))vR (t ) 0