Вы находитесь на странице: 1из 51

NUMERICAL INTEGRATION

NUMERICAL INTEGRATION
TECHNIQUES
TECHNIQUES
Applications to power system
Created By
NIRMAL PATEL
Guided By
S.G.
2
Outline
Outline

Introduction

One Step Methods


Forward Eulers Method
Backward Eulers Method
Trapezoidal Method
Taylor series based Methods
Runge-Kutte Method
2
nd
order

4
th
order

Accuracy & Error Analysis

Stability Analysis

Stiff systems

Power System Applications


Transient stability Analysis

3
Introduction
Introduction

In power systems,
1. Some times analytical formulae for
integration i.e. is not
available .
2. Some times we dont know the
functional form and have only a
set of tabulated data points.
In both cases it is necessary
to use numerical methods to
. evaluate the integrals
4
Mathematics 101
Mathematics 101

Mean Value Theorem:- Mean Value Theorem:-

If a function is continuous & differentiable between two


points, say (x1 , y1) & (x2 , y2), then the slope of the line
joining these points is equal to the derivative of the function at
least at one other point, say (a , b), between these two points,
i.e...

& If then w e can derive the


.. Euler's Equation
5
One Step Method
One Step Method

These methods allow us to vary the step


size.

Use only one initial value

After each step is completed the past step


is forgotten We do not use this
information.
: The techniques are defined as
6

Consider the First order ODE

With an initial condition

Then the (i+1)


th
point of the solution
is obtained from the i
th
point using
the following formula

7
Geometrical
Geometrical
Interpretation
Interpretation
X
Y
C
B
A

..

8
Example
Example

Let

f=y y(0)=1.

For i=1

y
1
=1+(0.01*1)

y
1
=1.01

NEW INITIAL POINT:-

(x1,y1)=(0.01,1.01)

Similarly we will go until desired x as we can


see the step 1 will be forgotten & new
initial point will be (x1,y1).

The complete solution is given in next slide.

9
i h=0.01 h=0.005
x
i
y
i
x
i
y
i
1 0.01 1.01 0.005 1.0050
2 0.02 1.0201 0.010 1.0100
3 0.03 1.030301 0.015 1.051
4 0.04 1.040606 0.020 1.0202
5 0.05 1.05101206 0.025 1.0253
6 - - 0.030 1.0304
7 - - 0.035 1.0356
8 - - 0.040 1.0408
9 - - 0.045 1.046004
10 - - 0.05 1.05123402
10
CONTINUED
CONTINUED

Since the exact solution of this equation is y


= e
x
, the correct value at x = 0.05 is
1.05127109.

It is clear that, to obtain more accuracy


with Eulers forward method, we must take a
considerably smaller value for h.

These results are correct to four decimal


places after the decimal point. Because of the
relatively small step size required, Eulers
method is not commonly used for integrating
differential equations.

We could, of course, apply Taylors


algorithm of higher order to obtain better
accuracy, and in general, we would expect
that the higher the order of the algorithm, the
greater the accuracy for a given step size.
11
Backward Eulers
Backward Eulers
Method
Method

Consider the First order ODE

With an initial condition

Then the (i+1)


th
point of the solution
is obtained from the i
th
point using
the following formula

12
Example
Example

Let

f=y y(0)=1.

where 0<x<0.05

Solution:-

Quite implicit as y
i+1
appears both
the sides

So

(For a given Problem)

13
CONTINUED
CONTINUED

Solution table is given here


i h=0.005
x
i
y
i

1 0 1
2 0.005 1.005025
3 0.01 1.010075
4 0.015 1.0151512
5 0.02 1.02025252
6 0.025 1.02537941
7 0.03 1.03053208
8 0.035 1.035710633
9 0.04 1.040915209
10 0.045 1.046145938
11 0.05 . 1 051402953
14
CONTINUED
CONTINUED

Since the exact solution of this


equation is y = e
x
, the correct value at x
= 0.05 is 1.05127109.

It is clear that, we can obtain more


accuracy with Eulers Backward method
w.r.t. Forward Eulers method.

These results are correct to four


decimal places after the decimal point.
Because it is relatively Implicit, Eulers
backward method is not commonly used
for integrating differential equations.

