<<

. 8
( 17)



>>

1
°5:26Þ
Bkm ¼ Bmk ¼ XTCSC ;
1


and for capacitive operation the signs are reversed.
The active and reactive power equations at bus k are:

Pk ¼ Vk Vm Bkm sin°k À m Þ; °5:27Þ
Qk ¼ ÀVk Bkk À Vk Vm Bkm cos°k À m Þ: °5:28Þ
2


For the power equations at bus m, the subscripts k and m are exchanged in Equations (5.27)
and (5.28).
In Newton“Raphson solutions these equations are linearised with respect to the series
reactance. For the condition shown in Figure 5.9, where the series reactance regulates the
amount of active power ¬‚owing from bus k to bus m at a value Preg , the set of linearised
km
power ¬‚ow equations is:
2 32 32 3
Ák
ÁPk qPk qPk qPk qPk qPk
Vk Vm XTCSC 76
6 7 6 qk 7
qm qVk qVm qXTCSC
6 76 76 7
6 7 6 qP 76 7
qPm qPm qPm qPm
6 ÁPm 7 6 76 Ám 7
m
6 76 XTCSC 76 7
Vk Vm
7 6 qk qm qVk qVm qXTCSC
6 76 7
6 76 76 7
6 7 6 qQk 76 ÁV 7
qQk qQk qQk qQk
6 ÁQk 7 ¼ 6 XTCSC 76 k 7;
Vk Vm
6 7 6 qk 76 7
qm qVk qVm qXTCSC
6 76 76 V k 7
6 7 6 qQm 76 7
qQm qQm qQm qQm
6 76 XTCSC 76 ÁVm 7
6 ÁQm 7 6 76 7
Vk Vm
7 6 qk qm qVk qVm qXTCSC
6 7 6 Vm 7
6 7 6 XTCSC 76 7
4 5 4 qPkm 54 ÁXTCSC 5
qPXTCSC qPXTCSC qPXTCSC qPXTCSC
km km km km
Vk Vm XTCSC
ÁPXTCSC qk qm qVk qVm qXTCSC XTCSC
km
°5:29Þ
173
THYRISTOR-CONTROLLED SERIES COMPENSATOR

where ÁPXTCSC
km


ÁPXTCSC ¼ Preg À PXTCSC ; cal ;
km km km

is the active power ¬‚ow mismatch for the series reactance; ÁXTCSC , given by

°iÞ °iÀ1Þ
ÁXTCSC ¼ XTCSC À XTCSC ;

is the incremental change in series reactance; and PXTCSC ; cal is the calculated power as given
km
by Equation (5.27). The Jacobian elements for the series reactance are given in Appendix A,
Section A.2.
The state variable XTCSC of the series controller is updated at the end of each iterative step
according to
 
ÁXTCSC °iÞ °iÀ1Þ
°iÞ °iÀ1Þ
¼ þ XTCSC : °5:30Þ
XTCSC XTCSC
XTCSC




5.4.2 Thyristor-controlled Series Compensator Computer
Program in Matlab1 Code

Program 5.3 incorporates the TCSC variable series reactance model within the Newton“
Raphson power ¬‚ow program. The functions PowerFlowsData, YBus, and PQ¬‚ows are
also used here. In the main TCSC Newton“Raphson program, the function TCSCPower-
FlowsData is added to read the TCSC data, TCSCNewtonRaphson replaces Newton-
Raphson, and TCSCPQ¬‚ows is used to calculate power ¬‚ows and losses in the TCSC
model.


PROGRAM 5.3 Program written in Matlab1 to incorporate the thyristor-controlled series
compensator (TCSC) variable reactance model within the Newton“Raphson power ¬‚ow
algorithm

% - - - Main TCSC variable reactance

PowerFlowsData; %Function to read network data

TCSCData; %Function to read TCSC variable series reactance

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


[VM,VA,it,X] = TCSCNewtonRaphson(tol,itmax,ngn,nld,nbb,bustype,...
genbus, loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,...
YI,VM,VA,NTCSC, TCSCsend, TCSCrec,X,XLo,XHi,Flow,Psp,PSta);
174 POWER FLOW INCLUDING FACTS CONTROLLERS

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



[Ptcsc,Qtcsc] = TCSCPQ¬‚ows(nbb,VA,VM,NTCSC,TCSCsend,TCSCrec,X);


%Print results
it %Number of iterations
VM %Nodal voltage magnitude (p.u)
VA=VA*180/pi %Nodal voltage phase angles (Deg)
Ptcsc %Active power ¬‚ow in TCSC (p.u.)
Qtcsc %Reactive power ¬‚ow in TCSC (p.u.)
X %Final reactance value (p.u.)


%End of TCSC MAIN PROGRAM


%Carry out iterative solution using the Newton“Raphson method
function [VM,VA,it,X] = TCSCNewtonRaphson(tol,itmax,ngn,nld,nbb,...
bustype, genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,YI,...
VM,VA,NTCSC, TCSCsend,TCSCrec,X,XLo,XHi,Flow,Psp,PSta);


% 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 TCSC POWERS
[TCSC_PQsend,TCSC_PQrec,PCAL,QCAL]=TCSCCalculatedpower(nbb,VA,...
VM,NTCSC,TCSCsend,TCSCrec,X,PCAL,QCAL);



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

% TCSC POWER MISMATCHES
[DPQ,¬‚ag]=TCSCPowerMismatches(¬‚ag,tol,nbb,DPQ,VM,VA,NTCSC,...
TCSCsend,TCSCrec,X,Flow,it,Psp,PSta);

%Check for convergence
if ¬‚ag == 1
break
end

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

% MODIFICATION THE JACOBIAN FOR TCSC
[JAC]=TCSCJacobian(nbb,JAC,VM,VA,NTCSC,TCSCsend,TCSCrec,X,...
Flow,PSta,it);

% SOLVE JOCOBIAN
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 THE TCSC VARIABLES
[X]=TCSCUpdating(it,nbb,D,NTCSC,X,PSta);

%CHECK IMPEDANCE FOR LIMITS
[X]=TCSCLimits(NTCSC,X,XLo,XHi,PSta);

it = it + 1;
end


%Function to calculate injected bus powers by the TCSC
function [TCSC_PQsend,TCSC_PQrec,PCAL,QCAL] = TCSCCalculatedpower...
(nbb,VA, VM,NTCSC,TCSCsend,TCSCrec,X,PCAL,QCAL);
for ii = 1 : NTCSC
Bmm = - 1/X(ii);
Bmk = 1/X(ii);
for kk = 1 : 2
A = VA(TCSCsend(ii))-VA(TCSCrec(ii));
Pcal = VM(TCSCsend(ii))*VM(TCSCrec(ii))*Bmk*sin(A);
Qcal = - VM(TCSCsend(ii))^2*Bmm - VM(TCSCsend(ii))*...
VM(TCSCrec(ii))*Bmk*cos(A);
PCAL(TCSCsend(ii)) = PCAL(TCSCsend(ii)) + Pcal;
QCAL(TCSCsend(ii)) = QCAL(TCSCsend(ii)) + Qcal;
if kk == 1
TCSC_PQsend(ii) = Pcal + j*Qcal;
176 POWER FLOW INCLUDING FACTS CONTROLLERS

