Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Учебники / 0841558_16EA1_federico_milano_power_system_modelling_and_scripting

.pdf
Скачиваний:
72
Добавлен:
08.06.2015
Размер:
6.72 Mб
Скачать

198

where z = [xT , yT ]T and ϕ = [f T , gT ]T

a21 = 2

a31 = 48/25

c21

= 8

c31

= 372/25

c41

= 112/125

c42

= 54/125

b1 = 19/9

b2 = 0.5

a2x = 1

a3x = 3/5

8Time Domain Analysis

and the coe cients are:

a32 = 6/25

 

c32

= 12/5

 

c43

= 2/5

 

b3 = 25/108

b4 = 125/108

For this method, the convergence error is:

= max{abs(e1qˆ1 + e2qˆ2 + e3qˆ3 + e4qˆ4)}

(8.46)

where:

e1 = 17/54

e2 = 7/36

e3 = 0

e4 = 125/108

(8.47)

It is worth noting that (8.45) requires only one factorization of A(ci). Thus, the Rosenbrock’s formula is only slightly more computational demanding than the trapezoidal method.

8.4Numerical Integration Routine

This section describes a complete routine for numerical integrations. Only the implicit backward Euler’s and the trapezoidal methods are considered. However, the routine can be easily modified to take into account any other numerical method.

Figure 8.7 shows the flowchart for a generic implicit numerical method. The integration starts at a given initial point and at a given initial time. Then, for each time step, an inner Newton’s method is solved for (8.42). The inner loop stops if the required variable increment is below a toleranceor if the maximum number of iterations is reached. In the latter case, the step length Δt is decreased. If the inner loop does not converge and the step length Δt is decreased below a minimum threshold, than the simulation stops since a singularity has been likely encountered (this behavior is typical of a collapse point). Otherwise, the simulation goes on the following time step. The external loop stops if t ≥ tf , where tf is the desired final integration time, or if some other stop criterion is verified.

The numerical method is clearly the kernel of the whole routine but other important issues have to be taken into account, namely, (i) the initial condition, (i) how to update the step length Δt, (iii) how to define disturbances, and (iv) the criteria for stopping the simulation. The calculation of initial conditions is described in Subsection 9.1.1 of Chapter 9. Other issues are discussed in the following subsections.

8.4 Numerical Integration Routine

199

Power Flow &

Initial State Variables

 

t = t0

 

 

 

 

Evaluate initial

 

 

 

time step Δt

 

 

 

i = 0

 

 

 

 

i = i + 1

 

 

 

 

 

 

no

 

 

 

yes

 

 

i > imax

Reduce Δt

Δt < Δtmin

 

 

 

 

yes

 

Evaluate

 

 

 

 

 

 

END

 

disturbance

 

Singularity

 

 

 

 

 

 

 

 

likely

 

Evaluate system

 

 

 

equations & Jacobians

 

 

Compute

Integration

 

 

x and

y

method

 

 

 

no

 

 

 

no

 

 

 

 

| x(i)|, | y(i)| <

 

 

 

 

yes

 

 

 

Update x and y

Output

 

Update

no

 

yes

 

Stop Criterion

 

 

Δt

END

 

 

 

 

 

Fig. 8.7 Time domain integration flowchart

200

8 Time Domain Analysis

8.4.1Step Length

The step length Δt can be fixed or variable. Increasing the step length is useful for saving time if the numerical integration is going on “smoothly”, while decreasing the step length can be useful in the instants after the occurrence of a large disturbance (e.g., short-circuit or line outage).

Multi-stage explicit methods allow estimating the step length. A commonly used formula is:

Δt ← σ

Δt

(8.48)

|xˆ(t + Δt) − x(t + Δt)|

where σ [0.8, 0.9] is a safety factor and a given tolerance.

A-stable implicit methods are less sensitive to the step length. However, it can be useful to increase Δt if “nothing happens”. A heuristic method that has provided good results for the software package PSAT is as follows [195]. The main idea is to use the number of iterations of the inner Newton’s method used for solving (8.42) as a “measure” of the di culty that is facing the numerical method for obtaining the point at t = Δt. The rules are:

1.If the inner Newton’s method has not converged, the step length is defined as:

Δt ← 0.5Δt

(8.49)

Furthermore, if Δt < Δtmin, the routine stops since a singularity has been likely encountered.

2.If the iterations are more than 15, then the following step length is defined as:

Δt ← max{0.9Δt, Δtmin}

(8.50)

3. If the iterations are less than 10, then the following step length is defined as:

Δt ← min{1.3Δt, Δtmax}

(8.51)

4. During faults, the time step is defined as:

Δt ← min{Δt, 0.0025 s}

(8.52)

5. Otherwise the step length is not changed.

The minimum and maximum step lengths Δtmin and Δtmax are defined at the beginning of the simulation based on the eigenvalues of the system state matrix. In fact, the eigenvalues of the state matrix provide a valuable information on the time constants of the system, as follows:

Tk =

1

, k = 1, 2, . . . , nx

(8.53)

k |

 

 

 

where nx is the dynamic order of the system. The following script further develops this concept.

8.4 Numerical Integration Routine

201

Script 8.1 Computing the First Time Step

The following script provides some heuristics that are able to estimate the first step length, Δtmin and Δtmax and, in case of fixed step length, to evaluate if the step length chosen by the user is reasonable.

import system

from cvxopt.base import matrix

from cvxopt.umfpack import linsolve

def first time step():

"""compute first time step"""

# estimate the minimum time step if not system.DAE.nx:

freq = 1.0

elif system.DAE.nx == 1:

B = matrix(system.DAE.Gx) linsolve(system.DAE.Gy, B)

As = system.DAE.Fx - system.DAE.Fy*B freq = abs(As[0,0])

else:

freq = 20.0

if freq > system.Settings.freq:

freq = float(system.Settings.freq)

if not freq: freq = 20.0

# set the minimum time step

deltaT = abs(system.Settings.tf - system.Settings.t0) Tstep = 1/freq

system.Settings.deltatmax = min(5*Tstep, deltaT/100.0) system.Settings.deltat = min(Tstep, deltaT/100.0) system.Settings.deltatmin = min(Tstep/64, system.Settings.deltatmax/20) if system.Settings.fixt:

if system.Settings.tstep <= 0:

print ’Fixed time step is negative or zero’ print ’Automatic time step has been set’ system.Settings.fixt = False

elif system.Settings.tstep < system.Settings.deltatmin:

print ’Fixed time step is less than estimated minimum time step’ system.Settings.deltat = system.Settings.tstep

else:

system.Settings.deltat = system.Settings.tstep

return system.Settings.deltat

202

 

 

 

8 Time Domain Analysis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 8.8 Comparison between the backward Euler’s method and the implicit trapezoidal method for the IEEE 14-bus system

Example 8.7 Comparison of Time Domain Integration Methods

Figure 8.8 shows a comparison between the backward Euler’s method and the implicit trapezoidal method using a step length Δt = 0.01 s for the IEEE 14bus system. The simulation refers to the IEEE 14-bus system and is obtained by applying line 2-4 outage at t = 1 s. The backward Euler’s method damps oscillations more than the implicit trapezoidal method and, thus, requires a smaller time step to provide precise results.

Figure 8.9 shows a comparison of numerical integration results using the implicit trapezoidal method and di erent step lengths Δt, namely a fixed step length Δt = 0.01 s, a fixed step length Δt = 0.10 s and an adaptive step length as described above. The disturbance is the same as the one used for obtaining the results shown in Figure 8.8. As expected, since the implicit trapezoidal method is A-stable, results are relatively independent from the time step.

8.4.2Disturbances

In the classical transient stability analysis, whose object is to determine whether synchronous machines go out of step, disturbances of interest are essentially short-circuits and device outages (e.g., lines, generators or loads).

8.4 Numerical Integration Routine

203

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 8.9 Comparison of numerical integration results using di erent step lengths for the IEEE 14-bus system

These disturbances are so relevant that have to be handled by means of dedicated classes and functions. These are described in details in Sections 13.1 and 13.2, respectively, of Chapter 13.

Other perturbations, such as load ramps, are more relevant for long-term analysis and, thus, are less commonly included in transient stability packages. A particular case of load ramps is discussed in the following Section 8.6.

Generic disturbances are an issue for most transient stability packages. The main di culty is that, to be “generic”, the time domain integration routine has to be able to support a custom user-defined function. This is quite complicated for software packages built using a system programming language, since the user defined function has to be compiled within the package to work correctly. To overcome this issue, there are mainly three solutions:

1.To allow the user to apply only a predefined set of disturbances. Clearly this is not a solution, but just a way of overcoming the issue. Unfortunately, this solution is more common than not in proprietary software.