15

Consider the First order ODE

With an initial condition

Then the (i+1)


th
point of the solution
is obtained from the i
th
point using
the following formula

16
Example
Example

Let

f=y y(0)=1.

where 0<x<0.05

Solution:-

17
CONTINUED
CONTINUED

For i=1

First we predict the value of y


1
by Eulers
forward method.

y
1
=1+(0.005*1)

y
1
=1.005

Also X1=0.005

So the corrected value of y


1
is given by:-

y1=1.005038

The complete solution is given in next slide


18
CONTINUED
CONTINUED

i x
i
y
i
1 0 1
2 0.005 1.005013
3 0.01 1.010050
4 0.015 1.015113
5 0.020 1.020201
6 0.025 1.025315
7 0.030 1.030454
8 0.035 1.035619
9 0.040 1.040810
10 0.045 1.046028
11 0.050 1.051271
19
Summary
Summary

Trap Rule, Forward-Euler, Backward-


Euler

All are one-step methods as x


k+1
is
computed using only x
k
, not x
k-1
, x
k-2
, x
k-
3
...

Forward-Euler is the simplest

As No equation solution
explicit method.

Backward-Euler is more expensive

Equation solution each step


implicit method

most stable.

Trapezoidal Rule might be more


accurate

Equation solution each step


implicit method

More accurate but less stable, may cause


oscillation
20
Taylor
Taylor
series
series
based
based
Methods
Methods

Numerical methods we saw earlier have an


underlying derivation from Taylors Theorem.

For IVP the solution by Taylor series is given by

where
21
CONTINUED
CONTINUED

The Taylor series method is a


straight forward adaptation of
classic calculus to develop the
solution as an infinite series. The
catch is that a computer usually
can not be programmed to
construct the terms and one does
not know how many terms should
be used.

The method is not strictly a


numerical method but is use in
conjunction with numerical
schemes.

22
CONTINUED
CONTINUED

From the Taylor series expansion

The step size is defined as :

Using the initial condition, the


higher order derivatives of the
equation can be obtained.

( ) ( ) ( ) ( ) ( ) ( ) + +

+

+

+
0
IV
4
0
3
0
2
0 0

! 4 ! 3 ! 2
x y
h
x y
h
x y
h
x y h x y x y
0
x x h
23
Example
Example

Let

f=y=y

With initial condition

y(0)=1.

The analytical solution is

( )
x
e x y
24
CONTINUED
CONTINUED

The higher order derivatives can be


found with the initial condition,
y(0) = 1, and the equation
( ) ( )
( ) ( )
( ) ( )
( ) ( ) x y x y
x y x y
x y x y
x y x y

IV
( ) ( )
( ) ( )
( ) ( )
( ) ( ) 1 0 0
1 0 0
1 0 0
1 0 0
IV

y y
y y
y y
y y
25
CONTINUED
CONTINUED

From the Taylor series expansion

Plug in the initial conditions:

Resulting in the equation:

( ) ( ) ( ) ( ) ( ) ( ) + +

+

+

+
0
IV
4
0
3
0
2
0 0

! 4 ! 3 ! 2
x y
h
x y
h
x y
h
x y h x y x y
( ) ( ) ( ) ( ) ( ) Error 1
! 4
1
! 3
1
! 2
1 1
4 3 2
+ + + + +
h h h
h h y
( ) Error
24 6 2
1
4 3
2
+ + + + +
h h h
h h y
26
CONTINUED
CONTINUED

h Second
y(h )
Third
y(h )
Fourth
y(h )
Exact
Solution
0
1 1 1 1
0.01
1.01005 1.010050167 1.010050167 1.010050167
0.02
1.0202 1.020201333 1.02020134 1.02020134
0.03
1.03045 1.0304545 1.030454534 1.030454534
0.04
1.0408 1.040810667 1.040810773 1.040810774
0.05
1.05125 1.051270833 1.051271094 1.051271096
1
2.5 2.666666667 2.708333333 2.718281828
1.2
2.92 3.208 3.2944 3.320116923
1.4
3.38 3.837333333 3.9974 4.055199967
1.5
3.625 4.1875 4.3984375 4.48168907
2
5 6.333333333 7 7.389056099
The results
27

