Sie sind auf Seite 1von 13

Obtaining the Jacobian

1.0 Introduction
We have seen that the Jacobian matrix is
essential for solving a set of nonlinear
algebraic equations using the Newton-
Raphson method.
In the last set of notes, we defined the
Jacobian and saw how to use it to solve a
simple two-dimensional problem.
In these notes, lets see how to obtain the
Jacobian for the power flow problem.
2.0 The form of the Jacobian
The power flow equations were given as:
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
]
1

+ +

N N
N N
N N
N N
N
N
Q x Q
Q x Q
P x P
P x P
x f
x f
x f
x f
x f
G G
G
) (
) (
) (
) (
) (
) (
) (
) (
) (
1 1
2 2
1 2
1
1

1
0
0
0
0
0
1
2

1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
]
1

N
N
N
Q
Q
P
P
G
(1)
where:
( )

+
n
k
k i ik k i ik k i i
B G V V P
1
) sin( ) cos(
i=2,N (2)
( ) ) cos( ) sin(
1
k i ik k i ik
n
k
k i i
B G V V Q

i=N
G
+1,N (3)
The solution vector is:
1
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
1
]
1

1
]
1

+
+
G
G
G
N N
N
N
N
N
N
N
N
x
x
x
x
x
x
| |V
| |V
| |V

| V |

2 2
1
1
2
1
2
1
3
2
x

(4)
2
The Jacobian matrix is:
1
1
1
1
1
1
1
1
]
1

n
n n n
n
n
x
x f
x
x f
x
x f
x
x f
x
x f
x
x f
x
x f
x
x f
x
x f
J
) ( ) ( ) (
) ( ) ( ) (
) ( ) ( ) (
) 0 (
2
) 0 (
1
) 0 (
) 0 (
2
2
) 0 (
2
1
) 0 (
2
) 0 (
1
2
) 0 (
1
1
) 0 (
1

(5)
Evaluation of these elements is facilitated by
the recognitions,
from (2) and (3), that there are only two
kinds of equations to differentiate (real
power equations and reactive power
equations), and
from eq. (4), that there are only two kinds
of unknowns (voltage angle unknowns
and voltage magnitude unknowns) with
respect to which we will differentiate.
Therefore, there are only 4 basic types of
derivatives in the Jacobian.
3
We denote four sub-matrices corresponding
to these four basic types of derivatives as:
J
11
: Contains derivatives of P-equations
with respect to angles.
J
12
: Contains derivatives of P-equations
with respect to voltage magnitudes.
J
21
: Contains derivatives of Q-equations
with respect to angles.
J
22
: Contains derivatives of Q-equations
with respect to voltage magnitudes.
Therefore,



1
1
1
1
]
1




) ( ) 1 (
22
) 1 ( ) (
21
) ( ) 1 (
12
) 1 ( ) 1 (
11
) 1 2 ( ) 1 2 (
G G G
G
G G
N N N N N N N
N N N N N
N N N N
J J
J J
J (6)
The numbers above each sub-matrix in (6)
indicate its dimensions, which can be
inferred by identifying the number of
equations of that type (the number of rows
of the sub-matrix) and the number of
unknowns of that type (the number of
columns of the sub-matrix). We then
identify an individual element of each sub-
matrix as:
4
q
p
pq
q
p
pq
q
p
pq
q
p
pq
V
Q
J
V
P
J
Q
J
P
J

22 12 21 11


(7)
Note that the element J
pq
11
is not the element
in row p, column q of the submatrix J
11
,
rather it is the derivative of the real power
injection equation for bus p with respect to
the angle of bus q. Since the swing bus is
numbered 1, the Jacobian matrix will have
J
22
11
as the element in row 1, column 1. The
situation is similar for the other submatrices.
Example: Obtain the form of the Jacobian
for the 5-bus system used previously:

P
g1
P
g2
=0.8830 P
g3
=0.2076
V
1
=10
S
D3
=0.2+j0.1
S
D3
=1.7355+j0.5496 S
D3
=1.7137+j0.5983
V
4

|V
2
|

=1 |V
3
|

=1
V
5

Fig. 1
5
Solution: We previously identified the
minimal set of equations to solve as
0
0
0
0
0
0
0
) (
) (
) (
) (
) (
) (
) (
) (
) (
) (
) (
) (
) (
3
2
5
4
3
2
5 5
4 4
2 5
2 4
2 3
2 2
6
5
4
3
2
1

1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
]
1