2.To define a special syntax for disturbances. The syntax can be in form of data [59], in form of a meta-language [68], or using a system-language function that is compiled at run-time [243].

3.To allow the user to embed any function within the main routine. While relatively complicated for packages based on system programming languages (especially if the source code is not provided), this solution is trivial for

204

8 Time Domain Analysis

scripting language-based applications. For example, in Python, function names are handled as any other variable type.

As the reader may expect, my favorite solution is the last one. However, this solution has also some drawback. First of all, a user-defined disturbance function must have a fixed syntax to be compatible with the main numerical integration routine. For example, the function header can be of the type:

def disturbance(t):

...

where t is current simulation time. Then, in order to modify the parameters of some device, that device has to be imported and visible in the function scope. The main issue of this approach is that the user has to be familiar with the syntax and the idiosyncrasies of the software package in use. This familiarity is often di cult to obtain. In conclusion, to much flexibility can result in an obstacle rather than a freedom.

8.4.3Stop Criterion

An important issue to solve when dealing with numerical integration is when to stop the simulation. In transient stability, most simulations are performed to define if the system is able to maintain the synchronism after a large disturbance. In practice, a common security analysis consists in defining a set of “credible” contingencies and in running a time domain simulation for each contingency.

A relevant question is: is it possible to anticipate whether the system trajectory is going to be stable or unstable and, thus, to save simulation time by opportunely stopping the numerical integration?

A simple method for determining if the trajectory is going to be unstable is to monitor the rotor angle of synchronous machines. If at a certain time t, the maximum di erence between two rotor angles exceeds 2π,4 then some machine is certainly losing the synchronism and the simulation can be stopped.

However, the previous method does not allow saving time if the simulation is stable. In fact, if the simulation is stable, one has to wait for the final assigned time tf before stopping the numerical method.

A well-known technique that allows defining the stability or instability of a given trajectory is the SIME method [236], which works as follows. At each step of the numerical integration, the machine rotor angles are sorted and the maximum di erence of two consecutive synchronous machine rotor angles is found. Assuming that these angles are δi and δj , with δi > δj , all machines whose rotor angles satisfy δh ≥ δi are considered critical machines, while all machines whose rotor angles satisfy δh ≤ δj are considered non-critical machines.

4It is assumed that the system data are in pu and thus the phase shift introduced by three-phase transformers do not a ect rotor angle values.

8.4 Numerical Integration Routine

205

Once defined the critical and non-critical machine sets, say GC and GNC,

the equivalent OMIB rotor angle is defined as:

 

 

1

 

1

 

 

δOMIB =

 

 

Hj δj

 

Hj δj

(8.54)

HC

j=GC

HNC

 

 

 

 

j=GNC

 

where the sub-indexes C and NC stand for critical and non-critical, and the equivalent inertia constants are:

HC =

 

Hj

 

j=GC

HNC =

 

Hj

 

j=GNC

Similarly, OMIB electrical and mechanical powers are defined as:

peOMIB = HOMIB

HC

 

pej HNC

 

pej

 

1

 

1

 

 

 

 

 

 

 

 

 

 

 

HC

j=GC

pmj HNC

j=GNC

pmj

pmOMIB = HOMIB

 

 

 

1

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

j=GC

 

 

 

j=GNC

(8.55)

(8.56)

where HOMIB = HCHNC/(HC + HNC). According to the EAC described in Section 8.1, the equivalent OMIB accelerating power pOMIBa is:

 

 

 

 

 

 

 

paOMIB = pmOMIB − peOMIB

 

 

 

 

 

(8.57)

The following stability conditions hold for the equivalent OMIB:

 

 

 

 

 

 

 

 

 

 

OMIB

 

 

 

OMIB

 

 

˙OMIB

> 0

1. If, at a certain time step t, pa

 

 

= 0 and p˙a

 

 

> 0 and δ

 

 

the system is unstable.5 In fact, the previous conditions ensure that the

 

system has no further kinetic energy to spend for decelerating the system.

 

 

 

˙OMIB

> 0 implies that the rotor angle is increasing. These

 

Furthermore, δ

 

 

 

are su cient conditions for defining instability.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OMIB

 

 

 

 

 

˙OMIB

0 the system is first-

2. If, at a certain time step t, pa

 

< 0 and δ

 

 

swing stable. In fact, in this case, the kinetic energy is enough to stop

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

