33
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign [email protected] 11/30/2015 1 Lecture 23: Numeric Solution of Differential Equations

ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Embed Size (px)

DESCRIPTION

Power System Time Frames 3 Lightning Propagation Switching Surges Stator Transients and Subsynchronous Resonance Transient Stability Governor and Load Frequency Control Boiler/Long-Term Dynamics Time (Seconds) Voltage Stability Power Flow Image source: P.W. Sauer, M.A. Pai, Power System Dynamics and Stability, 1997, Fig 1.2, modified

Citation preview

Page 1: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

ECE 530 – Analysis Techniques for Large-Scale Electrical Systems

Prof. Hao ZhuDept. of Electrical and Computer Engineering

University of Illinois at [email protected]

11/30/2015

1

Lecture 23: Numeric Solution of Differential Equations

Page 2: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Switching to Dynamic Systems

• We've mostly dealt with power system static analysis–Determining characteristics of the power system quasi-steady

state equilibrium• Now we're going to do a brief coverage of techniques

for analysis of power system dynamics, with fuller coverage detailed in ECE 576

• Appropriate models depend on time period of interest–Faster dynamics can be represented as algebraic constraints–Slower dynamics can be represented as constants

2

Page 3: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Power System Time Frames

3

Lightning Propagation

Switching Surges

Stator Transients andSubsynchronous Resonance

Transient Stability

Governor and Load Frequency Control

Boiler/Long-Term Dynamics

10-7 10-5 10-3 0.1 10 103 105

Time (Seconds)

Voltage Stability

Power Flow

Image source: P.W. Sauer, M.A. Pai, Power System Dynamics and Stability, 1997, Fig 1.2, modified

Page 4: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Power Grid Disturbance Example

4Time in Seconds

Figures show the frequency change as a result of the sudden loss of a large amount of generation in the Southern WECC

Frequency Contour

20191817161514131211109876543210

6059.9959.9859.9759.9659.9559.9459.9359.9259.9159.9

59.8959.8859.8759.8659.8559.8459.8359.8259.8159.8

59.7959.7859.7759.7659.7559.7459.73

Page 5: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Frequency Response for Gen. Loss

• In response to rapid loss of generation, in the initial seconds the system frequency will decrease as energy stored in the rotating masses is transformed into electric energy• Solar PV has no inertia, and for most new wind turbines the

inertia is not seen by the system

• Within seconds governors respond, increasing power output of controllable generation• Solar PV and wind are usually operated at maximum power

so they have no reserves to contribute

5

Page 6: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Solution Considerations

• In ECE 530 we introduce several solution methods that are more fully considered in ECE 576

• A wide variety of different solution methods are possible, with different classes of problems (such as power system transient stability) having customized solutions

• There is a balance between the problem to be solved and the solution method–Can we bound the dynamics considered, with fast dynamics

represented as algebraic constraints, and slow as constants

6

Page 7: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Differential Algebraic Equations

• Many problems, including many in the power area, can be formulated as a set of differential algebraic equations (DAE) of the form

• A power example is transient stability, in which f represents (primarily) the generator dynamics, and g (primarily) the bus power balance equations

• We'll just consider the simpler problem

7

( , )( , )

x f x y0 g x y

( )x f x

Page 8: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Ordinary Differential Equations (ODEs)

• Assume we have a problem of the form

• This is known as an initial value problem, since the initial value of x is given at some time t0

–We need to determine x(t) for future time– Initial value, x0, must be either be given or determined by

solving for an equilibrium point, f(x) = 0–Higher-order systems can be put into this first order form

• Except for special cases, such as linear systems, an analytic solution is usually not possible – numerical methods must be used

8

0 0( ) with (t ) x f x x x

Page 9: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Equilibrium Points

• An equilibrium point x* satisfies

• An equilibrium point is stable if the response to a small disturbance remains small–This is known as Lyapunov stability–Formally, if for every e > 0, there exists a d = d(e) > 0 such

that if ||x(0) – x*|| < d, then ||x(t) – x*|| < e for t 0• An equilibrium point has asymptotic stability if there

exists a d > 0 such that if ||x(0) – x*|| < d, then

9

( *) x f x 0

lim ( ) *t

t

x x 0

Page 10: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Power System Application

• A typical power system application is to assume the power flow solution represents an equilibrium point

• Back solve to determine the initial state variables, x(0)• At some point a contingency occurs, perturbing the

state away from the equilibrium point• Time domain simulation is used to determine whether