else
TCSC_PQrec(ii) = Pcal + j*Qcal;
end
send = TCSCsend(ii);
TCSCsend(ii) = TCSCrec(ii);
TCSCrec(ii) = send;
end
end


%Function to compute power mismatches with TCSC
function [DPQ,¬‚ag] = TCSCPowerMismatches(¬‚ag,tol,nbb,DPQ,VM,VA,...
NTCSC, TCSCsend,TCSCrec,TCSCX,Flow,it,TCSC_P,PSta);
if it > 1
for ii = 1 : NTCSC
if PSta(ii) == 1
Bmk = 1/TCSCX(ii);
for kk = 1 : 2
A = VA(TCSCsend(ii)) - VA(TCSCrec(ii));
Pcal = VM(TCSCsend(ii))*VM(TCSCrec(ii))*Bmk*sin(A);
if (Flow(ii) == 1 & kk == 1) | (Flow(ii) == -1 & kk == 2)
DPQ(1, 2*nbb + ii) = TCSC_P(ii) - Pcal;
break;
end
send = TCSCsend(ii);
TCSCsend(ii) = TCSCrec(ii);
TCSCrec(ii) = send;
end
else
DPQ(1, 2*nbb + ii)= 0;
end
end
end


%Function to add the TCSC elements to Jacobian matrix
function [JAC] = TCSCJacobian(nbb,JAC,VM,VA,NTCSC,TCSCsend,...
TCSCrec,X,Flow, PSta,it);
for ii = 1 : NTCSC
Bmm = - 1/X(ii);
Bmk = 1/X(ii);
for kk = 1 : 2
A = VA(TCSCsend(ii))-VA(TCSCrec(ii));
Hkm = - VM(TCSCsend(ii))*VM(TCSCrec(ii))*Bmm*cos(A);
Nkm = VM(TCSCsend(ii))*VM(TCSCrec(ii))*Bmm*sin(A);

JAC(2*TCSCsend(ii)-1, 2*TCSCsend(ii)-1) = JAC(2*TCSCsend(ii)-1,...
2*TCSCsend(ii)-1) - VM(TCSCsend(ii))^2*Bmm;
177
THYRISTOR-CONTROLLED SERIES COMPENSATOR

JAC(2*TCSCsend(ii)-1, 2*TCSCrec(ii)-1) = JAC(2*TCSCsend(ii)-1,...
2*TCSCrec(ii)-1) - Hkm;
JAC(2*TCSCsend(ii)-1, 2*TCSCrec(ii)) = JAC(2*TCSCsend(ii)-1,...
2*TCSCrec(ii)) - Nkm;
JAC(2*TCSCsend(ii), 2*TCSCsend(ii)) = JAC(2*TCSCsend(ii),...
2*TCSCsend(ii)) - VM(TCSCsend(ii))^2*Bmm;
JAC(2*TCSCsend(ii), 2*TCSCrec(ii)-1) = JAC(2*TCSCsend(ii),...
2*TCSCrec(ii)-1) + Nkm;
JAC(2*TCSCsend(ii), 2*TCSCrec(ii)) = JAC(2*TCSCsend(ii),...
2*TCSCrec(ii)) - Hkm;
if it > 1
if PSta(ii) == 1
if (Flow(ii) == 1 & kk == 1 )j (Flow(ii) == -1 & kk == 2)
JAC(2*nbb + ii, 2*TCSCsend(ii)-1) = Hkm;
JAC(2*nbb + ii, 2*TCSCsend(ii)) = - Nkm;
JAC(2*nbb + ii, 2*TCSCrec(ii)-1) = - Hkm;
JAC(2*nbb + ii, 2*TCSCrec(ii)) = - Nkm;
JAC(2*nbb + ii, 2*nbb + ii) = + Nkm;
end
JAC(2*TCSCsend(ii)-1, 2*nbb + ii) = Nkm;
JAC(2*TCSCsend(ii), 2*nbb + ii) = Hkm - VM(TCSCsend(ii))^2*Bmk;
else
JAC(2*nbb + ii, 2*nbb + ii) = 1;
end
end
send = TCSCsend(ii);
TCSCsend(ii) = TCSCrec(ii);
TCSCrec(ii) = send;
end
end


%Function to update TCSC state variable
function [X]= TCSCUpdating(it,nbb,D,NTCSC,X,PSta);
if it > 1
for ii = 1 : NTCSC
if PSta(ii) == 1
X(ii) = X(ii) + D(2*nbb + ii,1)*X(ii);
end
end
end


%Function to check the impedance limits
function [X] = TCSCLimits(NTCSC,X,XLo,XHi,PSta);
for ii = 1 : NTCSC
% Check impedance Limits
if X(ii) < XLo(ii) | X(ii) > XHi(ii)
178 POWER FLOW INCLUDING FACTS CONTROLLERS

PSta(ii) = 0;
if X(ii) < XLo(ii)
X(ii) = XLo(ii);
elseif X(ii) > XHi(ii)
X(ii) = XHi(ii);
end
end
end



%Function to calculate power ¬‚ows in TCSC controller
function [Ptcsc,Qtcsc] = TCSCPQ¬‚ows(nbb,VA,VM,NTCSC,TCSCsend,...
TCSCrec,TCSCX);
for ii = 1 : NTCSC
Bmk = 1/TCSCX(ii);
Bmm = -1/TCSCX(ii);
for kk = 1 : 2
A = VA(TCSCsend(ii)) - VA(TCSCrec(ii));
Ptcsc(ii,kk) = VM(TCSCsend(ii))*VM(TCSCrec(ii))*Bmk*sin(A);
Qtcsc(ii,kk) = - VM(TCSCsend(ii))^2*Bmm “ M(TCSCsend(ii))*VM...
(TCSCrec(ii))*Bmk*cos(A);
send = TCSCsend(ii);
TCSCsend(ii) = TCSCrec(ii);
TCSCrec(ii) = send;
end
end




5.4.3 Numerical Example of Active Power Flow Control using
One Thyristor-controlled Series Compensator: Variable
Series Compensator Model

The original ¬ve-bus network is modi¬ed to include one TCSC to compensate the
transmission line connected between Lake and Main. An extra bus, termed Lakefa, is used
to connect the TCSC, as shown in Figure 5.10.
The TCSC is used to maintain active power ¬‚owing from Lakefa towards Main at 21 MW.
The starting value of the TCSC is set at 50 % of the value of the transmission-line inductive
reactance (i.e. X ¼ 0.015 p.u.). Convergence is obtained in 6 iterations to a power mismatch
tolerance of 1e À 12. The TCSC upholds the target value of 21 MW, which is achieved with
70 % series capacitive compensation of the transmission line Lake“Main.
The power ¬‚ow results are shown in Figure 5.10, and the nodal voltages are given in
Table 5.3. As expected, nodal voltage magnitudes and reactive power ¬‚ows do not change
appreciably compared with the base case. It should be noticed that transmission line Lake“
Main may not be the best candidate for series capacitive compensation since an increase of
8.2 % in active power has been achieved at the expense of 70 % compensation.
179
THYRISTOR-CONTROLLED SERIES COMPENSATOR

45 + j15
131.12 90.93 40 + j5


