<<

. 9
( 17)



>>

131.12 85.4 40 + j5


North Main
Lake
40.54 19.64
41.92 19.6

89.2 74.1
11.2 14.0
11.3 12.4 6.8 4.3
27.2
24.1
20.5
6.7
4.7

86.6 74.0
27.6
9.5
24.5
6.78 7.9
7.3


Elm
South
54.5 54.3

20 + j10 60 + j10
2.1
2.7

78.1
40

STATCOM-upgraded test network and power ¬‚ow results
Figure 5.16
199
STATIC SYNCHRONOUS COMPENSATOR

Bus voltages of the STATCOM-upgraded network
Table 5.5
Network bus
Nodal voltage North South Lake Main Elm
Magnitude (p.u.) 1.06 1 1 0.994 0.975
À 2.05 À 4.83 À 5.11 À 5.8
Phase angle (deg) 0




Function SSCData is as follows:

%This function is used exclusively to enter data for:
% STATIC SYNCHRONOUS COMPENSATOR (STATCOM)

% NSSC : Number of STATCOM™s
% SSCsend: STATCOM™s bus
% Xvr : Converter™s reactance (p.u.)
% TarVol: Target nodal voltage magnitude (p.u.)
% VSta : Indicate the control status over nodal voltage magnitude: 1 is
% on; 0 is off
% Psp : Target active power ¬‚ow (p.u.)
% PSta : Indicate the control status over active power: 1 is on; 0 is off
% Qsp : Target reactive power ¬‚ow (p.u.)
% QSta : Indicate the control status over reactive power:1 is on; 0 is off
% Vvr : Initial condition for the source voltage magnitude (p.u.)
% Tvr : Initial condition for the source voltage angle (deg)
% VvrHi : Lower limit source voltage magnitude (p.u.)
% VvrLo : higher limit source voltage magnitude (p.u.)

NSSC = 1;
SSCsend(1)=3; Xvr(1)=10; TarVol(1)=1.0; VSta(1)=1;
Psp(1)=0.0; PSta(1)=1; Qsp(1)=0.0; QSta(1)=0;
Vvr(1)=1.0; Tvr(1)=0.0; VvrHi(1)=1.1; VvrLo(1)=0.9;


The power ¬‚ow result indicates that the STATCOM generates 20.5 MVAR in order to
keep the voltage magnitude at 1 p.u. at Lake bus. The STATCOM parameters associated
with this amount of reactive power generation are VvR ¼ 1:0205 p.u. and vR ¼ À4:83 . Use
of the STATCOM results in an improved network voltage pro¬le, except at Elm, which is
too far away from Lake to bene¬t from the in¬‚uence of the STATCOM.
The slack generator reduces its reactive power generation by almost 6 % compared with
the base case, and the reactive power exported from North to Lake reduces by more than
30 %. The largest reactive power ¬‚ow takes place in the transmission line connecting North
and South, where 74.1 MVAR leaves North and 74 MVAR arrives at South. In general, more
reactive power is available in the network than in the base case, and the generator connected
at South increases its share of reactive power absorption compared with the base case. As
expected, active power ¬‚ows are only marginally affected by the STATCOM installation.
200 POWER FLOW INCLUDING FACTS CONTROLLERS

5.6 UNIFIED POWER FLOW CONTROLLER

The basic principle of UPFC operation has been discussed in Chapter 2. It follows from that
discussion that an equivalent circuit consisting of two coordinated synchronous voltage
sources should represent the UPFC adequately for the purpose of fundamental frequency
steady-state analysis. Such an equivalent circuit is shown in Figure 5.17. The synchronous
voltage sources represent the fundamental Fourier series component of the switched voltage
waveforms at the AC converter terminals of the UPFC (Hingorani and Gyugyi, 2000; Song
and Johns, 1999).


Vm ∠θ m
Vk ∠θ k + VcR ∠δ cR ’
ZcR
Ik Im
IcR
bus k IvR
bus m
ZvR
Re{-VvRI*vR+ VcRI*m } = 0
+
VvR ∠δ vR
_


Uni¬ed power ¬‚ow controller equivalent circuit
Figure 5.17