the system returns to the equilibrium point

10

Page 11: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Initial value Problem Examples

0

0

1 2

2 1 2

Example 1: Exponential DecayA simple example with an analytic solution is

x with x(0) x

This has a solution x(t) xExample 2: Mass-Spring System

orx

1

t

x

e

kx gM Mx Dx

x

x k x g M D xM

11

Page 12: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Numerical Solution Methods

• Numerical solution methods do not generate exact solutions; they practically always introduce some error–Methods assume time advances in discrete increments, called

a stepsize (or time step), Dt–Speed accuracy tradeoff: a smaller Dt usually gives a better

solution, but it takes longer to compute –Numeric roundoff error due to finite computer word size

• Key issue is the derivative of x, f(x) depends on x, the value we are trying to determine

• A solution exists as long as f(x) is continuously differentiable

12

Page 13: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Numerical Solution Methods

• There are a wide variety of different solution approaches, we will only touch on several

• One-step methods: require information about solution just at one point, x(t)–Forward Euler –Runge-Kutta

• Multi-step methods: make use of information at more than one point, x(t), x(t-Dt), x(t-D2t)…–Adams-Bashforth

• Predictor-Corrector Methods: implicit–Backward Euler

13

Page 14: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Error Propagation

• At each time step the total round-off error is the sum of the local round-off at time and the propagated error from steps 1, 2 , … , k − 1

• An algorithm with the desirable property that local round-off error decays with increasing number of steps is said to be numerically stable

• Otherwise, the algorithm is numerically unstable• Numerically unstable algorithms can nevertheless give

quite good performance if appropriate time steps are used–This is particularly true when coupled with algebraic equations

14

Page 15: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Forward Euler’s Method

• A simplest technique for numerically integrating is the Euler's Method (sometimes the Forward Euler's Method)

• Key idea is to approximate

• In general, the smaller the Dt, the more accurate and stable the solution, but it also takes more time steps

15

d ( ( )) as dt t

Then( ) ( ) ( ( ))

t

t t t t t

D D

D D

x xx f x

x x f x

Page 16: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Second Order Runge-Kutta Method

• Runge-Kutta methods improve on Euler's method by evaluating f(x) at selected points over the time step

• Simplest method is the second order method in which

• That is, k1 is what we get from Euler's; k2 improves on this by reevaluating at the estimated end of the time step 16

1 2

1

2 1

1              2

where   

  

      

t t t

t t

t t

D

D

D

x x k k

k f x

k f x k

Page 17: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Second Order Runge-Kutta (RK2)

t = 0, x(0) = x0, Dt = step sizeWhile t tend Do

k1 = Dt f(x(t))k2 = Dt f(x(t) + k1)x(t+Dt) = x(t) + ( k1 + k2)/2t = t + Dt

End While

17

Page 18: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

RK2 Oscillating Cart

• Consider the same example from before the position of a cart attached to a lossless spring. Again, with initial conditions of x1(0) =1 and x2(0) = 0, the analytic solution is x1(t) = cos(t)

18

1 2

2 1

x xx x

Page 19: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

RK2 Oscillating Cart

19

2 1

1 2

0.0625(0.25) (0)

0.251 0.968751(0.25)

20 0.25

k f x k

x k k

10 0

(0.25)1 0.25

1 0 1(0) 1

0 0.25 0.25

k

x k

• With Dt=0.25 at t = 0

Page 20: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Comparison

• The below table compares the numeric and exact solutions for x1(t) using the RK2 algorithm

20

time actual x1(t) x1(t) with RK2Dt=0.25

0 1 10.25 0.9689 0.9690.50 0.8776 0.8760.75 0.7317 0.7281.00 0.5403 0.53310.0 -0.8391 -0.795

100.0 0.8623 1.072

Page 21: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Comparison of x1(10) for varying Dt

• The below table compares the x1(10) values for different values of Dt; recall with Euler's with Dt=0.1 was -1.41 and with 0.01 was -0.8823

21

Dt x1(10)actual -0.83910.25 -0.79460.10 -0.83100.01 -0.83900.001 -0.8391

Page 22: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

RK2 Versus Euler's

• RK2 requires twice the function evaluations per iteration, but gives much better results

• With RK2 the error tends to vary with the cube of the step size, compared with the square of the step size for Euler's

• The smaller error allows for larger step sizes compared to Euler’s

22

Page 23: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Fourth Order Runge-Kutta

• Other Runge-Kutta algorithms are possible, including the fourth order