Runge-Kutta methods are very popular


because of their good efficiency; and are
used in most computer programs for
differential equations. They are single-
step methods.

Eulers method is not very useful in practical


problems because it requires a very small
step size for reasonable accuracy. Taylors
algorithm of higher order is unacceptable
as a general-purpose procedure because
of the need to obtain higher total
derivatives of y(x). The Runge-Kutta
methods attempt to obtain greater
accuracy, and at the same time avoid the
need for higher derivatives, by evaluating
the function f(x,y) at selected points on
each subinterval. We shall derive here the
simplest of the Runge-Kutta methods.

28
2
2
nd
nd
order RK method
order RK method

To convey some idea of how the


Runge-Kutta is developed, lets
look at the derivation of the
2
nd
order. Two estimates

( )
( )
1 n n 2
n n 1
2 1 n 1 n
,
,
k y h x hf k
y x hf k
bk ak y y
+ +

+ +
+
29
CONTINUED
CONTINUED

( / The Taylor series coefficients 3 equations 4


) unknow ns
If you select a as
If you select a as

* : - Note These co efficient would result in a modified Euler or Midpoint Method


# : - Note These Co efficient are derived by mathematician Heun so this method is also
. known as Heun s method
[ ]
2
1
,
2
1
, 1 + b b b a
2
3
,
2
3
,
3
1
,
3
2
#
b a
1 ,
2
1

2
1
*
b a
30
Example
Example

Let

f=y=y

With initial condition

y(0)=1.

The analytical solution


is

The step size & co-


efficient

( )
x
e x y
1 . 0 h
2
3
,
2
3
,
3
1
,
3
2
b a
( )
( )
[ ]
2 1 i 1 i
1 i i 2
i i 1
2
1
,
,
k k y y
k y h x hf k
y x hf k
+ +
+ +

+
31
CONTINUED
CONTINUED
x y exact k k1 k2
0 1 1 1.05 1 1.1
0.1 1.105 1.105171 1.16025 1.105 1.2155
0.2 1.221025 1.221403 1.282076 1.221025 1.3431275
0.3 1.349232625 1.349859 1.416694 1.349233 1.484155888
0.4 1.490902051 1.491825 1.565447 1.490902 1.639992256
0.5 1.647446766 1.648721 1.729819 1.647447 1.812191443
0.6 1.820428676 1.822119 1.91145 1.820429 2.002471544
0.7 2.011573687 2.013753 2.112152 2.011574 2.212731056
0.8 2.222788925 2.225541 2.333928 2.222789 2.445067817
0.9 2.456181762 2.459603 2.578991 2.456182 2.701799938
1 2.714080847 2.718282 2.849785 2.714081 2.985488931
1.1 2.999059336 3.004166 3.149012 2.999059 3.298965269
1.2 3.313960566 3.320117 3.479659 3.313961 3.645356622
1.3 3.661926425 3.669297 3.845023 3.661926 4.028119068
1.4 4.0464287 4.0552 4.24875 4.046429 4.45107157
1.5 4.471303713 4.481689 4.694869 4.471304 4.918434085
1.6 4.940790603 4.953032 5.18783 4.940791 5.434869663
1.7 5.459573616 5.473947 5.732552 5.459574 6.005530978
1.8 6.032828846 6.049647 6.33447 6.032829 6.636111731
1.9 6.666275875 6.685894 6.99959 6.666276 7.332903463
2 7.366234842 7.389056 7.734547 7.366235 8.102858326
32
4
4
th
th
order RK method
order RK method
( + ) The i 1
th
point of the solution is obtained from
the ith point using the following formula

Where

( ) This will result in a local error of O h5 and a


( ) global error of O h4
k y y i i + + 1
[ ]
4 3 2 1
2 2
6
1
k k k k k + + +
33
CONTINUED
CONTINUED

: The general form of the equations


[ ]
( ) [ ]
( ) [ ]
3 4
2 3
1 2
1
4 3 2 1
,
2
1
,
2
1
2
1
,
2
1
,
2 2
6
1
k y h x f h k
k y h x f h k
k y h x f h k
y x f h k
k k k k k
+ +
1
]
1