Main
North Lake 21.0 70% 21.0
40.9 20.9
42.4

88.6 74.2
Lakefa 2.51
16.7 17.3 2.41 4.31
7.13 0.41
25.1
26.2
8e-4

1.09
73.2
86.2
26.6
2.7
25.4
5.05
7.08
1.56


Elm
South 52.92
54.1

20 + j1 60 + j10
4.9
5.6

61.80
40

Power ¬‚ow results of the ¬ve-bus network with one thyristor-controlled series
Figure 5.10
compensator

Bus voltages of the modi¬ed network
Table 5.3

Network bus
Nodal voltage North South Lake Main Elm
Magnitude (p.u.) 1.06 1 0.987 0.988 0.984
À 2.04 À 4.72 À 4.46 À 4.81
Phase angle (deg) 0




The data given in function PowerFlowsData (Section 4.3.9) is modi¬ed to
accommodate the inclusion of the TCSC. The transmission line originally connected
between Lake and Main is now connected between Lakefa (bus 6) and Main (bus 4). Only
the modi¬ed code lines are shown here:
Function PowerFlowsData is as follows:

%Modi¬cations to enter data for the TCSC:

nbb=6;
bustype(6)=3; VM(6)=1; VA(6)=0;
tlsend(6)=6; tlrec(6)=4; tlresis(6)=0.01; tlreac(6)=0.03;
tlcond(6)=0; tlsuscep6)=0.02;
180 POWER FLOW INCLUDING FACTS CONTROLLERS

Additionally, the function TCSCData is used for entering the TCSC data:

% This function is used exclusively to enter data for:
% THYRISTOR CONTROLLED SERIES COMPENSATOR reactance variable

% NTCSC : Number of TCSC™s
% TCSCsend : Sending bus
% TCSCrec : Receiving bus
% X : TCSC™s reactance
% XLo : Lower reactance limit
% XHi : Higher reactance limit
% Flow : Power ¬‚ow direction: 1 is for sending to receiving bus; -1
% indicates opposite direction
% Psp : Active power ¬‚ow to be controlled
% PSta : Indicates control status for active power: 1 is on and 0 is off

NTCSC=1;
TCSCsend(1)=3; TCSCrec(1)=6; X(1)=-0.015; XLo(1)=-0.05;
XHi(1)=0.05;
Flow(1)=1; Psp(1)=0.21; PSta(1)=1;


5.4.4 Firing-angle Power Flow Model

The model presented in Section 5.4.1 uses the concept of an equivalent series reactance to
represent the TCSC. Once the value of reactance is determined using Newton™s method then
the associated ¬ring angle TCSC can be calculated. Of course, this makes engineering sense
only in cases when all the modules making up the TCSC have identical design
characteristics and are made to operate at equal ¬ring angles. If this is the case, the
computation of the ¬ring angle is carried out. However, such calculation involves an
iterative solution since the TCSC reactance and ¬ring angle are nonlinearly related. One
way to avoid the additional iterative process is to use the alternative TCSC power ¬‚ow
model presented in this section.
The fundamental frequency equivalent reactance XTCSC°1Þ of the TCSC module shown in
´
Figure 5.11 is (Fuerte-Esquivel, Acha, and Ambriz-Perez, 2000):
XTCSC°1Þ ¼ À XC þ C1 f2°p À Þ þ sin½2°p À ފg
À C2 cos2 °p À Þf$ tan½$°p À ފ À tan°p À Þg; °5:31Þ
where
XC þ XLC
C1 ¼ ; °5:32Þ
p
2
4XLC
C2 ¼ ; °5:33Þ
XL p
XC XL
XLC ¼ ; °5:34Þ
XC À XL
 1=2
XC
$¼ : °5:35Þ
XL
181
THYRISTOR-CONTROLLED SERIES COMPENSATOR

XC
k m
Ik Im
ILOOP

Vk Vm

XL
Figure 5.11 Thyristor-controlled series compensator module. Reproduced, with permission, from
´
C.R. Fuerte-Esquivel, E. Acha, and H. Ambriz-Perez, ˜A Thyristor Controlled Series Compensator
Model for the Power Flow Solution of Practical Power Networks™, IEEE Trans. Power Systems 15(1)
58“64, # 2000 IEEE




The equivalent reactance XTCSC°1Þ in Equation (5.31) replaces XTCSC in Equations (5.26) and
(5.25), and the TCSC active and reactive power equations at bus k are

Pk ¼ Vk Vm Bkm ° f 1Þ sin°k À m Þ; °5:36Þ
Qk ¼ ÀVk Bkk ° f 1Þ À Vk Vm Bkm ° f 1Þ cos°k À m Þ; °5:37Þ
2



where
Bkk°1Þ ¼ ÀBkm°1Þ ¼ BTCSC°1Þ : °5:38Þ

For equations at bus m, exchange subscripts k and m in Equations (5.36) and (5.37).
For the case when the TCSC controls active power ¬‚owing from bus k to bus m, at a
speci¬ed value, the set of linearised power ¬‚ow equations is:
2 3 2 32 3
ÁPk qPk qPk qPk qPk qPk Ák
6 7 6 q Vk Vm
q 76 7
qm qVk qVm
6 76 76 7
k
6 7 6 qP qPm 76 7
qPm qPm qPm
6 ÁPm 7 6 76 Ám 7
m
6 76 Vk Vm
q 76 7
6 7 6 qk qm qVk qVm 76 7
6 76 76 7
6 7
6 ÁQk 7 ¼ 6 qQk qQk qQk qQk qQk 76 7
76 ÁVk 7;
7 6 qk Vk Vm
6
76 q 76 7
qm qVk qVm
6
7 6 qQ 76 Vk 7
6
76 qQm 76 7
qQm qQm qQm
6
6 ÁQm 7 6 76 7
m
Vk Vm
7 6 qk q 76 ÁVm 7
qm qVk qVm
6
7 6 TCSC 76 7
6
5 4 qPkm qP TCSC 54 Vm 5
qP TCSC qP TCSC qP TCSC
4 km km km km
Vk Vm Á TCSC
ÁP TCSC qk qm qVk qVm q TCSC
km
°5:39Þ

where ÁP TCSC , given by
km

ÁP TCSC ¼ Preg À Pkm ; cal ;
TCSC
km km
182 POWER FLOW INCLUDING FACTS CONTROLLERS

is the active power ¬‚ow mismatch for the TCSC module; Á TCSC , given by
°iþ1Þ °iÞ
Á TCSC ¼ TCSC À TCSC ;
is the incremental change in the TCSC ¬ring angle at the ith iteration; and Pkm ; cal is the
TCSC

calculated power as given by Equation (5.36). The Jacobian elements for the series
reactance, as a function of the ¬ring angle TCSC , are given in Appendix A, Section A.2.


5.4.5 Thyristor-controlled Series Compensator Firing-angle
Computer Program in Matlab1 Code

Program 5.4 incorporates the thyristor-controlled series compensator ¬ring-angle (TCSC-
FA) variable series reactance model within the Newton“Raphson power ¬‚ow program. The
functions PowerFlowsData, YBus, and PQ¬‚ows are also used here. In the main TCSC-FA
Newton“Raphson program, the function TCSCFAData is added to read the TCSC-FA data,
TCSCFANewtonRaphson replaces NewtonRaphson, and TCSCFAPQ¬‚ows is used to
calculate power ¬‚ows and losses in the TCSC model.