23

1 2 3 4

1

2 1

3 2

4 2

1             2 2  6

where   

  

      

 

1212

    

    

t t t

t t

t t

t t

t t

D

D

D

D

D

x x k k k k

k f x

k f x k

k f x k

k f x k

Page 24: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

RK4 Oscillating Cart Example

• RK4 gives much better results, with error varying with the time step to the fifth power

24

time actual x1(t) x1(t) with RK4Dt=0.25

0 1 10.25 0.9689 0.96890.50 0.8776 0.87760.75 0.7317 0.73171.00 0.5403 0.540310.0 -0.8391 -0.8392100.0 0.8623 0.8601

Page 25: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Multistep Methods

• Euler's and Runge-Kutta methods are single step approaches, in that they only use information at x(t) to determine its value at the next time step

• Multistep methods take advantage of the fact that using we have information about previous time steps x(t-Dt), x(t-2Dt), etc

• These methods can be explicit or implicit [dependent on x(t+Dt) values]; we'll just consider the explicit Adams-Bashforth approach

25

Page 26: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Multistep Motivation

• In determining x(t+Dt) we could use a Taylor series expansion about x(t)

(note Euler's is just the first two terms on the right-hand side)

26

23

2

3

( ) ( ) ( ) ( ) ( )2

( ( )) ( ( ))( ) ( ) ( ) ( )2

3 1( ) ( ) ( ) ( ) ( )2 2

tt t t t t t O t

t t t tt t t t t O tt

t t t t t t t O t

DD D D

D D D D D D D D D D

x x x x

f x f xx x f

x x f x f x

Page 27: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Adams-Bashforth

• What we derived is the second-order Adams-Bashforth approach. Higher-order methods are also possible, by approximating subsequent derivatives. Here we also present the second- and third-order Adams-Bashforth

27

3

4

Second Order

( ) ( ) 3 (x( )) ( ( )) ( )2

Third Order

( ) ( ) 23 (x( )) 16 ( ( )) 5 ( ( 2 )) ( )12

tt t t t x t t O t

tt t t t x t t x t t O t

DD D D

DD D D D

x x f f

x x f f f

Page 28: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Adams-Bashforth Versus Runge-Kutta

• The key Adams-Bashforth advantage is the approach only requires one function evaluation per time step while the RK methods require multiple evaluations

• A key disadvantage is when discontinuities are encountered, such as with limit violations;

• Another method needs to be used until there are sufficient past solutions

• They also have difficulties if variable time steps are used

28

Page 29: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Numerical Instability

• All explicit methods can suffer from numerical instability if the time step is not correctly chosen for the problem eigenvalues

29Image source: http://www.staff.science.uu.nl/~frank011/Classes/numwisk/ch10.pdf

Values are scaled by thetime step; the shapefor RK2 has similar dimensions but is closerto a square. Key pointis to make sure the timestep is small enoughrelative to the eigenvalues

Page 30: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Stiff Differential Equations

• Stiff differential equations are ones that exhibit a wide-range of time varying dynamics from “very fast” to “very slow.”

• Stiffness is associated with solution efficiency: in order to account for these fast dynamics we need to take quite small time steps

30

1 2

2 1 2

10001

x1000 1001

0 11000 1000

( ) t t

xx x x

x t Ae Be

x x

Page 31: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Multi-Rate Methods

• Multi-rate methods can be used with sets of differential equations in which different parts of the system have different speeds–Use small time steps for the fast parts of the system–Use larger time steps for the slower parts of the system

• Subsystems need to be sufficiently decoupled• A good power system reference: J. Chen and M. L.

Crow, "A Variable Partitioning Strategy for the Multirate Method in Power Systems," IEEE Trans. Power Systems, vol. 23, pp. 259-266, 2008

31

Page 32: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Multi-Rate Methods

• At each macro step the slow variables are integrated, at each micro step the fast variables are integrated

• Macro variables can be interpolated during the micro steps

32

Source: J. Chen and M. L. Crow, "A Variable Partitioning Strategy for the Multirate Method in Power Systems," IEEE Trans. Power Systems, vol. 23, pp. 259-266, 2008

Page 33: ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign

Multi-Rate Example: Transient Stability

• The power system transient stability problem is usually solved with a time step of ¼ or ½ cycle

• Some subsystems can have much faster time constants–When starting induction machines can exhibit very fast

(relative to the time step) transients–Some types of exciters can have very fast time constants, in

which the dynamics only come into play during close by faults

33