Q
Q
P
P
P
P
Q x Q
Q x Q
P x P
P x P
P x P
P x P
x f
x f
x f
x f
x f
x f
x f
and the solution vector as
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
]
1

3
2
5
4
3
2
6
5
4
3
2
1
V
V
x
x
x
x
x
x
x

The Jacobian is the derivatives of all


equations with respect to all variables, in the
form defined by eq. (6). This results in:
6



1
1
1
1
1
1
1
1
]
1

1
1
1
]
1

22
55
22
54
21
55
21
54
21
53
21
52
22
45
22
44
21
45
21
44
21
43
21
42
12
55
12
54
11
55
11
54
11
53
12
55
12
45
12
44
11
45
11
44
11
43
12
45
12
35
12
34
11
35
11
34
11
33
11
32
12
25
12
24
11
25
11
24
11
23
11
22
2 2
22
4 2
21
2 4
12
4 4
11
6 6
J J J J J J
J J J J J J
J J J J J J
J J J J J J
J J J J J J
J J J J J J
J J
J J
J
3.0 Evaluating the elements
To evaluate the elements of the Jacobian
matrix, it is helpful to more explicitly write
out the functions of eq. (1). They are:
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
1
1
1
1
1
1
1
1
1
1
1
1
1
]
1

+
+

+
+

1
1
1
1
1
1
1
1
1
]
1

+ + + + +

+ +
N j N j N j N j N j
N
j
N
N j N j N j N j N j
N
j
N
N j N Nj j N Nj j
N
j
N
j j j j j
N
j
N N
N N
N N
Q B G V V
Q B G V V
P B G V V
P B G V V
Q x Q
Q x Q
P x P
P x P
x f
G G G G G G
G G