PROGRAM 5.4 Program written in Matlab1 to incorporate the thyristor-controlled series
compensator ¬ring-angle (TCSC-FA) model within the Newton“Raphson power ¬‚ow algorithm

% - - - Main TCSC-FA Program

PowerFlowsData; %Function to read network data

TCSCFAData; % Function to read TCSC-FA data

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

[VM,VA,it,FA,X]=TCSCFANewtonRaphson(tol,itmax,ngn,nld,nbb,...
bustype,genbus, loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,YI,VM,...
VA,NTCSCFA,TCSCFAsend, TCSCFArec,Xc,Xl,FA,FALo,FAHi,Flow,PSta,Psp);

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

[Ptcsc,Qtcsc]=TCSCPQpower(VA,VM,NTCSCFA,TCSCFAsend,TCSCFArec,X);
%Print results
it %Number of iterations
VM %Nodal voltage magnitude (p.u)
VA=VA*180/pi %Nodal voltage phase angles (deg)
Ptcsc %Active power ¬‚ow in TCSC (p.u.)
Qtcsc %Reactive power ¬‚ow in TCSC (p.u.)
X %Final reactance value (p.u.)
FA %Final ¬ring angle value (deg)

% End of MAIN TCSC-FA PROGRAM
183
THYRISTOR-CONTROLLED SERIES COMPENSATOR

%Carry out iterative solution using the Newton“Raphson method
[VM,VA,it,FA,X] = TCSCFANewtonRaphson(tol,itmax,ngn,nld,nbb,...
bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,YI,VM,...
VA,NTCSCFA,TCSCFAsend,TCSCFArec,Xc,Xl,FA,FALo,FAHi,Flow,PSta,Psp);


% 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);

%TCSC CALCULATED POWER
[PCAL,QCAL,X]=TCSCFACalculatePower(PCAL,QCAL,VM,VA,NTCSCFA,...
TCSCFAsend,TCSCFArec,FA,Xc,Xl,Flow,PSta,Psp);


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

% TCSC POWER MISMATCHES
[DPQ,¬‚ag]=TCSCFAPowerMismatches(¬‚ag,tol,nbb,DPQ,VM,VA,NTCSCFA,...
TCSCFAsend,TCSCFArec,X,Flow,it,Psp,PSta);

%Check for convergence
if ¬‚ag == 1
break
end

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

% MODIFICATION JACOBIAN FOR TCSC-FA -it calculates the TCSC
% equivalent reactance
[JAC]=TCS CFAJacobian(it,nbb,JAC,VM,VA,NTCSCFA,TCSCFAsend,...
TCSCFArec, FA,Xc,Xl,Flow,PSta,Psp,X);
% SOLVE JOCOBIAN
D = JAC\DPQ™;
184 POWER FLOW INCLUDING FACTS CONTROLLERS

% 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 THE TCSC-FA VARIABLES
[FA] = TCSCFAUpdating(it,nbb,D,NTCSCFA,FA,PSta);

%CHECK IMPEDANCE LIMITS
[FA] = TCSCFALimits(NTCSCFA,FA,FALo,FAHi,PSta);

it = it + 1;
end


%Function to calculate injected bus powers by TCSC-FA
function [PCAL,QCAL,X] = TCSCFACalculatePower(PCAL,QCAL,VM,VA,...
NTCSC,TCSCFAsend,TCSCFArec,FA,Xc,Xl,Flow,PSta,Psp);
for ii = 1 : NTCSC
% Calculate Equivalent Reactance TCSCX
Xlc = Xc(ii)*Xl(ii)/(Xc(ii)-Xl(ii));
w = sqrt(Xc(ii)/Xl(ii));
C1 = (Xc(ii) + Xlc)/pi;
C2 = 4*Xlc^2/(Xl(ii)*pi);
Ang = pi - FA(ii)*pi/180;


X(ii) = -Xc(ii) + C1*(2*Ang + sin(2*Ang)) - C2*cos(Ang)^2*...
(w*tan(w*Ang)-tan(Ang));


Bmm = - 1/X(ii);
Bmk = 1/X(ii);
for kk = 1 : 2
A = VA(TCSCFAsend(ii))-VA(TCSCFArec(ii));
Pcal = VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmk*sin(A);
Qcal = - VM(TCSCFAsend(ii))^2*Bmm - VM(TCSCFAsend(ii))*VM...
(TCSCFArec(ii))*Bmk*cos(A);
PCAL(TCSCFAsend(ii)) = PCAL(TCSCFAsend(ii)) + Pcal;
QCAL(TCSCFAsend(ii)) = QCAL(TCSCFAsend(ii)) + Qcal;
if kk == 1
TCSC_PQsend(ii) = Pcal + j*Qcal;
else
TCSC_PQrec(ii) = Pcal + j*Qcal;
end
send = TCSCFAsend(ii);
TCSCFAsend(ii) = TCSCFArec(ii);
TCSCFArec(ii) = send;
end
end
185
THYRISTOR-CONTROLLED SERIES COMPENSATOR

%Function to compute power mismatches with TCSC-FA
function [DPQ,¬‚ag] = TCSCFAPowerMismatches(¬‚ag,tol,nbb,DPQ,VM,VA,...
NTCSCFA,TCSCFAsend,TCSCFArec,X,Flow,it,Psp,PSta);
if it > 1
for ii = 1 : NTCSCFA
if PSta(ii) == 1
Bmk = 1/X(ii);
for kk = 1 : 2
A = VA(TCSCFAsend(ii)) - VA(TCSCFArec(ii));
Pcal = VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmk*sin(A);
if( Flow == 1 & kk == 1 ) | ( Flow == -1 & kk == 2 )
DPQ(1, 2*nbb + ii) = Psp(ii) - Pcal;
break;
end
send = TCSCFAsend(ii);
TCSCFAsend(ii) = TCSCFArec(ii);
TCSCFArec(ii) = send;
end
else
DPQ(1, 2*nbb + ii)= 0;
end
end
end


%Function to add the TCSC-FA elements to Jacobian matrix
function [JAC] = TCSCFAJacobian(it,nbb,JAC,VM,VA,NTCSCFA,...
TCSCFAsend,TCSCFArec,FA,Xc,Xl,Flow,PSta,Psp,X);
for ii = 1 : NTCSCFA
% Calculate Equivalent Reactance TCSCX
Xlc = Xc(ii)*Xl(ii)/(Xc(ii)-Xl(ii));
w = sqrt(Xc(ii)/Xl(ii));
C1 = (Xc(ii) + Xlc)/pi;
C2 = 4*Xlc^2/(Xl(ii)*pi);
Ang = pi - FA(ii)*pi/180;

TCSCX = -Xc(ii) + C1*(2*Ang + sin(2*Ang)) - C2*cos(Ang)^2*(w*tan...
(w*Ang)-tan(Ang));