The UPFC voltage sources are:
EvR ¼ VvR °cos vR þ j sin vR Þ; °5:48Þ
EcR ¼ VcR °cos cR þ j sin cR Þ; °5:49Þ
where VvR and vR are the controllable magnitude (VvR min VvR VvR max ) and phase angle
(0 vR 2p) of the voltage source representing the shunt converter. The magnitude VcR
and phase angle cR of the voltage source representing the series converter are controlled
between limits (VcR min VcR VcR max Þ and °0 cR 2pÞ, respectively.
The phase angle of the series-injected voltage determines the mode of power ¬‚ow control.
If cR is in phase with the nodal voltage angle yk, the UPFC regulates the terminal voltage. If
cR is in quadature with respect to yk, it controls active power ¬‚ow, acting as a phase shifter.
If cR is in quadrature with the line current angle then it controls active power ¬‚ow, acting as
a variable series compensator. At any other value of cR, the UPFC operates as a combination
of voltage regulator, variable series compensator, and phase shifter. The magnitude of the
series-injected voltage determines the amount of power ¬‚ow to be controlled.
201
UNIFIED POWER FLOW CONTROLLER

5.6.1 Power Flow Model

Based on the equivalent circuit shown in Figure 5.17 and Equations (5.48) and (5.49), the
active and reactive power equations are (Fuerte-Esquivel and Acha, 1997; Fuerte-Esquivel,
´
Acha, and Ambriz-Perez, 2000c), at bus k:

Pk ¼ Vk Gkk þ Vk Vm ½Gkm cos°k À m Þ þ Bkm sin°k À m ފ
2

þ Vk VcR ½Gkm cos°k À cR Þ þ Bkm sin°k À cR ފ
þ Vk VvR ½GvR cos°k À vR Þ þ BvR sin°k À vR ފ; °5:50Þ

Qk ¼ ÀVk Bkk þ Vk Vm ½Gkm sin°k À m Þ À Bkm cos°k À m ފ
2

þ Vk VcR ½Gkm sin°k À cR Þ À Bkm cos°k À cR ފ
þ Vk VvR ½GvR sin°k À vR Þ À BvR cos°k À vR ފ; °5:51Þ

at bus m:

Pm ¼ Vm Gmm þ Vm Vk ½Gmk cos°m À k Þ þ Bmk sin°m À k ފ
2

þ Vm VcR ½Gmm cos°m À cR Þ þ Bmm sin°m À cR ފ; °5:52Þ

Qm ¼ ÀVm Bmm þ Vm Vk ½Gmk sin°m À k Þ À Bmk cos°m À k ފ
2

þ Vm VcR ½Gmm sin°m À cR Þ À Bmm cos°m À cR ފ; °5:53Þ

series converter:
PcR ¼ VcR Gmm þ VcR Vk ½Gkm cos°cR À k Þ þ Bkm sin°cR À k ފ
2

þ VcR Vm ½Gmm cos°cR À m Þ þ Bmm sin°cR À m ފ; °5:54Þ

QcR ¼ ÀVcR Bmm þ VcR Vk ½Gkm sin°cR À k Þ À Bkm cos°cR À k ފ
2

þ VcR Vm ½Gmm sin°cR À m Þ À Bmm cos°cR À m ފ; °5:55Þ

shunt converter:

PvR ¼ ÀVvR GvR þ VvR Vk ½GvR cos°vR À k Þ þ BvR sin°vR À k ފ; °5:56Þ
2


QvR ¼ VvR BvR þ VvR Vk ½GvR sin°vR À k Þ À BvR cos°vR À k ފ: °5:57Þ
2


Assuming loss-less converter valves, the active power supplied to the shunt converter, PvR ,
equals the active power demanded by the series converter, PcR ; that is,
PvR þ PcR ¼ 0: °5:58Þ
Furthermore, if the coupling transformers are assumed to contain no resistance then the
active power at bus k matches the active power at bus m. Accordingly,
PvR þ PcR ¼ Pk þ Pm ¼ 0: °5:59Þ

The UPFC power equations, in linearised form, are combined with those of the AC network.
For the case when the UPFC controls the following parameters: (1) voltage magnitude at the
shunt converter terminal (bus k), (2) active power ¬‚ow from bus m to bus k, and (3) reactive
202 POWER FLOW INCLUDING FACTS CONTROLLERS

power injected at bus m, and taking bus m to be a PQ bus, the linearised system of equations
is as follows:
2 32 32 3
Ák
qPk qPk qPk qPk qPk qPk qPk
ÁPk
VvR Vm VcR
6 7 6 qk qvR 76 7
qm qVvR qVm qcR qVcR
6 76 76 7
6 7 6 qPm qPm 76 Ám 7
qPm qPm qPm
6 ÁPm 7 6 76 7
6 7 6 q 76 7
0 Vm VcR 0
qm qVm qcR qVcR
6 76k 76 7
6 76 76 ÁVvR 7
6 ÁQ 7 6 qQk qQk qQk qQk qQk qQk qQk 76 7
k7 76 V 7
6 6 VvR Vm VcR
6 7 6 qk qvR 76 vR 7
qm qVvR qVm qcR qVcR
6 76 76 7
6 7 6 qQm qQm 76 ÁVm 7
qQm qQm qQm
6 ÁQm 7 ¼ 6 76 7
76 V 7;
0 Vm VcR 0
7 6 q
6 qm qVm qcR qVcR
6 76k 76 m 7
6 7 6 qP 76 7
7 6 mk qPmk qPmk qPmk qPmk
6 76 7
6 ÁPmk 7 6 76 ÁcR 7
0 Vm VcR 0
7 6 qk 76 7
6 qm qVm qcR qVcR
6 76 76 7
6 7 6 qQmk qQmk 76 7
qQmk qQmk qQmk
6 ÁQ 7 6 76 ÁVcR 7
0 Vm VcR 0
mk 7 76 7
6 6
7 6 qk qm qVm qcR qVcR
6 76 VcR 7
4 5 4 qPbb qPbb qPbb qPbb 54 5
qPbb qPbb qPbb
VvR Vm VcR
ÁPbb ÁvR
qk qm qVvR qVm qcR qVcR qvR
°5:60Þ
where ÁPbb is the power mismatch given by Equation (5.58).
If voltage control at bus k is deactivated, the third column of Equation (5.60) is replaced
by partial derivatives of the bus and UPFC mismatch powers with respect to the bus voltage
magnitude Vk . Moreover, the voltage magnitude increment of the shunt source, ÁVvR =VvR is
replaced by the voltage magnitude increment at bus k, ÁVk =Vk .
If both buses, k and m, are PQ the linearised system of equations is as follows:
32 32 3
2
Ák
qPk qPk qPk qPk qPk qPk qPk
ÁPk
Vk Vm VcR
7 6 qk qvR 76 7
6 qm qVk qVm qcR qVcR
76 76 7
6
7 6 qP 76 7
6
6 ÁPm 7 6 m qPm qPm qPm qPm qPm 76 Ám 7
76 0 76 7
6 Vk Vm VcR
7 6 qk 76 7
6 qm qVk qVm qcR qVcR
76 76 7
6
7 6 qQk qQk qQk qQk 76 ÁVk 7
6 qQk qQk qQk
6 ÁQk 7 6 76 7
7 6 q qvR 76 Vk 7
6 Vk Vm VcR
qm qVk qVm qcR qVcR
76k 76 7
6
76 76 7
6
7 6 qQm qQm qQm 76 ÁVm 7
6 qQm qQm qQm
6 ÁQm 7 ¼ 6 0 76 7
Vk Vm VcR
7 6 q 76 V 7
6 qm qVk qVm qcR qVcR
76k 76 m 7
6
76 76 7
6
7 6 qPmk qPmk qPmk 76 7
6 qPmk qPmk qPmk
6 ÁPmk 7 6 0 76 ÁcR 7
Vk Vm VcR
7 6 qk 76 7
6 qm qVk qVm qcR qVcR
76 76 7
6
7 6 qQ 76 7
6
7 6 mk qQmk qQmk qQmk qQmk qQmk 76 ÁV 7
6
6 ÁQmk 7 6 0 76 cR 7
Vk Vm VcR
7 6 qk 76 7
6 qm qVk qVm qcR qVcR
76 76 VcR 7
6
5 4 qPbb qPbb qPbb qPbb 54 5
4 qPbb qPbb qPbb
Vk Vm VcR
ÁPbb ÁvR
qk qm qVk qVm qcR qVcR qvR
°5:61Þ
In this case, VvR is maintained at a ¬xed value within prescribed limits, VvR min
VvR VvR max . The Jacobian terms in Equations (5.60) and (5.61) are given in Appendix A,
Section A.4.
203
UNIFIED POWER FLOW CONTROLLER

5.6.2 Uni¬ed Power Flow Controller Computer Program in
Matlab1 Code

Program 5.6 incorporates the UPFC model within the Newton“Raphson power ¬‚ow
program. The functions PowerFlowsData, YBus, and PQ¬‚ows are also used here. In the
main UPFC Newton“Raphson program, the function UPFCData is added to read the UPFC
data, UPFCNewtonRaphson replaces NewtonRaphson, and UPFCPQ¬‚ows is used to
calculate power ¬‚ows and losses in the UPFC.

PROGRAM 5.6 Program written in Matlab1 to incorporate the uni¬ed power ¬‚ow
controller (UPFC) model within the Newton“Raphson power ¬‚ow algorithm

% - - - Main UPFC Program

PowerFlowsData; %Function to read network data

UPFCdata; %Function to read the UPFC data

[YR,YI] = YBus(tlsend,tlrec,tlresis,tlreac,tlsuscep,tlcond,ntl,nbb);

[VM,VA,it,Vcr,Tcr,Vvr,Tvr] = UPFCNewtonRaphson(tol,itmax,ngn,nld,...
nbb,bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,YI,...
VM,VA,NUPFC,UPFCsend,UPFCrec,Xcr,Xvr,Flow,Psp,PSta,Qsp,QSta,Vcr,...
Tcr,VcrLo,VcrHi,Vvr, Tvr,VvrLo,VvrHi,VvrTar,VvrSta);

[PQsend,PQrec,PQloss,PQbus] = PQ¬‚ows(nbb,ngn,ntl,nld,genbus,...
loadbus,tlsend,tlrec,tlresis,tlreac,tlcond,tlsuscep,PLOAD,QLOAD,...
VM,VA);

[UPFC_PQsend,UPFC_PQrec,PQcr,PQvr] = PQUPFCpower(nbb,VA,VM,NUPFC,...
UPFCsend,UPFCrec,Xcr,Xvr,Vcr,Tcr,Vvr,Tvr);
%Print results
it %Number of iterations
VM %Nodal voltage magnitude (p.u.)
VA=VA*180/pi %Nodal voltage phase angles (deg)
Sources=[Vcr,Tcr*180/pi,Vvr,Tvr*180/pi] %Final source voltage para-
% meters
UPFC_PQsend %Active and reactive powers in sending bus (p.u.)
UPFC_PQrec %Active and reactive powers in receiving bus (p.u.)

%End of MAIN UPFC PROGRAM

%Carry out iterative solution using the Newton“Raphson method
function [VM,VA,it,Vcr,Tcr,Vvr,Tvr] = UPFCNewtonRaphson(tol,itmax,...
ngn,nld, nbb,bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,...
QLOAD,YR,YI,VM,VA, NUPFC,UPFCsend,UPFCrec,Xcr,Xvr,Flow,Psp,PSta,...
Qsp,QSta,Vcr,Tcr,VcrLo,VcrHi,Vvr,Tvr,VvrLo,VvrHi,VvrTar,VvrSta);
204 POWER FLOW INCLUDING FACTS CONTROLLERS

% GENERAL SETTINGS
¬‚ag = 0;
it = 1;

% CALCULATE NET POWERS
[PNET,QNET] = NetPowers(nbb,ngn,nld,genbus,loadbus,PGEN,QGEN,...
PLOAD,QLOAD);


while ( it < itmax & ¬‚ag==0 )
% CALCULATED POWERS
[PCAL,QCAL] = CalculatedPowers(nbb,VM,VA,YR,YI);


% CALCULATED UPFC POWERS
[PspQsend,PspQrec,PQcr,PQvr,PCAL,QCAL] = UPFCCalculatedpower...
(nbb,VA, VM,NUPFC,UPFCsend,UPFCrec,Xcr,Xvr,Vcr,Tcr,Vvr,Tvr,PCAL,...
QCAL);



% POWER MISMATCHES
[DPQ,DP,DQ,¬‚ag] = PowerMismatches(nbb,tol,bustype,¬‚ag,PNET,QNET,...
PCAL,QCAL);



% UPFC POWER MISMATCHES
[DPQ,¬‚ag] = UPFCPowerMismatches(¬‚ag,tol,nbb,DPQ,VM,VA,NUPFC,Flow,...
Psp,PSta,Qsp,QSta,PspQsend,PspQrec,PQcr,PQvr);
if ¬‚ag == 1
break
end
% JACOBIAN FORMATION
[JAC] = NewtonRaphsonJacobian(nbb,bustype,PCAL,QCAL,DPQ,VM,VA,YR,...
YI);

% MODIFICATION OF THE JACOBIAN FOR UPFC
[JAC] = UPFCJacobian(nbb,JAC,VM,VA,NUPFC,UPFCsend,UPFCrec,Xcr,...
Xvr,Flow,PSta,QSta,Vcr,Tcr,Vvr,Tvr,VvrSta);


% SOLVE JOCOBIAN
D = JAC\DPQ™;


% UPDATE THE STATE VARIABLES VALUES
[VA,VM] = StateVariablesUpdating(nbb,D,VA,VM,it);


% UPDATE THE TCSC VARIABLES
205
UNIFIED POWER FLOW CONTROLLER

[VM,Vcr,Tcr,Vvr,Tvr] = UPFCUpdating(nbb,VM,D,NUPFC,UPFCsend,PSta,...
QSta,Vcr,Tcr,Vvr,Tvr,VvrTar,VvrSta);

%CHECK VOLTAGE LIMITS IN THE CONVERTERS
[Vcr,Vvr] = UPFCLimits(NUPFC,Vcr,VcrLo,VcrHi,Vvr,VvrLo,VvrHi);

it = it + 1;

end


%Function to calculate injected bus powers by the UPFC
function [UPFC_PQsend,UPFC_PQrec,PQcr,PQvr,PCAL,QCAL] = UPFCCalcula...
tedpower(nbb,VA,VM,NUPFC,UPFCsend,UPFCrec,Xcr,Xvr,Vcr,Tcr,Vvr,...
Tvr,PCAL,QCAL);
for ii = 1 : NUPFC
Bkk = - 1/Xcr(ii)-1/Xvr(ii);
Bmm = -1/Xcr(ii);
Bmk = 1/Xcr(ii);
Bvr = 1/Xvr(ii);
for kk = 1 : 2
A1 = VA(UPFCsend(ii))-VA(UPFCrec(ii));
A2 = VA(UPFCsend(ii))-Tcr(ii);
A3 = VA(UPFCsend(ii))-Tvr(ii);
% Computation of Conventional Terms
Pkm = VM(UPFCsend(ii))*VM(UPFCrec(ii))*Bmk*sin(A1);
Qkm = - VM(UPFCsend(ii))^2*Bkk - VM(UPFCsend(ii))*VM(UPFCrec(ii))...
*Bmk*cos(A1);
% Computation of Shunt Converters Terms
Pvrk = VM(UPFCsend(ii))*Vvr(ii)*Bvr*sin(A3);
Qvrk = - VM(UPFCsend(ii))*Vvr(ii)*Bvr*cos(A3);
if kk == 1
% Computation of Series Converters Terms
Pcrk = VM(UPFCsend(ii))*Vcr(ii)*Bmk*sin(A2);
Qcrk = - VM(UPFCsend(ii))*Vcr(ii)*Bmk*cos(A2);
%Power in bus k
Pk = Pkm + Pcrk + Pvrk;
Qk = Qkm + Qcrk + Qvrk;
UPFC_PQsend(ii) = Pk + Qk*i;
PCAL(UPFCsend(ii)) = PCAL(UPFCsend(ii)) + Pk;
QCAL(UPFCsend(ii)) = QCAL(UPFCsend(ii)) + Qk;
%Power in Series Converter
Pcr = Vcr(ii)*VM(UPFCsend(ii))*Bmk*sin(-A2);
Qcr = - Vcr(ii)^2*Bmm - Vcr(ii)*VM(UPFCsend(ii))*Bmk*cos(-A2);
%Power in Shunt Converter
Pvr = Vvr(ii)*VM(UPFCsend(ii))*Bvr*sin(-A3);
Qvr = Vvr(ii)^2*Bvr - Vvr(ii)*VM(UPFCsend(ii))*Bvr*cos(-A3);
PQvr(ii) = Pvr + Qvr*i;
206 POWER FLOW INCLUDING FACTS CONTROLLERS

else
% Computation of Series Converters Terms
Pcrk = VM(UPFCsend(ii))*Vcr(ii)*Bkk*sin(A2);
Qcrk = - VM(UPFCsend(ii))*Vcr(ii)*Bkk*cos(A2);
%Power in bus m
Pcal = Pkm + Pcrk;
Qcal = Qkm + Qcrk;
UPFC_PQrec(ii) = Pcal + Qcal*i;
PCAL(UPFCsend(ii)) = PCAL(UPFCsend(ii)) + Pcal;
QCAL(UPFCsend(ii)) = QCAL(UPFCsend(ii)) + Qcal;
%Power in Series Converter
Pcr = Pcr + Vcr(ii)*VM(UPFCsend(ii))*Bkk*sin(-A2);
Qcr = Qcr - VM(UPFCsend(ii))*Vcr(ii)*Bkk*cos(-A2);
PQcr(ii) = Pcr + Qcr*i;
end
send = UPFCsend(ii);
UPFCsend(ii) = UPFCrec(ii);
UPFCrec(ii) = send;
Beq = Bmm;
Bmm = Bkk;
Bkk = Beq;
end
end


%Function to compute power mismatches with UPFC
function [DPQ,¬‚ag] = UPFCPowerMismatches(¬‚ag,tol,nbb,DPQ,VM,VA,...
NUPFC,Flow,Psp,PSta,Qsp,QSta,UPFC_PQsend,UPFC_PQrec,PQcr,PQvr);
iii = 0;
for ii = 1 : NUPFC
index = 2*(nbb + ii) + iii;
if PSta(ii) == 1
if Flow(ii) == 1
DPQ(index-1) = Psp(ii) - real(UPFC_PQsend(ii));
else
DPQ(index-1) = - Psp(ii) - real(UPFC_PQrec(ii));
end
else
DPQ(index-1) = 0;
end

if QSta(ii) == 1
if Flow(ii) == 1
DPQ(index) = Qsp(ii) - imag(UPFC_PQrec(ii));
else
DPQ(index) = - Qsp(ii) - imag(UPFC_PQrec(ii));
end
207
UNIFIED POWER FLOW CONTROLLER

else
DPQ(index) = 0;
end

DPQ(index + 1) = - real(PQcr(ii) + PQvr(ii));
iii=iii+1;
end
% Check for convergence
if ( abs(DPQ) < tol )
¬‚ag = 1;
end


%Function to add the UPFC elements to the Jacobian matrix
function [JAC] = UPFCJacobian(nbb,JAC,VM,VA,NUPFC,UPFCsend,...
UPFCrece,Xcr,Xvr,Flow,PSta,QSta,Vcr,Tcr,Vvr,Tvr,VvrSta);
iii = 0;



for ii = 1 : NUPFC
indexQ=2*(nbb + ii) + iii;
indexP=indexQ-1;
indexL=indexQ + 1;
if VvrSta(ii) == 1
JAC(:,2*UPFCsend(ii)) = 0.0;
end
Bmm = - 1/Xcr(ii)-1/Xvr(ii);
Bkk = -1/Xcr(ii);
Bmk = 1/Xcr(ii);
Bvr = 1/Xvr(ii);
for kk = 1 : 2
A1 = VA(UPFCsend(ii))-VA(UPFCrece(ii));
A2 = VA(UPFCsend(ii))-Tcr(ii);
A3 = VA(UPFCsend(ii))-Tvr(ii);
% Computation of Conventional Terms
Hkm = - VM(UPFCsend(ii))*VM(UPFCrece(ii))*Bmk*cos(A1);
Nkm = VM(UPFCsend(ii))*VM(UPFCrece(ii))*Bmk*sin(A1);
% Computation of Shunt Converters Terms
Hvr = -VM(UPFCsend(ii))*Vvr(ii)*Bvr*cos(A3);
Nvr = VM(UPFCsend(ii))*Vvr(ii)*Bvr*sin(A3);
% Computation of Series Converters Terms
if kk == 1
Hcr = - VM(UPFCsend(ii))*Vcr(ii)*Bmk*cos(A2);
Ncr = VM(UPFCsend(ii))*Vcr(ii)*Bmk*sin(A2);
else
Hcr = - VM(UPFCsend(ii))*Vcr(ii)*Bkk*cos(A2);
208 POWER FLOW INCLUDING FACTS CONTROLLERS

Ncr = VM(UPFCsend(ii))*Vcr(ii)*Bkk*sin(A2);
end
if kk == 1
JAC(2*UPFCsend(ii)-1,2*UPFCsend(ii)-1) = JAC(2*UPFCsend...
(ii)-1, 2*UPFCsend(ii)-1) - VM(UPFCsend(ii))^2*Bmm;
if VvrSta(ii) == 1
JAC(2*UPFCsend(ii)-1,2*UPFCsend(ii)) = Nvr;
JAC(2*UPFCsend(ii),2*UPFCsend(ii)) = Hvr;
else
JAC(2*UPFCsend(ii)-1,2*UPFCsend(ii)) = JAC(2*UPFCsend(ii)-1,...
2*UPFCsend(ii)) - Nkm + Nvr;
JAC(2*UPFCsend(ii),2*UPFCsend(ii)) = JAC(2*UPFCsend...
(ii),2*UPFCsend(ii)) - Hkm + Hvr + 2*VM(UPFCsend(ii))^2*Bmk;
end
JAC(2*UPFCsend(ii)-1,indexL) = Hvr;
JAC(2*UPFCsend(ii),indexL) = - Nvr;
else
JAC(2*UPFCsend(ii)-1,2*UPFCsend(ii)-1) = JAC(2*UPFCsend...
(ii)-1,2*UPFCsend(ii)-1) + VM(UPFCsend(ii))^2*Bmk;
JAC(2*UPFCsend(ii),2*UPFCsend(ii)) = JAC(2*UPFCsend(ii),...
2*UPFCsend(ii)) + VM(UPFCsend(ii))^2*Bmk;

JAC(2*UPFCsend(ii)-1,indexL) = 0.0;
JAC(2*UPFCsend(ii),indexL) = 0.0;
end

JAC(2*UPFCsend(ii)-1,2*UPFCrece(ii)-1) = JAC(2*UPFCsend(ii)-1,...
2*UPFCrece(ii)-1) + Hkm;
JAC(2*UPFCsend(ii),2*UPFCrece(ii)-1) = JAC(2*UPFCsend(ii),...
2*UPFCrece(ii)-1) - Nkm;
if VvrSta(ii) == 1 & kk == 2
JAC(2*UPFCsend(ii)-1,2*UPFCrece(ii)) = 0.0;
JAC(2*UPFCsend(ii),2*UPFCrece(ii)) = 0.0;
else
JAC(2*UPFCsend(ii)-1,2*UPFCrece(ii)) = JAC(2*UPFCsend(ii)-1,...
2*UPFCrece(ii)) + Nkm;
JAC(2*UPFCsend(ii),2*UPFCrece(ii)) = JAC(2*UPFCsend(ii),...
2*UPFCrece(ii)) + Hkm;
end

% Computation of Active Power Controlled Jacobian™s Terms
if PSta(ii) == 1
if (Flow(ii) == 1 & kk == 1) j (Flow(ii) == -1 & kk == 2)
if kk == 1
JAC(indexP, 2*UPFCsend(ii)-1) = - Hkm - Hcr - Hvr;
JAC(indexP, 2*UPFCsend(ii)) = - Nkm + Ncr;
209
UNIFIED POWER FLOW CONTROLLER

JAC(indexP, 2*UPFCrece(ii)-1) = - Hkm;
if VvrSta(ii) == 1
JAC(indexP, 2*UPFCrece(ii)) = 0.0;
else
JAC(indexP, 2*UPFCrece(ii)) = Nkm;
end
JAC(indexP, indexP) = Hcr;
if QSta(ii) == 1
JAC(indexP, indexQ) = Ncr;
else
JAC(indexP, indexQ) = 0.0;
end
else
JAC(indexP, 2*UPFCsend(ii)-1) = - Hkm - Hcr;
JAC(indexP, 2*UPFCsend(ii)) = Nkm + Ncr;
JAC(indexP, 2*UPFCrece(ii)-1) = Hkm;
if VvrSta(ii) == 1
JAC(indexP, 2*UPFCrece(ii)) = 0.0;
else
JAC(indexP, 2*UPFCrece(ii)) = Nkm;
end
JAC(indexP, indexP) = Hcr;
if QSta(ii) == 1
JAC(indexP, indexQ) = Ncr;
else
JAC(indexP, indexQ) = 0.0;
end
JAC(indexP, indexL) = 0.0;
end
end
JAC(2*UPFCsend(ii)-1, indexP) = + Hcr;
JAC(2*UPFCsend(ii), indexP) = - Ncr;
else
JAC(indexP, indexP) = 1.0;
end
% Computation of Rective Power Controlled Jacobian™s Terms
if QSta(ii) == 1
if (Flow(ii) == 1 & kk == 1) j (Flow(ii) == -1 & kk == 2)
if kk == 1
JAC(indexQ, 2*UPFCsend(ii)-1) = - Nkm + Ncr;
JAC(indexQ, 2*UPFCsend(ii)) = - 2*VM(UPFCsend(ii))^2*Bmm - ...
Hkm + Hcr;
JAC(indexQ, 2*UPFCrece(ii)-1) = Nkm;
JAC(indexQ, indexQ) = Hcr;
if VvrSta(ii) == 1
JAC(indexQ, 2*UPFCrece(ii)) = 0.0;
210 POWER FLOW INCLUDING FACTS CONTROLLERS

else
JAC(indexQ, 2*UPFCrece(ii)) = Hkm;
end
if PSta(ii) == 1
JAC(indexQ, indexP) = - Ncr;
else
JAC(indexQ, indexP) = 0.0;
end
else
JAC(indexQ, 2*UPFCsend(ii)-1) = Nkm + Ncr;
JAC(indexQ, 2*UPFCsend(ii)) = - 2*VM(UPFCsend(ii)) ...
^2*Bkk + Hkm + Hcr;
JAC(indexQ, 2*UPFCrece(ii)-1) = - Nkm;
JAC(indexQ, indexQ) = Hcr;
if VvrSta(ii) == 1
JAC(indexQ, 2*UPFCrece(ii)) = 0.0;
else
JAC(indexQ, 2*UPFCrece(ii)) = Hkm;
end
if PSta(ii) == 1
JAC(indexQ, indexP) = - Ncr;
else
JAC(indexQ, indexP) = 0.0;
end
end
end
JAC(2*UPFCsend(ii)-1, indexQ) = Ncr;
JAC(2*UPFCsend(ii), indexQ) = Hcr;
else
JAC(indexQ, indexQ) = 1.0;
end
temp = UPFCsend(ii);
UPFCsend(ii) = UPFCrece(ii);
UPFCrece(ii) = temp;
end
A1 = Tcr(ii) - VA(UPFCsend(ii));
A2 = Tcr(ii) - VA(UPFCrece(ii));
A3 = Tvr(ii) - VA(UPFCsend(ii));

Hcrk = - Vcr(ii)*VM(UPFCsend(ii))*Bmk*cos(A1);
Ncrk = Vcr(ii)*VM(UPFCsend(ii))*Bmk*sin(A1);
Hcrm = Vcr(ii)*VM(UPFCrece(ii))*Bmk*cos(A2);
Ncrm = - Vcr(ii)*VM(UPFCrece(ii))*Bmk*sin(A2);
Hvrk = - Vvr(ii)*VM(UPFCsend(ii))*Bvr*cos(A3);
Nvrk = Vvr(ii)*VM(UPFCsend(ii))*Bvr*sin(A3);
JAC(indexL, 2*UPFCsend(ii)-1) = Hcrk + Hvrk;
if VvrSta == 1
211
UNIFIED POWER FLOW CONTROLLER

JAC(indexL, 2*UPFCsend(ii)) = Nvrk;
else
JAC(indexL, 2*UPFCsend(ii)) = Nvrk + Ncrk;
end
JAC(indexL, 2*UPFCrece(ii)-1) = Hcrm;
JAC(indexL, 2*UPFCrece(ii)) = Ncrm;
JAC(indexL, indexL) = - Hvrk;
if PSta == 1
JAC(indexL, indexP) = - Hcrk - Hcrm;
else
JAC(indexL, indexP) = 0.0;
end
if QSta == 1
JAC(indexL, indexQ) = Ncrk + Ncrm;
else
JAC(indexL, indexP) = 0.0;
end
iii = iii + 1;
end

%Function to update the UPFC state variables
function [VM,Vcr,Tcr,Vvr,Tvr] = UPFCUpdating(nbb,VM,D,NUPFC,...
UPFCsend,PSta, QSta,Vcr,Tcr,Vvr,Tvr,VvrTar,VvrSta);
iii = 0;

for ii = 1 : NUPFC
indexQ=2*(nbb + ii) + iii;
indexP=indexQ-1;
indexL=indexQ + 1;


if PSta(ii) == 1
Tcr(ii) = Tcr(ii) + D(indexP);
end
if QSta(ii) == 1
Vcr(ii) = Vcr(ii) + D(indexQ)*Vcr(ii);
end
if VvrSta(ii) == 1
Vvr(ii) = Vvr(ii) + D(2*UPFCsend(ii),1)*Vvr(ii);
VM(UPFCsend(ii)) = VvrTar(ii);
end
Tvr(ii) = Tvr(ii) + D(indexL);
iii = iii +1;
end


%Function to check the voltage sources limits in the UPFC
function [Vcr,Vvr] = UPFCLimits(NUPFC,Vcr,VcrLo,VcrHi,Vvr,VvrLo,...
VvrHi);
212 POWER FLOW INCLUDING FACTS CONTROLLERS

for ii = 1 : NUPFC
% Check Magnitude Voltage Limits
if abs(Vcr(ii)) < VcrLo(ii) j abs(Vcr(ii)) > VcrHi(ii)
if abs(Vcr(ii)) < VcrLo(ii)
Vcr(ii) = VcrLo(ii);
elseif abs(Vcr(ii)) > VcrHi(ii)
Vcr(ii) = VcrHi(ii);
end
end
if abs(Vvr(ii)) < VvrLo(ii) j abs(Vvr(ii)) > VvrHi(ii)
if abs(Vvr(ii)) < VvrLo(ii)
Vvr(ii) = VvrLo(ii);
elseif abs(Vvr(ii)) > VvrHi(ii)
Vvr(ii) = VvrHi(ii);
end
end
end



%Function to calculate the power ¬‚ows in the UPFC controller
function [UPFC_PQsend,UPFC_PQrec,PQcr,PQvr] = PQUPFCpower(nbb,...
VA,VM, NUPFC,UPFCsend,UPFCrec,Xcr,Xvr,Vcr,Tcr,Vvr,Tvr);
for ii = 1 : NUPFC
Bkk = - 1/Xcr(ii)-1/Xvr(ii);
Bmm = -1/Xcr(ii);
Bmk = 1/Xcr(ii);
Bvr = 1/Xvr(ii);
for kk = 1 : 2
A1 = VA(UPFCsend(ii))-VA(UPFCrec(ii));
A2 = VA(UPFCsend(ii))-Tcr(ii);
A3 = VA(UPFCsend(ii))-Tvr(ii);
% Computation of Conventional Terms
Pkm = VM(UPFCsend(ii))*VM(UPFCrec(ii))*Bmk*sin(A1);
Qkm = - VM(UPFCsend(ii))^2*Bkk - VM(UPFCsend(ii))...
*VM(UPFCrec(ii))*Bmk*cos(A1);
% Computation of Shunt Converters Terms
Pvrk = VM(UPFCsend(ii))*Vvr(ii)*Bvr*sin(A3);
Qvrk = - VM(UPFCsend(ii))*Vvr(ii)*Bvr*cos(A3);
if kk == 1
% Computation of Series Converters Terms
Pcrk = VM(UPFCsend(ii))*Vcr(ii)*Bmk*sin(A2);
Qcrk = - VM(UPFCsend(ii))*Vcr(ii)*Bmk*cos(A2);
%Power in bus k
Pk = Pkm + Pcrk + Pvrk;
Qk = Qkm + Qcrk + Qvrk;
UPFC_PQsend(ii) = Pk + Qk*i;
%Power in Series Converter
213
UNIFIED POWER FLOW CONTROLLER

Pcr = Vcr(ii)*VM(UPFCsend(ii))*Bmk*sin(-A2);
Qcr = - Vcr(ii)^2*Bmm - Vcr(ii)*VM(UPFCsend(ii))*Bmk*cos(-A2);
%Power in Shunt Converter
Pvr = Vvr(ii)*VM(UPFCsend(ii))*Bvr*sin(-A3);
Qvr = Vvr(ii)^2*Bvr - Vvr(ii)*VM(UPFCsend(ii))*Bvr*cos(-A3);
PQvr(ii) = Pvr + Qvr*i;
else
% Computation of Series Converters Terms
Pcrk = VM(UPFCsend(ii))*Vcr(ii)*Bkk*sin(A2);
Qcrk = - VM(UPFCsend(ii))*Vcr(ii)*Bkk*cos(A2);
%Power in bus m
Pcal = Pkm + Pcrk;
Qcal = Qkm + Qcrk;
UPFC_PQrec(ii) = Pcal + Qcal*i;
%Power in Series Converter
Pcr = Pcr + Vcr(ii)*VM(UPFCsend(ii))*Bkk*sin(-A2);
Qcr = Qcr - VM(UPFCsend(ii))*Vcr(ii)*Bkk*cos(-A2);
PQcr(ii) = Pcr + Qcr*i;
end
send = UPFCsend(ii);
UPFCsend(ii) = UPFCrec(ii);
UPFCrec(ii) = send;
Beq = Bmm;
Bmm = Bkk;
Bkk = Beq;
end
end




5.6.3 Numerical Example of Power Flow Control using One
Uni¬ed Power Flow Controller

The ¬ve-bus network is modi¬ed to include one UPFC to compensate the transmission line
linking bus Lake and bus Main. The modi¬ed network is shown in Figure 5.18. The UPFC is
used to maintain active and reactive powers leaving the UPFC, towards Main, at 40 MW and
2 MVAR, respectively. Moreover, the UPFC shunt converter is set to regulate the nodal
voltage magnitude at Lake at 1 p.u.
The starting values of the UPFC voltage sources are taken to be VcR ¼ 0:04 p.u.,
cR ¼ 87:13 , VvR ¼ 1 p.u., and vR ¼ 0 . Information on how to determine the starting
values for these voltage sources is given in Section 5.8.1. The source impedances have
values of XcR ¼ XvR ¼ 0:1 p.u.
Convergence is obtained in ¬ve iterations to a power mismatch tolerance of 1eÀ 12. The
UPFC upheld its target values. The power ¬‚ow results are shown in Figure 5.18, and the bus
voltages are given in Table 5.6.
The data given in function PowerFlowsData in Section 4.3.9 are modi¬ed to
accommodate for the inclusion of the UPFC. Furthermore, function UPFCData is used to
214 POWER FLOW INCLUDING FACTS CONTROLLERS

131.48 45 + j15
85.76 40 + j5


Lake
North Main
50.34 48.43 40.0 39.84
40.0 Lakefa

81.14 76.42 17.79 2.0 3.49
9.34 8.92
0.34
36.57 13.46
11.71 13.63

1.85
78.84 75.87 13.74
12.97
37.48 1.78 13.31 4.71


Elm
South
46.69
47.61

20 + j10 60 + j10
5.29
5.14

75.49
40

Five-bus test network with one uni¬ed power ¬‚ow controller, and power ¬‚ow result
Figure 5.18


Bus voltages of modi¬ed network
Table 5.6
System bus
Nodal voltage North South Lake Lakefa Main Elm
Magnitude (p.u.) 1.06 1.00 1.00 0.997 0.992 0.975
À 1.77 À 6.02 À 2.51 À 3.19 À 4.97
Phase angle (deg) 0




enter UPFC data:

%This function is used exclusively to enter data for:
% UNIFIED POWER FLOW CONTROLLER

% NUPFC : Number of UPFC™s
% UPFCsend : Shunt converter™s bus and series converter™ sending bus
% UPFCrec : Series converter™ receiving bus
% Xcr : Inductive reactance of Shunt impedance (p.u.)
% Xvr : Inductive reactance of Series impedance (p.u.)
% Flow : Power ¬‚ow direction : 1 is for sending to receiving bus
215
UNIFIED POWER FLOW CONTROLLER

% -1 indicates opposite direction
% Psp : Target active power ¬‚ow (p.u.)
% PSta : control status for active power : 1 is on; 0 is off
% Qsp : Target reactive power ¬‚ow (p.u.)
% QSta : control status for reactive power : 1 is on; 0 is off
% Vcr : Initial condition for the series source voltage magnitude (p.u.)
% Tcr : Initial condition for the series source voltage angle (rad.)
% VcrLo : Lower limit of series source voltage magnitude (p.u.)
% VcrHi : Higher limit of series source voltage magnitude (p.u.)
% Vvr : Initial condition to the shunt source voltage magnitude (p.u.)
% Tvr : Initial condition to the shunt source voltage angle (rad.)
% VvrLo : Lower limit of shunt source voltage magnitude (p.u.)
% VvrHi : Higher limit of shunt source voltage magnitude (p.u)
% VvrTar : Target nodal voltage magnitude to be controlled by shunt ...
% branch (p.u.)
% VvrSta : Control status for nodal voltage magnitude: 1 is on; o is off

NUPFC=1;
UPFCsend(1)=3; UPFCrec(1)=6; Xcr(1)=0.1; Xvr(1)=0.1;
Flow(1)=-1; Psp(1)=0.4; PSta(1)=1; Qsp(1)=0.02; QSta(1)=1;
Vcr(1)=0.04; Tcr(1)=-87.13/57.3; VcrLo(1)=0.001; VcrHi(1)=0.2;
Vvr(1)=1.0; Tvr(1)=0.0; VvrLo(1)=0.9; VvrHi(1)=1.1;
VvrTar(1)=1.0; VvrSta(1)=1;

As expected, the power ¬‚ows in the UPFC-upgraded network differ with respect to the
original case. The most noticeable changes are as follows: there is a 32 % increase of active
power ¬‚owing towards Lake through transmission lines North“Lake and South“Lake.
The increase is in response to the large amount of active power demanded by the UPFC
series converter. The maximum amount of active power exchanged between the UPFC and
the AC system will depend on the robustness of the UPFC shunt bus, Lake. Since the UPFC
generates its own reactive power, the generator at North decreases its reactive power
generation by 5.6 %, and the generator connected at South increases its absorption of
reactive power by 22.6 %.
The maximum absolute power mismatches in the system buses and UPFC are shown
in Table 5.7. It must be noted that the selected UPFC initial conditions are very good


Table 5.7 Maximum power mismatches in the bus system and uni¬ed power
¬‚ower controller (UPFC)
Buses UPFC
ÁP ÁQ ÁPmk ÁQmk PcR þ PvR
Iteration
7.745e À 1 1.401e À 1 5.0e À 04 4.0e À 02
1 0
1.89e À 2 1.001e À 2 5.1e À 03 6.5e À 02 5.7e À 03
2
3.8e À 03 5.1e À 04 3.7e À 03 5.0e À 04 8.6e À 05
3
1.2e À 07 1.6e À 06 1.2e À 07 1.6e À 6 1.2e À 07
4
1.3e À 12 1.9e À 13 1.2e À 12 1.8e À 13 1.3e À 14
5
216 POWER FLOW INCLUDING FACTS CONTROLLERS

estimates, since the UPFC mismatches have small values from the outset of the iterative
process.
For completeness Table 5.8 shows the variation of the controllable voltage sources during
the iterative process.


Variation of ideal source voltages
Table 5.8
Series source Shunt source
cR (deg) vR (deg)
Iteration VcR (p.u.) VvR (p.u.)
À 87.12
1 0.04 1 0
À 97.54 À 5.8882
2 0.1004 1.0134
À 92.71 À 6.0051
3 0.1009 1.0174
À 92.73 À 6.0055
4 0.1013 1.0173
À 92.73 À 6.0055
5 0.1013 1.0173




5.7 HIGH-VOLTAGE DIRECT-CURRENT-BASED VOLTAGE
SOURCE CONVERTER

From the principles of HVDC-VSC operation outlined in Chapter 2 it may be argued that for
the purpose of fundamental frequency analysis each converter station may be adequately
represented by a complex voltage source VvR behind its transformer reactance XvR
(impedance ZvR ). Similar to the case for the STATCOM, and UPFC, the synchronous
voltage sources represent the fundamental Fourier series component of the switched voltage
waveforms at the AC converter terminals of the HVDC-VSC.
The two voltage sources work in a coordinated fashion, and this fact is taken into account
by the mismatch power equation in the equivalent circuit shown in Figure 5.19. This circuit
is used to derive the mathematical model of the HVDC-VSC for inclusion in the power ¬‚ow
Newton“Raphson algorithm.
The complex voltage sources representing the two VSC stations in the HVDC-VSC are:

EvR1 ¼ VvR1 °cos vR1 þ j sin vR1 Þ; °5:62Þ
EvR2 ¼ VvR2 °cos vR1 þ j sin vR2 Þ: °5:63Þ

In the current application, the voltage sources have the following voltage magnitudes
and phase angle limits: 0 VvR1 VvR1 max ; 0 vR1 2; 0 VvR2 VvR2 max ;
0 vR2 2.
The constraining power equation for the back-to-back HVDC-VSC (i.e. RDC ¼ 0) is
È É
à Ã
Re VvR1 IvR1 þ VvR2 IvR2 ¼ 0; °5:64Þ

and for the case when both VSC stations are linked by a DC cable (i.e. RDC > 0) is
È É
à Ã
Re VvR1 IvR1 þ VvR2 IvR2 þ PDC;loss ¼ 0: °5:65Þ
217
HIGH-VOLTAGE DIRECT-CURRENT-BASED VOLTAGE SOURCE CONVERTER


Vm ∠θ m
Vk ∠θ k

Ik Im

Bus k Bus m
IvR2
IvR1
ZvR1 ZvR2

+ +
VvR1 ∠δ vR1 VvR 2 ∠δ vR 2
_ _



{V }=0


I k + VvR 2 I m + V
Re I
vR1 DC DC

High-voltage direct-current based voltage source converter equivalent circuit
Figure 5.19




5.7.1 Power Equations

If it is assumed that the power ¬‚ows from the station connected at bus k (recti¬er) to the
station connected at bus m (inverter), the power ¬‚ow equations injected at bus k are:
Pk ¼ Vk GvR1 þ Vk VvR1 ½GvR1 cos°k À vR1 Þ þ BvR1 sin°k À vR1 ފ; °5:66Þ
2


Qk ¼ ÀVk BvR1 þ Vk VvR1 ½GvR1 sin°k À vR1 Þ À BvR1 cos°k À vR1 ފ: °5:67Þ
2


The powers ¬‚owing into the recti¬er are described by the following equations:
PvR1 ¼ VvR1 GvR1 þ VvR1 Vk ½GvR1 cos°vR1 À k Þ þ BvR1 sin°vR1 À k ފ; °5:68Þ
2


QvR1 ¼ ÀVvR1 BvR1 þ VvR1 Vk ½GvR1 sin°vR1 À k Þ À BvR1 cos°vR1 À k ފ: °5:69Þ
2


The power equations for bus m and for the inverter are obtained by exchanging the
subscripts k and vR1 for m and vR2, respectively.
Moreover, one further equation is required to represent the power constraint given in the
form of either Equation (5.64) or Equation (5.65), depending on the application. For the case
of the full HVDC-VSC, the relevant power equation is:
PvR1 þ PvR2 þ PDC ¼ 0: °5:70Þ
It should be remarked that for the purpose of power ¬‚ow studies the equivalent circuit of one
leg of the HVDC-VSC shown in Figure 5.19 is closely related to the equivalent circuit of the
STATCOM (see Section 5.5.1).
As described in Chapter 4, an n-bus power network with no voltage and power ¬‚ow
regulation provisions is described by a 2 ‚ °n À 1Þ nonlinear system of equations.
218 POWER FLOW INCLUDING FACTS CONTROLLERS

Moreover, for each HVDC-VSC that exists in the power network the 2 ‚ °n À 1Þ system of
equations is augmented by up to ¬ve equations to take account of the two converter stations
and the power constraint equation that exists on the DC side of the converters. The solution
of the combined system of nonlinear equations is carried out by iteration using the Newton“
Raphson method, enabling quadratic convergent solutions.
Both converter stations are capable of controlling the amount of active power injected at
their respective AC buses. In a given power ¬‚ow solution, one of the converters is designated
to be the master station, with the other converter being the slave station. Moreover, both
stations have control over either voltage magnitude or reactive power injected at their
connecting buses.
For the HVDC-VSC, when active power is regulated at the recti¬er end and voltage
magnitude is regulated at the inverter end, the linearised system of equations has the
following structure:
2 32 32 3
qPk qPk qPk qPk Ák
ÁPk
Vk VvR1 0 76
6 7 6 qk 7
qVk qvR1 qVvR1
6 76 76 7
6 7 6 qQ 76 ÁVk 7
qQk qQk qQk
6 ÁQk 7 6 76 7
k
6 76 0 76 V 7
Vk VvR1
6 7 6 qk 76 k7
qVk qvR1 qVvR1
6 76 76 7
6 7 6 qPvR1 76 7
qPvR1 qPvR1 qPvR1
6 ÁPvR 7 ¼ 6 0 76 ÁvR1 7;
Vk VvR1
6 7 6 q 76 7
qVk qvR1 qVvR1
6 76 76 7
k
6 76 76 7
7 6 qQvR1 qQvR1 qQvR1 qQvR1
6 76 ÁV 7
6 ÁQvR 7 6 0 76 vR1 7
Vk VvR1
6 7 6 qk 76 7
qVk qvR1 qVvR1
6 76 76 VvR1 7
4 5 4 qPHVDC qPHVDC qPHVDC 54 5
qPHVDC qPHVDC
Vk VvR1
ÁPHVDC ÁvR2
qk qVk qvR1 qVvR1 qvR2
°5:71Þ

where ÁPHVDC , given by

ÁPHVDC ¼ ÁPvR1 À ÁPvR2 ;
is the active power ¬‚ow mismatch for the DC link. Notice that, since active power is
regulated at the recti¬er end (i.e. ÁPvR1 ¼ Pspec À Pcalc ), the corresponding active power
vR1 vR1
equations of the inverter become redundant (i.e. ÁPvR2 and ÁPm ) and are not used in
Equation (5.71). Moreover, since the voltage magnitude at bus m is kept constant the
reactive power equations of the inverter also become redundant (i.e. ÁQvR2 and ÁQPm ).
The relevant Jacobian elements are given in Appendix A, Section A.5.



5.7.2 High-voltage Direct-current-based Voltage Source Converter
Computer Program in Matlab1 Code

Program 5.7 incorporates the HVDC model within the Newton“Raphson power ¬‚ow
program. The functions PowerFlowsData, YBus, and PQ¬‚ows are also used here. In the
main HVDC Newton“Raphson program, the function HVDCData is added to read the HVDC
data, HVDCNewtonRaphson replaces NewtonRaphson, and HVDCPQ¬‚ows is used to
calculate power ¬‚ows and losses in the HVDC.
219
HIGH-VOLTAGE DIRECT-CURRENT-BASED VOLTAGE SOURCE CONVERTER

PROGRAM 5.7 Program written in Matlab1 to incorporate the high-voltage direct-
current (HVDC) model within the Newton“Raphson power ¬‚ow algorithm.

% - - - Main HVDC Program

PowerFlowsData;

HVDCdata;

[YR,YI] = YBus(tlsend,tlrec,tlresis,tlreac,tlsuscep,tlcond,ntl,nbb);

[VM,VA,it,Vvr1,Tvr1,Vvr2,Tvr2] = HVDCNewtonRaphson(tol,itmax,ngn,...
nld,nbb,bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,...
YI,VM,VA,NHVDC, HVDCsend,HVDCrec,Xvr1,Xvr2,Rcd,TarVol1,VSta1,Qsp1,...
QSta1,TarVol2,VSta2, Qsp2,QSta2,Psp,Vvr1,Tvr1,Vvr2,Tvr2,VvrHi,...
VvrLo);

[PQsend,PQrec,PQloss,PQbus] = PQ¬‚ows(nbb,ngn,ntl,nld,genbus,...
loadbus,tlsend,tlrec,tlresis,tlreac,tlcond,tlsuscep,PLOAD,QLOAD,...
VM,VA);

[HVDC_PQsend,HVDC_PQrec] = HVDCPQpower(nbb,VA,VM,NHVDC,HVDCsend,...
HVDCrec,Xvr1,Xvr2,Vvr1,Tvr1,Vvr2,Tvr2);

%Print results
it %Number of iterations
VM %Nodal voltage magnitude (p.u)
VA=VA*180/pi %Nodal voltage phase angles (deg)
Sources=[Vv1,Tvr1*180/pi,Vvr2,Tvr2*180/pi] %Final source voltage
% parameters
HVDC_PQsend %Active and reactive powers in sending bus (p.u.)
HVDC_PQrec %Active and reactive powers in receiving bus (p.u.)

%End of MAIN HVDC PROGRAM

%Carry out iterative solution using the Newton“Raphson method
function [VM,VA,it,Vvr1,Tvr1,Vvr2,Tvr2] = NewtonRaphson(tol,itmax,...
ngn,nld, nbb,bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,...
QLOAD,YR,YI,VM,VA, NHVDC,HVDCsend,HVDCrece,Xvr1,Xvr2,Rcd,TarVol1,...
VSta1,Qsp1,QSta1,TarVol2, VSta2,Qsp2,QSta2,Psp,Vvr1,Tvr1,Vvr2,...
Tvr2,VvrHi,VvrLo);

% GENERAL SETTINGS
¬‚ag = 0;
it = 1;

% CALCULATE NET POWERS
[PNET,QNET] = NetPowers(nbb,ngn,nld,genbus,loadbus,PGEN,QGEN,...
PLOAD,QLOAD);
220 POWER FLOW INCLUDING FACTS CONTROLLERS

while ( it < itmax & ¬‚ag==0 )
% CALCULATED POWERS
[PCAL,QCAL] = CalculatedPowers(nbb,VM,VA,YR,YI);


%STATCOM CALCULATED POWERS
[PCAL,QCAL,PHVDC,QHVDC] = HVDCCalculatePowers(PCAL,QCAL,VM,VA,...
NHVDC, HVDCsend,HVDCrece,Xvr1,Xvr2,Vvr1,Tvr1,Vvr2,Tvr2);


% POWER MISMATCHES
[DPQ,DP,DQ,¬‚ag] = PowerMismatches(nbb,tol,bustype,¬‚ag,PNET,QNET,...
PCAL,QCAL);


%HVDC POWER MISMATCHES
[DPQ,¬‚ag] = HVDCMismatches(¬‚ag,tol,DPQ,nbb,VM,VA,NHVDC, HVDCsend,...
HVDCrece,TarVol1,VSta1,TarVol2,VSta2,Psp,Qsp1,QSta1,Qsp2,QSta2,...
PHVDC, QHVDC);
if ¬‚ag == 1
break
end


% JACOBIAN FORMATION
[JAC] = NewtonRaphsonJacobian(nbb,bustype,PCAL,QCAL,DPQ,VM,VA,...
YR,YI);


% HVDC JACOBIAN
[JAC] = HVDC_Jacobian(nbb,JAC,VM,VA,NHVDC,HVDCsend,HVDCrece,...
Xvr1,Xvr2,Rcd,VSta1,VSta2,QSta1,QSta2,Vvr1,Tvr1,Vvr2,Tvr2);



% SOLVE FOR THE STATE VARIABLES VECTOR
D = JAC\DPQ™;


% UPDATE THE STATE VARIABLES VALUES, WITH TRUNCATED CORRECTIONS IF
% NECESSARY (VM increments < +-0.1 p.u. and VA inrements < +- 5 deg)
[VA,VM] = StateVariablesUpdating(nbb,D,VA,VM,it);


%UPDATE HVDC STATE VARIABLES
[VM,Vvr1,Tvr1,Vvr2,Tvr2] = HVDC_Updating(nbb,D,VM,VA,NHVDC,...
HVDCsend,HVDCrece,QSta1, QSta2,VSta1,TarVol1,TarVol2,VSta2,Vvr1,...
Tvr1,Vvr2,Tvr2);
%CHECK VOLTAGE CONVERTERS FOR LIMITS
[Vvr1,Vvr2] = HVDCLimits(NHVDC,Vvr1,Vvr2,VvrLo,VvrHi);
221
HIGH-VOLTAGE DIRECT-CURRENT-BASED VOLTAGE SOURCE CONVERTER

it = it + 1;

end


%Function to calculate injected bus powers by the HVDC
function [PCAL,QCAL,PHVDC,QHVDC] = HVDCCalculatePowers(PCAL,QCAL,...
VM,VA,NHVDC,HVDCsend,HVDCrece,Xvr1,Xvr2,Vvr1,Tvr1,Vvr2,Tvr2);
for ii = 1 : NHVDC
for kk = 1 : 2
Bkk = -1/Xvr1(ii);
Bvr = 1/Xvr1(ii);
A = VA(HVDCsend(ii)) - Tvr1(ii);

PHVDC(ii,kk) = VM(HVDCsend(ii))*Vvr1(ii)*Bvr*sin(A);
QHVDC(ii,kk) = - VM(HVDCsend(ii))^2*Bkk - VM(HVDCsend(ii))...
*Vvr1(ii)*Bvr*cos(A);

PCAL(HVDCsend(ii)) = PCAL(HVDCsend(ii)) + PHVDC(ii,kk);
QCAL(HVDCsend(ii)) = QCAL(HVDCsend(ii)) + QHVDC(ii,kk);

HVDCsend(ii) = HVDCrece(ii);
Xvr1(ii) = Xvr2(ii);
Tvr1(ii) = Tvr2(ii);
Vvr1(ii) = Vvr2(ii);
end
end


%Function to compute power mismatches with HVDC
function [DPQ,¬‚ag] = HVDCMismatches(¬‚ag,tol,DPQ,nbb,VM,VA,NHVDC,...
HVDCsend,HVDCrece,TarVol1,VSta1,TarVol2,VSta2,Psp,Qsp1,QSta1,...
Qsp2,QSta2,PHVDC,QHVDC);
iii = 0;
for ii = 1 : NHVDC
index= 2*(nbb + ii) + iii;
DPQ(index-1) = Psp(ii) - PHVDC(ii,1);

DPQ(index) = Qsp1(ii) - QHVDC(ii,1);

DPQ(index + 1) = - Psp(ii) - PHVDC(ii,2);

DPQ(index + 2) = Qsp2(ii) - QHVDC(ii,2);
iii = iii + 2;
end
% Check for convergence
222 POWER FLOW INCLUDING FACTS CONTROLLERS

if ( abs(DPQ) < tol )
¬‚ag = 1;
end


%Function to add up the HVDC elements to Jacobian matrix
function [JAC] = HVDC_Jacobian(nbb,JAC,VM,VA,NHVDC,HVDCsend,...
HVDCrece, Xvr1,Xvr2,Rcd,VSta1,VSta2,QSta1,QSta2,Vvr1,Tvr1,Vvr2,Tvr2);
iii = 0;
for ii = 1 : NHVDC
index= 2*(nbb + ii) + iii;
for kk = 1 : 2
if VSta1(ii) == 1
JAC(: , 2*HVDCsend(ii) )=0;
end
JAC(index-1,index-1) = 1;
JAC(index,index) = 1;

Bvr = 1/Xvr1(ii);
A1 = Tvr1(ii)-VA(HVDCsend(ii));
A2 = VA(HVDCsend(ii))-Tvr1(ii);

Pcal = - VM(HVDCsend(ii))*Vvr1(ii)*Bvr*sin(A2);
Qcal = Vvr1(ii)*VM(HVDCsend(ii))*Bvr*cos(A2);
Phvdc = - Vvr1(ii)*VM(HVDCsend(ii))*Bvr*sin(A1);
Qhvdc = Vvr1(ii)*VM(HVDCsend(ii))*Bvr*cos(A1);

JAC(2*HVDCsend(ii)-1,2*HVDCsend(ii)-1) = JAC(2*HVDCsend(ii)-1,...
2*HVDCsend(ii)-1) + VM(HVDCsend(ii))^2*Bvr;
if (QSta1(ii) == 1 )
JAC(2*HVDCsend(ii),2*HVDCsend(ii)) = JAC(2*HVDCsend(ii),...
2*HVDCsend(ii)) + VM(HVDCsend(ii))^2*Bvr;
else
JAC(2*HVDCsend(ii)-1,2*HVDCsend(ii)) = JAC(2*HVDCsend(ii)-1,...
2*HVDCsend(ii)) + Phvdc;
JAC(2*HVDCsend(ii),2*HVDCsend(ii)) = JAC(2*HVDCsend(ii),...
2*HVDCsend(ii)) - Qhvdc;
JAC(2*HVDCsend(ii),2*HVDCsend(ii)-1) = JAC(2*HVDCsend(ii),...
2*HVDCsend(ii)-1) - Phvdc;
end
JAC(2*HVDCsend(ii)-1,index-1) = - Qcal;
JAC(index-1,2*HVDCsend(ii)-1) = Qhvdc;
JAC(index-1,2*HVDCsend(ii)) = Phvdc;
JAC(index-1,index-1) = - Qhvdc;
if (QSta1(ii) == 1)
JAC(index-1,index) = Phvdc;
JAC(2*HVDCsend(ii),index-1) = Pcal;
223
HIGH-VOLTAGE DIRECT-CURRENT-BASED VOLTAGE SOURCE CONVERTER

else
JAC(index-1,index) = 0.0 ;
JAC(2*HVDCsend(ii),index-1) = - Phvdc;
end
if (QSta1(ii) == 1)
JAC(2*HVDCsend(ii)-1,index) = - Pcal;
JAC(2*HVDCsend(ii),index) = - Qcal;
JAC(index,2*HVDCsend(ii)-1) = - Phvdc;
JAC(index,2*HVDCsend(ii)) = Qhvdc;
JAC(index,index) = -2*Vvr1(ii)^2*Bvr + Qhvdc;
JAC(index,index-1) = Phvdc;
end
HVDCsend(ii) = HVDCrece(ii);
Xvr1(ii) = Xvr2(ii);
Vvr1(ii) = Vvr2(ii);
Tvr1(ii) = Tvr2(ii);
VSta1(ii) = VSta2(ii);
QSta1(ii) = QSta2(ii);
index = index + 2;
end
iii = iii + 2;
end



%Function to update HVDC state variables
function [VM,Vvr1,Tvr1,Vvr2,Tvr2] = HVDC_Updating(nbb,D,VM,VA,NHVDC,...
HVDCsend,HVDCrece,QSta1,QSta2,VSta1,TarVol1,TarVol2,VSta2,Vvr1,...
Tvr1,Vvr2, Tvr2);
iii =0;
for ii = 1 : NHVDC
index = 2*(nbb + ii) + iii;
if (VSta1(ii) == 1)
% Adjust the Volatge Magnitud target
Vvr1(ii) = Vvr1(ii) + Vvr1(ii)*D(2*HVDCsend(ii));
VM(HVDCsend(ii)) = TarVol1(ii);
Tvr1(ii) = Tvr1(ii) + D(index-1);
else
Vvr1(ii) = Vvr1(ii) + Vvr1(ii)*D(index);
Tvr1(ii) = VA(HVDCsend(ii));
end
if (VSta2(ii) == 1)
% Adjust the Volatge Magnitud target
Vvr2(ii) = Vvr2(ii) + Vvr1(ii)*D(2*HVDCrece(ii));
VM(HVDCsend(ii)) = TarVol2(ii);
Tvr2(ii) = Tvr2(ii) + D(index + 2);
else
Vvr2(ii) = Vvr2(ii) + Vvr2(ii)*D(index + 2);
224 POWER FLOW INCLUDING FACTS CONTROLLERS

Tvr2(ii) = Tvr2(ii) + D(index + 1);
end
end

%Function to check voltagesources limits in HVDC controllers
function [Vvr1,Vvr2] = HVDCLimits(NHVDC,Vvr1,Vvr2,VvrLo,VvrHi);
for ii = 1 : NHVDC
% Check Magnitude Voltage Limits
for kk = 1 : 2
if Vvr1(ii) < VvrLo(ii) j Vvr1(ii) > VvrHi(ii)
if Vvr1(ii) < VvrLo(ii)
Vvr1(ii) = VvrLo(ii);
elseif Vvr1(ii) > VvrHi(ii)
Vvr1(ii) = VvrHi(ii);
end
end

temp = Vvr1(ii);
Vvr1(ii) = Vvr2(ii);
Vvr2(ii) = temp;
end
end

%Function to calculate the power ¬‚ows in HVDC controller
function [HVDC_PQsend,HVDC_PQrece] = HVDCPQpower(nbb,VA,VM,NHVDC,...
HVDCsend, HVDCrece,Xvr1,Xvr2,Vvr1,Tvr1,Vvr2,Tvr2);
for ii = 1: NHVDC
for kk = 1: 2
Bkk = -1/Xvr1(ii);
Bvr = 1/Xvr1(ii);
A = VA(HVDCsend(ii)) - Tvr1(ii);
PHVDC(ii) = VM(HVDCsend(ii))*Vvr1(ii)*Bvr*sin(A);
QHVDC(ii) = - VM(HVDCsend(ii))^2*Bkk “ (HVDCsend(ii))*Vvr1(ii)...
*Bvr*cos(A);

if kk == 1
HVDC_PQsend(ii) = PHVDC(ii) + i*QHVDC(ii);
else
HVDC_PQrece(ii) = PHVDC(ii) + i*QHVDC(ii);
end

HVDCsend(ii) = HVDCrece(ii);
Xvr1(ii) = Xvr2(ii);
Vvr1(ii) = Vvr2(ii);
Tvr1(ii) = Tvr2(ii);
end
end
225
HIGH-VOLTAGE DIRECT-CURRENT-BASED VOLTAGE SOURCE CONVERTER

<<

. 9
( 17)



>>