,
_

+ +
1
]
1

,
_

+ +

+ + +
34
CONTINUED
CONTINUED

x
i
x
i
+
/ h 2
x
i
+ h
f
1
f
2
f
3
f
4
( )
4 3 2 1
2 2
6
1
f f f f f + + +
f
35
Example
Example

Let

f=y=y

With initial condition

y(0)=1.

The analytical solution is

The step size & co-efficient

( )
x
e x y
1 . 0 h
36
CONTINUED
CONTINUED

: The example of a single step


( ) [ ] ( ) ( )
( )
( )
( ) [ ] ( )
[ ] 105170833 . 1 2 2
6
1
110525 . 0 10525 . 1 , 1 . 0 1 . 0 ,
10525 . 0 2 / 105 . 0 1 , 05 . 0 1 . 0
2
1
,
2
1
105 . 0 05 . 1 , 05 . 0 1 . 0
2
1
,
2
1
1 . 0 1 1 . 0 1 , 0 1 . 0 ,
4 3 2 1 n 1 n
3 4
2 3
1 2
1
+ + + +
+ +
+
1
]
1

,
_

+ +

1
]
1

,
_

+ +

+
k k k k y y
f k y h x f h k
f k y h x f h k
f k y h x f h k
f y x f h k
37
CONTINUED
CONTINUED

xi yi k k1 k2 k3 k4 exact
0 1 0.105170833 0.1 0.105 0.10525 0.110525 1
0.1 1.105170833 0.116231738 0.110517083 0.116043 0.116319 0.122149 1.105171
0.2 1.221402571 0.128455926 0.122140257 0.128247 0.128553 0.134996 1.221403
0.3 1.349858497 0.141965743 0.13498585 0.141735 0.142073 0.149193 1.349859
0.4 1.49182424 0.156896399 0.149182424 0.156642 0.157015 0.164884 1.491825
0.5 1.648720639 0.173397323 0.164872064 0.173116 0.173528 0.182225 1.648721
0.6 1.822117962 0.191633665 0.182211796 0.191322 0.191778 0.20139 1.822119
0.7 2.013751627 0.211787937 0.201375163 0.211444 0.211947 0.22257 2.013753
0.8 2.225539563 0.23406185 0.222553956 0.233682 0.234238 0.245978 2.225541
0.9 2.459601414 0.25867833 0.245960141 0.258258 0.258873 0.271847 2.459603
1 2.718279744 0.285883746 0.271827974 0.285419 0.286099 0.300438 2.718282
1.1 3.00416349 0.315950378 0.300416349 0.315437 0.316188 0.332035 3.004166
1.2 3.320113868 0.349179142 0.332011387 0.348612 0.349442 0.366956 3.320117
1.3 3.66929301 0.385902604 0.366929301 0.385276 0.386193 0.405549 3.669297
1.4 4.055195614 0.426488302 0.405519561 0.425796 0.426809 0.4482 4.0552
1.5 4.481683916 0.471342432 0.448168392 0.470577 0.471697 0.495338 4.481689
1.6 4.953026348 0.520913909 0.495302635 0.520068 0.521306 0.547433 4.953032
1.7 5.473940256 0.575698858 0.547394026 0.574764 0.576132 0.605007 5.473947
1.8 6.049639115 0.636245587 0.604963911 0.635212 0.636725 0.668636 6.049647
1.9 6.685884702 0.703160066 0.66858847 0.702018 0.703689 0.738957 6.685894
2 7.389044767 0.777111996 0.738904477 0.77585 0.777697 0.816674 7.389056
38
CONTINUED
CONTINUED

The values are equivalent to


. those of the exact solution If
= . we were to go out to x 5
( ) = y 5 . 148 4131591
( . 148 4125901 )
The error is small relative to
. the exact solution
39
CONTINUED
CONTINUED

A comparison between the 2


nd
order and the 4
th
- order Runge Kutta
. methods show a slight difference
40
Methods Comparison
Methods Comparison


Method


Equations
Euler
(Error of the order h
2
)
( ) [ ] y x f h k
k k
,
1
1