%Calculate Reactance Derivative
A1 = FA(ii)*pi/180;
DTCSCX1 = - 2*C1*(1 + cos(2*Ang));
DTCSCX2 = C2*(w^2*(cos(Ang)^2/cos(w*Ang)^2));
DTCSCX3 = - C2*(w*tan(w*Ang)*sin(2*Ang));
DTCSCX4 = C2*(tan(Ang)*sin(2*Ang)-1);

DTCSCX = DTCSCX1 + DTCSCX2 + DTCSCX3 + DTCSCX4;
186 POWER FLOW INCLUDING FACTS CONTROLLERS

Bmm = - 1/TCSCX;
Bmk = 1/TCSCX;



for kk = 1 : 2
A = VA(TCSCFAsend(ii))-VA(TCSCFArec(ii));
Hkm = - VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmm*cos(A);
Nkm = VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmm*sin(A);


JAC(2*TCSCFAsend(ii)-1,2*TCSCFAsend(ii)-1) = JAC(2*TCSCFA...
send(ii)-1,2*TCSCFAsend(ii)-1) - VM(TCSCFAsend(ii))^2*Bmm;
JAC(2*TCSCFAsend(ii)-1,2*TCSCFArec(ii)-1) = JAC(2*TCSCFA...
send(ii)-1, 2*TCSCFArec(ii)-1) - Hkm;
JAC(2*TCSCFAsend(ii)-1,2*TCSCFArec(ii)) = JAC(2*TCSCFA...
send(ii)-1, 2*TCSCFArec(ii)) - Nkm;
JAC(2*TCSCFAsend(ii),2*TCSCFAsend(ii)) = JAC(2*TCSCFA...
send(ii),2*TCSCFAsend(ii)) - VM(TCSCFAsend(ii))^2*Bmm;
JAC(2*TCSCFAsend(ii),2*TCSCFArec(ii)-1) = JAC(2*TCSCFA...
send(ii),2*TCSCFArec(ii)-1) + Nkm;
JAC(2*TCSCFAsend(ii),2*TCSCFArec(ii)) = JAC(2*TCSCFA...
send(ii),2*TCSCFArec(ii)) - Hkm;



if it > 1
if PSta(ii) == 1
A = VA(TCSCFAsend(ii))-VA(TCSCFArec(ii));
Ekm = -VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*sin(A)*Bmk^2*...
DTCSCX;
Fkm = - ((VM(TCSCFAsend(ii))^2 - VM(TCSCFAsend(ii))*VM...
(TCSCFArec(ii))*cos(A)))*Bmk^2*DTCSCX;
if (Flow(ii) == 1 & kk == 1) | (Flow(ii) == -1 & kk == 2)
Hkm = - VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmk*cos(A);
Nkm = VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmk*sin(A);


JAC(2*nbb + ii, 2*TCSCFAsend(ii)-1) = - Hkm;
JAC(2*nbb + ii, 2*TCSCFAsend(ii)) = Nkm;
JAC(2*nbb + ii, 2*TCSCFArec(ii)-1) = Hkm;
JAC(2*nbb + ii, 2*TCSCFArec(ii)) = Nkm;
JAC(2*nbb + ii, 2*nbb + ii) = Ekm;
end
JAC(2*TCSCFAsend(ii)-1, 2*nbb + ii) = Ekm;
JAC(2*TCSCFAsend(ii), 2*nbb + ii) = Fkm;
else
JAC(2*nbb + ii, 2*nbb + ii) = 1;
end
end
187
THYRISTOR-CONTROLLED SERIES COMPENSATOR

send = TCSCFAsend(ii);
TCSCFAsend(ii) = TCSCFArec(ii);
TCSCFArec(ii) = send;
end
end


%Function to update TCSC-FA state variables
function [FA] = TCSCFA_Updating(it,nbb,D,NTCSCFA,FA,PSta);
if it > 1
for ii = 1 : NTCSCFA
if PSta(ii) == 1
FA(ii) = FA(ii) + D(2*nbb + ii,1)*180/pi;
end
end
end