˙OMIB

 

 

 

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

can be written

 

The first time derivative of the equivalent OMIB rotor angle δ

 

 

as:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

˙OMIB

1

 

˙

 

 

1

 

 

 

˙

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

δ

 

=

 

j=GC Hj δj

 

 

 

j=GNC Hj δj

 

 

 

 

 

 

 

 

 

HC

HNC

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

1

 

 

 

 

 

 

OMIB

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=

 

j=GC Hj ωj

 

j=GNC Hj ωj = Δω

 

 

 

 

 

 

 

 

HC

HNC

 

 

 

 

 

˙OMIB

is the speed deviation Δω

OMIB

of the equivalent OMIB system.

 

Thus, δ

 

 

 

 

206

8 Time Domain Analysis

the critical machine rotor angles and make them to “come back”. These stability conditions are only necessary. In fact, the system can later on show multi-swing instability. Only the numerical integration can show if the trajectory is multi-swing stable or not.

3.If pOMIBa > 0, t > 0, then the system is certainly unstable. However, some heuristic is needed to determine when to stop the simulation [236].

The most relevant features of the SIME method are (i) no assumption is made on the original system and (ii) computing the OMIB equivalent is practically inexpensive with respect to the computational burden of the numerical method.

The main assumption of the SIME method is that the two sets of critical and non-critical machines can be considered as an OMIB system. One may argue that there could be a case in which the system separates into three or more groups. Actually, there is no experimental result that shows a system separating in more than two groups since it becomes unstable.6 Thus, until a case study will prove the contrary, the main assumption of the SIME method can be considered true.

Example 8.8 Application of the SIME Method for the IEEE 14-Bus System

Figure 8.10 shows synchronous machine rotor speeds for the IEEE 14-bus system following a three-phase fault at bus 4. The fault occurs at t = 1 s and is cleared at t = 1.2 s by line 2-4 outage. The numerical integration provides the first 4 s following the fault clearing. During the fault and in the first instances after the line outage, the system separates into two groups: the first group is composed of machines 1 and 2, and the other one is composed of machines 3, 4 and 5. From observing the plot, it is clear that the system is stable. Nevertheless, the SIME method allows stopping the simulation at about t = 1.265 s,

OMIB

˙OMIB

0 are satisfied (see

i.e., when the stability conditions pa

< 0 and δ

Figure 8.11). It is important to note that only the full time domain simulation ensures that the system does not show multi-swing instability.

Script 8.2 Complete Time Domain Integration Algorithm

The following script provides a complete routine for numerical integration implementing the backward Euler’s and the trapezoidal implicit methods. The functions first time step(), time step(convergence, iteration, t) and anglediff() allows defining the first step length as well as maximum and minimum step length, updating the step length and computing the rotor angle di erence or the stability according to the SIME approach, respectively. The class system.Varout is used for storing the simulation results: each instance of the method store() append to the output file the current simulation time and the vectors of state and algebraic variables. As

6Observe that if the system trajectory is stable, the critical and the non-critical machine groups are arbitrary since there are no critical machines.

8.4 Numerical Integration Routine

207

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 8.10 Transient following a three-phase fault at bus 4 for the IEEE 14-bus system. The gray region indicates the part of the simulation that is required by the SIME method to determine that rotor speed trajectories are first-swing stable

usual, the expression exec system.Device.call int is used as interface for computing algebraic and di erential equations and Jacobian matrices of all devices defined in the system (see Script 3.2 of Chapter 3).

Two remarks are relevant:

1.State variable hard limits requires a special care. When a state variable hits a hard limit, its value becomes a constant and the correspondent

di erential equation is “frozen”. This has to be taken into account in the matrix A(ci) and in the vector qˆ(i). With this aim, the interface exec

system.Device.call windup makes sure that if a state variable, say xi hits a limit, the ith column and the ith row of A(ci) as well as the ith element

of the vector qˆ(i) are set to zero, while the element (i, i) of A(ci) is set to 1.

2.Special events such as fault occurrences and breaker operations are taken into account so that, regardless the step length Δt, the numerical integration evaluates a point right before and right after that event. In other words, if the event occurs at t = te, then a point is evaluated at te and at te + . This “trick” avoids that a specific event is evaluated with a delay due to the step length.

import system

from cvxopt.base import matrix, spmatrix, sparse

from cvxopt.umfpack import linsolve, symbolic, numeric