Modified Euler (Trap.. )
(Error of the order h
3
)
[ ]
( ) [ ]
( ) [ ]
1 2
1
2 1
,
,
2
1
k y h x f h k
y x f h k
k k k
+ +

+

Heun
(Error of the order h
4
)
[ ]
( ) [ ]
1
]
1

,
_

+ +
1
]
1

,
_

+ +

+
2 3
1 2
1
3 1
3
2
,
3
2
3
1
,
3
1
,
3
4
1
k y h x f h k
k y h x f h k
y x f h k
k k k

4
th
order Runge Kutta
(Error of the order h
5
)
[ ]
( ) [ ]
( ) [ ]
3 4
2 3
1 2
1
4 3 2 1
,
2
1
,
2
1
2
1
,
2
1
,
2 2
6
1
k y h x f h k
k y h x f h k
k y h x f h k
y x f h k
k k k k k
+ +
1
]
1

,
_

+ +
1
]
1

,
_

+ +

+ + +


41
Stiffness & Stiff
Stiffness & Stiff
Systems
Systems

A stiff system is one involving rapidly changing


components together with slowly changing
ones.

An example of a single stiff ODE is:




whose solution if y(0)=0 is:

dy
dt
1000 y+3000 2000e
t

y30.998e
1000t
2.002e
t
42
Transient Stability
Transient Stability
Analysis
Analysis

For transient stability analysis we


need to consider three systems
1.Prefault - before the fault occurs the
system is assumed to be at an
equilibrium point
2.Faulted - the fault changes the
system equations, moving the
system away from its equilibrium
point
3.Postfault - after fault is cleared the
system hopefully returns to a new
operating point
43
Transient Stability Solution
Transient Stability Solution
Methods
Methods

There are two methods for solving the


transient stability problem
1.Numerical integration
l
this is by far the most common technique,
particularly for large systems; during the
fault and after the fault the power
system differential equations are solved
using numerical methods
2.Direct or energy methods; for a two bus
system this method is known as the
equal area criteria
l
mostly used to provide an intuitive insight
into the transient stability problem

44
Example
Example
A 60 Hz generator is supplying 550 MW to an infinite bus
(with 1.0 per unit voltage) through two parallel
transmission lines. Determine initial angle change for a
fault midway down one of the lines.
H = 20 seconds, D = 0.1. Use t=0.01 second.
45
CONTINUED
CONTINUED

We first need to determine the Pre-fault


values.

Since P= 550 MW (5.5 pu) I=5.5

Next to get we need to determine


the thevenin equivalent during the fault
looking into the network from the
generator

8 . 28 141 . 1 5 . 5 * 1 . 0 0 . 1 + j E
a
) (
e
P
08333 . 0 1 . 0 || 05 . 0 05 . 0 j j j j Z
th
+

0 3333 . 0
th
V
46
CONTINUED
CONTINUED

Therefore prefault we have

and

Also during the fault

Let and The Equation to


integrate are

and

47
CONTINUED
CONTINUED

Now

With Eulers Method we get

48
CONTINUED
CONTINUED

0 0.5 1 1.5 2
Simulation time in seconds
0
60
120
180
240
G
e
n
e
r
a
t
o
r

a
n
g
l
e

i
n

d
e
g
r
e
e
s
clearing at 0.3 seconds
clearing at 0.2 seconds
clearing at 0.1 seconds
49
CONCLUSION
CONCLUSION
50
Books
Books

Numerical Methods for Engineers-Fifth


Edition

. . & . . . - S C Chapra R P Canale McGraw Hill College

Applied Numerical Analysis-Second Edition

. . & . . , C F Gerald P O Wheatley Addison Wesley


Boston

Elementary Numerical Analysis-Third


Edition

. . . - S D Conte and C de Boor McGraw Hill College

Numerical-Methods-Third Edition

. & . , - J Douglas Richard L Burden Youngtown State


. University

Foundations of Differential Calculus

Euler

Advanced Engineering Mathematics-ninth


edition

, , ERWIN KREYSZIG Ohio State University , Columbus


. Ohio
51
- William Shakespeare
All's Well, that Ends Well

Вам также может понравиться