%Function to calculate the power ¬‚ows in TCSC-FA controller
function [PQTCSCsend,PQTCSCrec] = TCSCPQpower(VA,VM,NTCSCFA,...
TCSCFAsend,TCSCFArec,X);
for ii = 1 : NTCSCFA
Bmk = 1/X(ii);
Bmm = -1/X(ii);
for kk = 1 : 2
A = VA(TCSCFAsend(ii)) - VA(TCSCFArec(ii));
Ptcsc = VM(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmk*sin(A);
Qtcsc = - VM(TCSCFAsend(ii))^2*Bmm “...
M(TCSCFAsend(ii))*VM(TCSCFArec(ii))*Bmk*cos(A);
if kk == 1
PQTCSCsend(ii,kk) = Ptcsc + Qtcsc*i;
else
PQTCSCrec(ii,kk-1) = Ptcsc + Qtcsc*i;
end
send = TCSCFAsend(ii);
TCSCFAsend(ii) = TCSCFArec(ii);
TCSCFArec(ii) = send;
end
end


5.4.6 Numerical Example of Active Power Flow Control using
One Thyristor-controlled Series Compensator:
Firing-angle Model

Similar to the numerical example presented in Section 5.4.3, a TCSC is included in the ¬ve-
bus network to compensate the transmission line connected between Lake and Main. The
controller is used to maintain the active power ¬‚owing towards Main at 21 MW.
188 POWER FLOW INCLUDING FACTS CONTROLLERS

45 + j15
131.12 90.93 40 + j5


Lake
North Main
21.0
42.4 40.9 20.9

88.68 74.2
Lakefa 2.5
16.7 17.3 4.3
7.1 0.4
25.1
26.2
8e-4
1.1

73.1
86.21
26.6
2.7
25.5
5.1
7.1
1.6


Elm
South
52.9
54.1

20 + j10 60 + j10
4.9
5.6

61.8
40

Five-bus network with one thyristor-controlled series compensator, and power ¬‚ow
Figure 5.12
results




The initial value of ¬ring angle is set at 145 , and convergence is obtained in 7 iterations
to a power mismatch tolerance of 1e À 12. The TCSC upholds the target value of 21 MW.
The power ¬‚ow results are shown in Figure 5.12. As expected, the calculated TCSC
equivalent reactances using the ¬ring-angle model and the variable series reactance model
agree with each other. Also, the nodal voltages are the same as those given in Table 5.3.
The maximum absolute power mismatches in the system buses and TCSC are shown in
Figure 5.12. The TCSC characteristic is highly nonlinear, a fact that shows in the results in
Table 5.4 where the nonquadratic convergent pattern of ÁP and ÁQ is evident, particularly
up to the 4th iteration.
The data given in function PowerFlowsData (Section 4.3.9) are modi¬ed to
accommodate for the inclusion of the TCSC-FA in the same way as described in Section
5.4.3. Additionally, the function TCSCFAdata is used for entering TCSC-FA model data:

% THYRISTOR CONTROLLED SERIES COMPENSATOR
% FIRING ANGLE MODEL

% NTCSCFA : Number of TCSC™s
% TCSCFAsend : Sending bus
189
THYRISTOR-CONTROLLED SERIES COMPENSATOR

% TCSCFArec : Receiving bus
% Xc : TCSC™s reactance (p.u.)
% Xl : TCSC™s inductance (p.u)
% FA : Initial ¬ring angle (deg)
% FALo : Firing angle lower limit (deg)
% FAHi : Firing angle higher limit (deg)
% Flow : Power ¬‚ow direction: 1 is for sending to receiving bus; -1
% indicates opposite direction
% Psp : Active power ¬‚ow to be controlled (p.u.)
% PSta : Indicate the control status for active power: 1 is on; 0 is off

NTCSCFA=1;
TCSCFAsend(1)=3; TCSCFArec(1)=6; Xc(1)=9.375e-3; Xl(1)=1.625e-3;
FA(1)=145; FALo(1)=90; FAHi(1)=180;
Flow(1)=1; PSta(1)=1; Psp(1)=0.21;


Table 5.4 Maximum absolute power mismatches in the system buses and
thyristor-controlled series compensator (TCSC)
Nodal power mismatches TCSC mismatches and parameters
ÁP TCSC
ÁP ÁQ TCSC (deg) XTCSC (f1) (p.u.)
Iteration km

6e À 1 1.2e À 1 2.1e À 1 À 0.0518
1 145
2.1e À 2 1.6e À 2 2e À 2 À 0.0518
2 145
7.8e À 2 2.4e À 3 7.8e À 2 À 0.0341
3 146.26
3.6e À 3 7.7e À 3 3.6e À 3 À 0.0222
4 148.46
1e À 4 2.2e À 4 1.1e À 4 À 0.0216
5 148.66
1.1e À 8 4.3e À 8 1.1e À 8 À 0.0216
6 148.66
1e À 16 1e À 16 1e À 16 À 0.0216
7 148.66




5.4.7 Numerical Properties of the Thyristor-controlled Series
Compensator Power Flow Model

The performance of the TCSC mathematical model is affected by the number of internal
resonant points exhibited by the TCSC in the range 90 to 180 . The resonant points (poles)
of Equation (5.31) are determined by the following expression (Fuerte-Esquivel, Acha, and
´
Ambriz-Perez, 2000b):
" #
1=2
°2n À 1Þ!°LCÞ
TCSC ¼ p 1 À ; where n ¼ 1; 2; 3; . . . : °5:40Þ
2

Although in theory a TCSC can have n resonant points, in practice a well-designed TCSC
scheme will only have one resonant peak within its range of operation. By way of example,
Figure 5.13 shows the fundamental frequency reactance as a function of TCSC for the
Kayenta TCSC installation. The rated inductive and capacitive reactances of this TCSC
190 POWER FLOW INCLUDING FACTS CONTROLLERS

200




TCSC parameters („¦ )
100



0

X TCSC f1

Partial derivative
’ 100
of X TCSC f1


’ 200
180
100 130 150 160 170
110 120 140
90

Firing angle (deg)

Figure 5.13 Pro¬les of XTCSC °1Þ and qXTCSC °1Þ =q TCSC as a function of ¬ring angle, TCSC .
´
Reproduced, with permission, from C.R. Fuerte-Esquivel, E. Acha, and H. Ambriz-Perez, ˜A Thyristor
Controlled Series Compensator Model for the Power Flow Solution of Practical Power Networks™
IEEE Trans. Power Systems 15(1) 58“64, # 2000 IEEE



are 2.6  and 15 , respectively, at a base frequency of 60 Hz. The corresponding
susceptance pro¬le is shown in Figure 5.14. The partial derivatives of both parameters are
also shown in these ¬gures for completeness.
The TCSC exhibits a resonant point at TCSC ¼ 142.81 , as shown in Figure 5.14. This
pole de¬nes the transition from the inductive to the capacitive operating region, as the ¬ring
angle value increases.


0.5
Capacitive region
0.4

0.3
TCSC parameters (S)




BTCSC f1
0.2
Partial derivative of B TCSC f 1
0.1

0.0
180
100 130 150 160 170
110 120 140
90
’ 0.1 Firing angle (deg)
’ 0.2
’ 0.3 Inductive region
’ 0.4

Figure 5.14 Pro¬les of BTCSC °1Þ and qBTCSC °1Þ =q TCSC as a function of ¬ring angle. Reproduced,
´
with permission, from C.R. Fuerte-Esquivel, E. Acha, and H. Ambriz-Perez, ˜A Thyristor Controlled
Series Compensator Model for the Power Flow Solution of Practical Power Networks™, IEEE Trans.
Power Systems 15(1) 58“64, # 2000 IEEE
191
STATIC SYNCHRONOUS COMPENSATOR

It should be noted that both XTCSC °1Þ and qXTCSC °1Þ q TCSC present large variations in
magnitude in response to small variations in ¬ring angle near the resonant point. This
intrinsic characteristic of the TCSC causes the power equations and Jacobian to be ill-
conditioned if operation of the TCSC takes place too close to the resonant point.



5.5 STATIC SYNCHRONOUS COMPENSATOR

Following on the discussion of the STATCOM operational characteristics in Chapter 2, it is
reasonable to expect that for the purpose of positive sequence power ¬‚ow analysis the
STATCOM will be well represented by a synchronous voltage source with maximum and
minimum voltage magnitude limits. The synchronous voltage source represents the
fundamental Fourier series component of the switched voltage waveform at the AC converter
terminal of the STATCOM (Hingorani and Gyugyi, 2000; Song and Johns, 1999).
The bus at which the STATCOM is connected is represented as a PVS bus, which may
change to a PQ bus in the event of limits being violated. In such a case, the generated or
absorbed reactive power would correspond to the violated limit. Unlike the SVC, the
STATCOM is represented as a voltage source for the full range of operation, enabling a
more robust voltage support mechanism. The STATCOM equivalent circuit shown in
Figure 5.15 is used to derive the mathematical model of the controller for inclusion in power
¬‚ow algorithms.


Vk ∠θ k
+ VvR ∠δ vR ’
ZvR
Ik

IvR
bus k


Static compensator (STATCOM) equivalent circuit
Figure 5.15



5.5.1 Power Flow Model

The power ¬‚ow equations for the STATCOM are derived below from ¬rst principles and
assuming the following voltage source representation:

EvR ¼ VvR °cos vR þ j sin vR Þ: °5:41Þ

Based on the shunt connection shown in Figure 5.15, the following may be written:
ÀÃ Á
à à Ã
SvR ¼ VvR IvR ¼ VvR YvR VvR À Vk : °5:42Þ
192 POWER FLOW INCLUDING FACTS CONTROLLERS

After performing some complex operations, the following active and reactive power
equations are obtained for the converter and bus k, respectively:

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


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


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


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



Using these power equations, the linearised STATCOM model is given below, where the
voltage magnitude VvR and phase angle vR are taken to be the state variables:
2 3 2 32 3
qPk qPk qPk qPk
ÁPk Ák
Vk VvR 76
6 7 6 qk 7
qVk qvR qVvR
6 76 76 7
6 76 76 ÁVk 7
6 ÁQk 7 6 qQk qQk qQk qQk
VvR 76 V 7
6 76 76 k 7
Vk
7 6 qk qVk qvR qVvR
6 76 7
7¼6 7: °5:47Þ
6 76
6 7 6 qP 76 Á 7
qPvR qPvR qPvR
6 ÁPvR 7 6 vR VvR 76 vR 7
Vk
6 7 6 qk 76 7
qVk qvR qVvR
6 76 76 7
4 5 4 qQvR 54 ÁVvR 5
qQvR qQvR qQvR
Vk VvR
ÁQvR qk qVk qvR qVvR VvR

The Jacobian elements in Equation (5.47) are given in explicit form in Appendix A,
Section A.3.



5.5.2 Static Compensator Computer Program in Matlab1 Code

Program 5.5 incorporates the STATCOM model within the Newton“Raphson power ¬‚ow
program. The functions PowerFlowsData, YBus, and PQ¬‚ows are also used here. In the
main STATCOM Newton“Raphson program, the function SSCData is added to read the
STATCOM data, SSCNewtonRaphson replaces NewtonRaphson, and SSCPQ¬‚ows is used
to calculate power ¬‚ows and losses in the STATCOM.


PROGRAM 5.5 Program written in Matlab1 to incorporate the static compensator
(STATCOM) within the Newton“Raphson power ¬‚ow algorithm

% - - - Main STATCOM Program

PowerFlowsData; %Function to read network data

SSCData; %Function to read the STATCOM data

[YR,YI] = YBus(tlsend,tlrec,tlresis,tlreac,tlsuscep,tlcond,ntl,nbb);
[VM,VA,it,Vvr,Tvr] = SSCNewtonRaphson(tol,itmax,ngn,nld,nbb,...
bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,YI,VM,...
193
STATIC SYNCHRONOUS COMPENSATOR

VA,NSSC,SSCsend, Xvr,TarVol,VSta,Psp,PSta,Qsp,QSta,Vvr,Tvr,VvrHi,...
VvrLo);
[PQsend,PQrec,PQloss,PQbus] = PQ¬‚ows(nbb,ngn,ntl,nld,genbus,...
loadbus,tlsend,tlrec,tlresis,tlreac,tlcond,tlsuscep,PLOAD,QLOAD,...
VM,VA);


[Psend,Qsend,PSSC,QSSC] = SSCPQPowers(VM,VA,NSSC,SSCsend,Xvr,Vvr,...
Tvr);


%Print results
it %Number of iterations
VM %Nodal voltage magnitude (p.u)
VA=VA*180/pi %Nodal voltage phase angles (Deg)
Vvr %Final voltage magnitude source (p.u.)
Tvr=Tvr*180/pi %Final voltage phase angle source (Deg)
PQsend=Psend + j*Qsend %Active and reactive powers in bus (p.u.)
PQSSC=PSSC + j*QSSC %Active and reactive powers in STACOM (p.u.)


% End of MAIN STATCOM PROGRAM


%Carry out iterative solution using the Newton“Raphson method
[VM,VA,it,Vvr,Tvr] = SSCNewtonRaphson(tol,itmax,ngn,nld,nbb,...
bustype,genbus,loadbus,PGEN,QGEN,QMAX,QMIN,PLOAD,QLOAD,YR,YI,VM,...
VA,NSSC,SSCsend, Xvr,TarVol,VSta,Psp,PSta,Qsp,QSta,Vvr,Tvr,VvrHi,...
VvrLo);


% 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);