sin sin
sin sin
sin cos
sin cos
) (
) (
) (
) (
) (
, ,
1
1 1 , 1 1 , 1
1
1
1
2 2 2 2 2
1
2
1 1
2 2

(8)
7
So each of the four sub-matrices of the
Jacobian has elements given by the
expressions of eq. (7), respectively. These
expressions are evaluated by taking the
appropriate derivatives of the functions in
eq. (8). One might think that this represents
a formidable problem, since, based on (6),
we have (2N-1-N
G
) (2N-1-N
G
) elements in
the Jacobian and therefore the same number
of derivatives to evaluate. For a power flow
with 5000 nodes (N=5000) and 1000
generators (N
G
=1000), the Jacobian will be
8999 8999 Jacobian matrix containing
80,982,001 elements, with each element
requiring a differentiation of a function like
those represented in eq. (8)!
Fortunately, all of the derivatives can be
expressed by one of just a few
differentiations. Lets see how.
8
At first glance, one might think that there
would be four differentiations, one for each
sub-matrix. However, for each sub-matrix,
the off-diagonal terms, with p q, are
expressed differently than the diagonal
terms, with p=q. Therefore, there are eight
differentiations to perform. In obtaining
these expressions, the following tips are
helpful.
Before differentiating, pull out the term
from the summation that corresponds to
the bus injection being computed.
When differentiating a sum of terms with
respect to a particular variable, the
resulting derivative will be non-zero only
for those terms in which the variable
appears.
When differentiating with respect to the
angles, the chain rule must be properly
applied to account for the derivatives of
the trigonometric functions and the
arguments of those trigonometric
functions.
9
Each of the functions appear in the form of
f(x)=g(x)-A. Because A is a constant
(represented by P
2
,, P
N
and Q
Ng+1
,, Q
N
in eq. (8)), it has no effect on the resulting
derivatives.
The resulting expressions are given below.
( ) ) cos( ) sin(
) (
11
q p pq q p pq q p
q
p
pq
B G V V
x P
J

(9)
2
11
) (
) (
p pp p
p
p
pp
V B x Q
x P
J

(10)
( ) ) sin( ) cos(
) (
21
q p pq q p pq q p
q
p
pq
B G V V
x Q
J

(11)
2
21
) (
) (
p pp p
p
p
pp
V G x P
x Q
J

(12)
( ) ) sin( ) cos(
) (
12
q p pq q p pq p
q
p
pq
B G V
V
x P
J +

(13)
p pp
p
p
p
p
pp
V G
V
x P
V
x P
J +

) ( ) (
12
(14)
( ) ) cos( ) sin(
) (
22
q p pq q p pq p
q
p
pq
B G V
V
x Q
J

(15)
p pp
p
p
p
p
pp
V B
V
x Q
V
x Q
J

) ( ) (
22
(16)
I will derive two of the above.
10
J
pq
11
: The real power equation is:

+
n
k
k p pk k p pk k p p
B G V V P
1
) sin( ) cos(
So the function we want to differentiate is:

+ +
n
k
k p pk k p pk k p p
B G V V P f
1
) sin( ) cos(
But -P
p
is just a constant and so it will
differentiate to 0, so the derivative of the
above will be the same as the derivative of:

+
n
k
k p pk k p pk k p p
B G V V x P
1
) sin( ) cos( ) (
To obtain J
pq
11
, we take derivative with
respect to the angle at bus q. In the
summation, there is only one term that
contains
q
, and that is when k=q:
( ) ) sin( ) cos(
) (
11
q p pq q p pq q p
q q
p
pq
B G V V
x P
J

+

Using dcos(x)/d
q
=-(dx/d
q
)sin(x),
dsin(x)/d
q
=(dx/d
q
)cos(x), we obtain:
( ) ) sin( ) sin(
) (
11
q p pq q p pq q p
q
p
pq
B G V V
x P
J

J
pp
11
: As before, we are differentiating
11
( )

+
n
k
k p pk k p pk k p p
B G V V x P
1
) sin( ) cos( ) (
To obtain J
pp
11
, we take derivative with
respect to the angle at bus p. Note that in the
summation, every term contains
p
. In
addition, the term corresponding to k=p
contains two instances of
p
. So lets pull out
this term to obtain:
( )
( )
( )

+ +
+ +
+
n
p k
k
k p pk k p pk k p pp p
n
p k
k
k p pk k p pk k p
p p pp p p pp p p
B G V V G V
B G V V
B G V x P
1
2
1
2
) sin( ) cos(
) sin( ) cos(
) sin( ) cos( ) (



Now differentiate:
( )
( ) { }
( )
( )


+
+

'

+ +

n
p k
k
k p pk k p pk k p
n
p k
k
k p pk k p pk k p
n
p k
k
k p pk k p pk k p
p
n
p k
k
k p pk k p pk k p pp p
p p
p
pp
B G V V
B G V V
B G V V
B G V V G V
x P
J
1
1
1
1
2
11
) cos( ) sin(
) cos( ) sin(
) sin( ) cos(
) sin( ) cos(
) (




12
Compare the above term with the reactive
power flow equation:
) cos( ) sin(
1
k p pk k p ik
n
k
k p p
B G V V Q

What we notice is that J


pp
11
is the negative of
Q
p
, but without the term corresponding to
k=p, that is:
( )
( )
( ) ( )
pp p p pp p p
p p pp p p pp p p
n
p k
k
k p pk k p pk k p pp
B V Q B V Q
B G V Q
B G V V J
2 2
2
1
11
) cos( ) sin(
) cos( ) sin(

,
_

,
_



13

Das könnte Ihnen auch gefallen