%STATCOM CALCULATED POWERS
[PCAL,QCAL,PSSC,QSSC] = SSCCalculatePowers(PCAL,QCAL,VM,VA,NSSC,...
SSCsend,Vxr,Vvr,Tvr);
194 POWER FLOW INCLUDING FACTS CONTROLLERS

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

%STATCOM POWER MISMATCHES
[DPQ] = SSCMismatches(DPQ,nbb,VM,VA,NSSC,SSCsend,Xvr,VSta,Psp,...
PSta,Qsp,QSta,Vvr,Tvr);

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

% STATCOM JACOBIAN
[JAC] = SSCJacobian(nbb,JAC,VM,VA,NSSC,SSCsend,Xvr,TarVol,VSta,...
Psp,PSta,Qsp,QSta,Vvr,Tvr);

% 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 STATCOM STATE VARIABLES
[VM,Vvr,Tvr] = SSCUpdating(nbb,D,VM,VA,NSSC,SSCsend,TarVol,VSta,...
Psp,Vvr,Tvr);

%CHECK VOLTAGE MAGNITUDE LIMITS
[Vvr] = SSCLimits(NSSC,Vvr,VvrHi,VvrLo);

it = it + 1;

end

%Function to calculate injected bus powers by the STATCOM
function [PCAL,QCAL,PSSC,QSSC] = SSCCalculatePowers(PCAL,QCAL,VM,...
VA,NSSC, SSCsend,Xvr,Vvr,Tvr);
for ii = 1 : NSSC
B(ii)=1/Xvr(ii);
A1 = Tvr(ii)-VA(SSCsend(ii));
A2 = VA(SSCsend(ii))-Tvr(ii);

PCAL(SSCsend(ii)) = PCAL(SSCsend(ii)) + VM(SSCsend(ii))*Vvr(ii)*...
(B(ii)*sin(A2));
QCAL(SSCsend(ii)) = QCAL(SSCsend(ii)) + VM(SSCsend(ii))^2*B(ii) - ...
Vvr(ii)*VM(SSCsend(ii))*(B(ii)*cos(A2));
195
STATIC SYNCHRONOUS COMPENSATOR

PSSC(ii) = Vvr(ii)*VM(SSCsend(ii))*(B(ii)*sin(A1));
QSSC(ii) = - Vvr(ii)^2*B(ii) + Vvr(ii)*VM(SSCsend(ii))*(B(ii)...
*cos(A1));


end



%Function to compute power mismatches for the STATCOM
function [DPQ] = SSCMismatches(DPQ,nbb,VM,VA,NSSC,SSCsend,Xvr,...
VSta,Psp, PSta,Qsp,QSta,Vvr,Tvr);
for ii = 1 : NSSC
B(ii)=1/Xvr(ii);
A1 = Tvr(ii)-VA(SSCsend(ii));
A2 = VA(SSCsend(ii))-Tvr(ii);


Pcal = VM(SSCsend(ii))*Vvr(ii)*(B(ii)*sin(A2));
Qcal = - VM(SSCsend(ii))^2*B(ii) + Vvr(ii)*VM(SSCsend(ii))*(B(ii)*...
cos(A2));

DPQ(2*(nbb + ii)-1) = Pcal - Psp(ii);

if (QSta(ii) == 1)
DPQ(2*(nbb + ii)) = Qcal - Qsp(ii);
else
DPQ(2*(nbb + ii)) = 0;
end
end
%Function to add the STATCOM elements to Jacobian matrix
function [JAC] = SSCJacobian(nbb,JAC,VM,VA,NSSC,SSCsend,Xvr,TarVol,...
VSta,Psp,PSta,Qsp,QSta,Vvr,Tvr);
for ii = 1 : NSSC
B(ii)=1/Xvr(ii);
if VSta(ii) == 1
JAC(: , 2*SSCsend(ii) )=0;
end
JAC(2*(nbb + ii)-1,2*(nbb + ii)-1) = 1;
JAC(2*(nbb + ii),2*(nbb + ii)) = 1;
A1 = Tvr(ii)-VA(SSCsend(ii));
A2 = VA(SSCsend(ii))-Tvr(ii);


Pcal = - VM(SSCsend(ii))*Vvr(ii)*( + B(ii)*sin(A2));
DQcal = Vvr(ii)*VM(SSCsend(ii))*(B(ii)*cos(A2));
Pssc = - Vvr(ii)*VM(SSCsend(ii))*(B(ii)*sin(A1));
DQssc = Vvr(ii)*VM(SSCsend(ii))*(B(ii)*cos(A1));
196 POWER FLOW INCLUDING FACTS CONTROLLERS

JAC(2*SSCsend(ii)-1,2*SSCsend(ii)-1) = JAC(2*SSCsend(ii)-1,...
2*SSCsend(ii)-1) + VM(SSCsend(ii))^2*B(ii);
JAC(2*SSCsend(ii),2*SSCsend(ii)-1) = JAC(2*SSCsend(ii),2*SSC...
send(ii)-1) - Pcal;
if (QSta(ii) == 1 )
JAC(2*SSCsend(ii)-1,2*SSCsend(ii)) = JAC(2*SSCsend(ii)-1,...
2*SSCsend(ii)) - Pcal;
JAC(2*SSCsend(ii),2*SSCsend(ii)) = JAC(2*SSCsend(ii),2*SSC...
send(ii)) + VM(SSCsend(ii))^2*B(ii);
else
JAC(2*SSCsend(ii)-1,2*SSCsend(ii)) = JAC(2*SSCsend(ii)-1,...
2*SSCsend(ii)) - Pssc;
JAC(2*SSCsend(ii),2*SSCsend(ii)) = JAC(2*SSCsend(ii),2*SSC...
send(ii)) - DQssc;
end
if (PSta(ii) == 1)
JAC(2*(nbb + ii)-1,2*SSCsend(ii)-1) = JAC(2*(nbb + ii)-1, 2*SSC...
send(ii)-1) + DQcal;
JAC(2*SSCsend(ii)-1,2*(nbb + ii)-1) = JAC(2*SSCsend(ii)-1,...
2*(nbb + ii)-1) - DQssc;
JAC(2*SSCsend(ii),2*(nbb + ii)-1) = JAC(2*SSCsend(ii),...
2*(nbb + ii)-1) - Pssc;
JAC(2*(nbb + ii)-1,2*(nbb + ii)-1) = - DQssc;
if (QSta == 1)
JAC(2*(nbb + ii),2*(nbb + ii)-1) = JAC(2*(nbb + ii),2*(nbb + ii)-1) - ...
Pssc;
JAC(2*(nbb + ii)-1,2*SSCsend(ii)) = JAC(2*(nbb + ii)-1,2*SSC...
send(ii)) - Pcal;
else
JAC(2*(nbb + ii),2*(nbb + ii)-1) = 0.0;
JAC(2*(nbb + ii)-1,2*SSCsend(ii)) = JAC(2*(nbb + ii)-1,2*SSC...
send(ii)) + Pssc;
end
else
JAC(2*(nbb + ii)-1,2*(nbb + ii)-1) = 1.0;
end
if (QSta(ii) == 1)
JAC(2*(nbb + ii),2*SSCsend(ii)-1) = JAC(2*(nbb + ii),2*SSCsend...
(ii)-1)- Pcal;
JAC(2*(nbb + ii),2*SSCsend(ii)) = JAC(2*(nbb + ii),2*SSCsend(ii))...
+ DQcal;
JAC(2*SSCsend(ii)-1,2*(nbb + ii)) = JAC(2*SSCsend(ii)-1,2*...
(nbb + ii)) + Pssc;
JAC(2*SSCsend(ii),2*(nbb + ii)) = JAC((nbb + ii),2*...
(nbb + ii)) - DQcal;
JAC(2*(nbb + ii),2*(nbb + ii)) = -2*Vvr(ii)^2*B(ii) + DQssc;
if (PSta(ii) == 1)
197
STATIC SYNCHRONOUS COMPENSATOR

JAC(2*(nbb + ii)-1,2*(nbb + ii)) = JAC(2*(nbb + ii)-1,2*(nbb + ii)) - Pssc;
else
JAC(2*(nbb + ii)-1,2*(nbb + ii)) = 0.0;
end
else
JAC(2*(nbb + ii),2*(nbb + ii)) = 1.0;
end
end



%Function to update STATCOM state variable
function [VM,Vvr,Tvr] = SSCUpdating(nbb,D,VM,VA,NSSC,SSCsend,...
TarVol,VSta, Psp,Vvr,Tvr);
for ii = 1 : NSSC
if (VSta(ii) == 1)
% Adjust the Volatge Magnitud target
Vvr(ii) = Vvr(ii) + Vvr(ii)*D(2*SSCsend(ii));
VM(SSCsend(ii)) = TarVol(ii);
if (Psp(ii) == 0)
Tvr(ii) = VA(SSCsend(ii));
else
Tvr(ii) = Tvr(ii) + D(2*(nbb + ii)-1);
end
else
Vvr(ii) = Vvr(ii) + Vvr(ii)*D(2*(nbb + ii));
Tvr(ii) = VA(SSCsend(ii));
end
end
%Function to check source voltages limits in the STATCOM
function [Vvr] = SSCLimits(NSSC,Vvr,VvrHi,VvrLo);
for ii = 1 : NSSC
%Check STATCOM Vvr Limits
if (Vvr(ii) > VvrHi(ii))
Vvr(ii) = VvrHi(ii);
elseif (Vvr(ii) < VvrLo(ii))
Vvr(ii) = VvrLo(ii);
end
end



%Function to calculate the power ¬‚ows in the STATCOM
function [Psend,Qsend,PSSC,QSSC] = SSCPQPowers(VM,VA,NSSC,SSCsend,...
Xvr,Vvr,Tvr);
for ii = 1 : NSSC
B(ii)=1/Xvr;
A1 = Tvr(ii)-VA(SSCsend(ii));
A2 = VA(SSCsend(ii))-Tvr(ii);
198 POWER FLOW INCLUDING FACTS CONTROLLERS

Psend(ii) = VM(SSCsend(ii))*Vvr(ii)*(B(ii)*sin(A2));
Qsend(ii) = - VM(SSCsend(ii))^2*B(ii) + Vvr(ii)*VM(SSCsend(ii))*...
(B(ii)*cos(A2));

PSSC(ii) = Vvr(ii)*VM(SSCsend(ii))*(B(ii)*sin(A1));
QSSC(ii) = - Vvr(ii)^2*B(ii) + Vvr(ii)*VM(SSCsend(ii))*(B(ii)*...
cos(A1));
end



5.5.3 Numerical Example of Voltage Magnitude Control using
One Static Compensator

The ¬ve-bus network is modi¬ed to include one STATCOM connected at Lake, to maintain
the nodal voltage magnitude at 1 p.u. The source impedance is XvR ¼ 0.1 p.u. The power
¬‚ow solution is shown in Figure 5.16 whereas the nodal voltage magnitudes and phase
angles are given in Table 5.5. Convergence is achieved in ¬ve iterations to a power
mismatch tolerance of 1e À 12. Function SSCData is used to enter STATCOM data, and
function PowerFlowsData remain unchanged.



45 + j15

<<

. 8
( 17)



>>