You are on page 1of 35

Load Flow Analysis Involving Wind Turbine

Generating Units

A Project Report
Submitted in partial fulfilment of the

requirements for the award of the degree

of

BACHELOR OF TECHNOLOGY

in

ELECTRICAL ENGINEERING
Submitted by :

FARAZ G. VAMSI KRISHNA

Guided by:

Dr. B. Das Dr. Vinay Pant

DEPARTMENT OF ELECTRICAL ENGINEERING

INDIAN INSTITUTE OF TECHNOLOGY ROORKEE

ROORKEE – 247667 (INDIA)

MAY, 2010
DECLARATION BY THE CANDIDATES

We hereby declare that the work which is being presented in the report entitled “Load flow
Analysis involving Wind Turbine Generating Units” submitted in partial fulfilment of the
requirements for the award of degree of Bachelor of Technology submitted in Department
of Electrical Engineering, IIT Roorkee is an authentic record of our own work for a period of
10 months from August 2009 to May 2010, under supervision of Dr. B. Das and Dr. Vinay
Pant, Department of Electrical Engineering, IIT Roorkee.

The matter embodied in the report has not been submitted by us for the award of any other
degree or diploma.

Date: (Faraz) (G. Vamsi Krishna)


Acknowledgement
First and foremost, we would like thank God for His mercy. We also express our sincere
appreciation to our project guide, Dr. B. Das, Associate Professor and Dr. Vinay Pant,
Assistant Professor for their patience and guidance throughout the entire duration of our
project. Without their supervision, this project would never have been a possibility.

Our heartfelt gratitude and indebtedness goes to all our teachers here at the Department of
Electrical Engineering who, with the knowledge they imparted in the field of basic Electrical
Engineering concepts and with their encouraging and caring words, have contributed
directly towards the completion of this project.

We appreciate and thank the entire official staff of the Department of Electrical
Engineering who directly or indirectly helped us during our project.

We would like to take this opportunity to express our deep sense of gratitude to our families
for the support and encouragement they have provided us over the years. Last but not the
least; we would also like to thank our friends who have offered their unrelenting assistance
throughout the course.

Faraz G. Vamsi Krishna


Abstract
This project is concerned with studying models of various types of wind turbine
generating units (WTGU) used as distributed generation (DG) sources and
demonstrating their application for steady state analysis. The model for each
class of WTGU studied here facilitates the computation of real and reactive
power outputs for a specified wind speed and terminal voltage. These models
have been used to study the impact of wind speed and terminal voltage
variation on the behaviour of each type of WTGU. The application of the
proposed models for the load flow analysis of radial systems having WTGU has
been demonstrated. Based on these studies we assess the impact of wind
based DG on the voltage profile and losses of radial distribution networks.
Simulation studies have been carried out on a 33 bus radial distribution system
having WTGU as DG sources to illustrate the application of these models.
Table of Contents
1. Introduction ......................................................................................2
2. Models of WTGU ............................................................................4
2.1. Fixed speed WTGU ....................................................................4
2.1.1. Pitch regulated fixed speed WTGU ......................................4
2.2. Semi variable speed WTGU .......................................................6
3. Load flow analysis including WTGU ..............................................8
3.1. Load flow analysis considering fixed wind speed ......................8
4. Simulation study...............................................................................9
4.1. Impact of DG on the distribution network operation..................9
4.1.1. WTGU data...........................................................................9
4.1.2. Test system .........................................................................10
4.1.3. Results ................................................................................11
4.1.4. Discussion ...........................................................................13
5. Conclusion .....................................................................................15
References ..........................................................................................16
APPENDIX A ....................................................................................17
APPENDIX B ....................................................................................31

1
1. Introduction
A large number of wind turbine generating systems (WTGS) are already in
operation and many new systems are being planned. The integration of WTGS
with the power systems is taking place at both the transmission and the
distribution voltage levels. Many investigations had been carried out to
understand the behavior of the wind turbine generating units (WTGU) as well as
their impact on the power grid. Distributed generation (DG) is an effective
means of increasing energy efficiency and reducing energy costs. As a result,
number of DGs, integrated to the distribution systems, has been greatly
increased in recent years. It is well known that one of the most favored energy
sources for DGs is the wind driven energy production systems i.e., WTGSs.
Accordingly, the usage of wind turbine generating systems (WTGSs) has been
gaining popularity worldwide for electricity generation since it is clean,
environmentally friendly and a free source. Its most important feature is that it
removes dependency on other countries in energy sector since its locally
available. Due to its importance and advantages amongst various DG sources,
the effects of the WTGS on the grid should be properly investigated.
Accordingly, these types of DG sources must be modeled with adequate details.

This project is concerned with the steady behaviour of WTGU-grid systems, in


particular the impact of WTGU used as DG sources. The WTGU are connected
to the grid at both transmission and distribution voltage level. For studies on
transmission systems connected to wind farms, an aggregated model of the wind
farm is considered to be adequate. In a wind farm supervisory controls are
generally present. These controls essentially determine the active power and
reactive power supplied by the wind farm at the point of common connection
(PCC). These features rather than the individual WTGU characteristics have to
be considered while developing models for wind farms. Modelling such wind
farms is not dealt here.

A WTGU when used as a DG source operates as a part of small primary


distribution system. There is a need to understand how various WTGU perform
when they are connected to the power grid at this voltage level. Further the
primary distribution systems are traditionally designed to operate with the
power flowing only in one direction. With the inclusion of these WTGU
sources, this characteristic of the distribution system changes and hence, the
impact of this change on the system needs to be studied.

2
The objective of this project is to study the steady state behaviour of WTGU as
DG sources and their impact on the distribution network. In view of this, the
project includes the following:
1. Studying the models for different types of WTGU that facilitate the
computation of the steady state power outputs.
2. Developing load flow software.
3. Applying these WTGU models for obtaining the steady state load flow
solution of a radial distribution feeder having distributed wind generation,
assuming the wind speed at the instant of interest is given/ known.
4. Studying the impact of wind based DG on the operation of radial systems.

3
2. Models of WTGU
Presently various types of WTGU have been installed and they can be broadly
classified into three categories, namely fixed, semi-variable and variable speed
types. The models studied here for the WTGU are intended to obtain the power
output of the WTGU for a given terminal voltage and wind speed.

2.1. Fixed speed WTGU

This type of WTGU has a squirrel cage induction generator which is driven by a
wind turbine either having a fixed turbine blade angle (stall regulated fixed
speed WTGU) or having a pitch controller to regulate the blade angle (pitch
regulated fixed speed WTGU). In both these types of WTGU, the induction
generator is directly connected to the grid. In the operating range the rotor speed
varies within a very small range (around 5% of the nominal value) and hence,
these are reckoned as fixed speed WTGU. Normally in these WTGU a fixed
shunt capacitor is used to provide reactive power compensation.

2.1.1. Pitch regulated fixed speed WTGU

In this class of WTGU, the pitch angle controller regulates the wind turbine
blade angle (ν) according to the wind speed variations. Hence, the power output
of this class of WTGU depends on the characteristics of the pitch controller in
addition to the turbine and generator characteristics. This control guarantees that
the power output of the WTGU for any wind speed will be equal to the designed
value for that speed (irrespective of the voltage). This designed power output Pe
of the WTGU with wind speed is provided by the manufacturer in the form of a
power curve. Hence, for a given wind speed Pe can be obtained from the power
curve of the WTGU, but Qe needs to be computed. With Pe known and an
assumed voltage, the induction generator power output (Pe) expression can be
recast as a quadratic equation in slip (rotor speed). This equation is solved to get
the slip value. With the slip known, the reactive power output Qe is calculated
from the induction generator equivalent circuit. Any change in voltage due to
these output changes is computed and the above process is repeated till
convergence.

4
Fig. 1. Induction machine equivalent circuit.

Algorithm 1:

Pitch regulated fixed speed WTGU power output (Pe and Qe)
Given wind speed uw and the terminal voltage V

1. For the given uw obtain Pe from the power curve of the WTGU (provided by
the manufacturer).
2. Pe of the induction generator is given by

Pe = [R1(R22 + s2(Xm + Xl2)2) + sR2Xm2]|V|2


______________________________________________________________________________________________

[R2R1 + s(Xm2 – (Xm + Xl2)(Xm + Xl1))]2 + [R2(Xm + Xl1) + sR1(Xm + Xl2)]2

Knowing Pe and all the other parameters of the induction generator, it can be
written as a quadratic equation in s as follows

as2+bs+c=0

where,
a = PeR12(Xl2+Xm)2+Pe(XmXl2 + Xl1(Xl2+Xm))2 - |V|2R1(Xl2+Xm)2 ,

b = 2Pe R1 R2 Xm2 - |V|2 R2Xm2 ,

and
c = PeR22(Xl1 + Xm)2 + Pe(R2R1)2 − |V |2R1R22 ,

5
Then the slip is given by

s = min ((-b + (b2 – 4ac)0.5)/2a , (-b - (b2 – 4ac)0.5)/2a)

3. Knowing s compute Qe as

Qe = [XmXl2s2(Xm + Xl2) + Xl1s2(Xm + Xl2)2 + R22(Xm + Xl1))]|V|2


______________________________________________________________________________________________

[R2R1 + s(Xm2 – (Xm + Xl2)(Xm + Xl1))]2 + [R2(Xm + Xl1) + sR1(Xm + Xl2)]2

2.2. Semi variable speed WTGU

This class of WTGU consists of a pitch controlled wind turbine and a wound
rotor induction generator. The rotor circuit of the generator is connected to an
external variable resistance. Power electronic devices are used to vary the rotor
resistance. In these WTGU, the reactive power compensation is normally
provided by a fixed shunt capacitor. There are two controllers, a pitch controller
and rotor resistance controller. These two controllers are designed to operate in
a coordinated manner. This design guarantees that the active power output is
equal to the maximum power at wind speeds below nominal and equal to rated
power above nominal wind speeds. For this class of WTGU also, the
manufacturer provides the designed real power output versus wind speed
characteristics. A typical power curve is shown in Fig. 2.

Fig. 2. Typical power curve: semi-variable speed WTGU.

Determination of the output of this WTGU for a given wind speed and
assumed/known terminal voltage involves the computation of Pe and Qe. The
6
Pe computation is straight forward as the WTGU power characteristic readily
provides this value. However, computation of Qe is tricky. This is because as
compared to the pitch controlled WTGU discussed in Section 2.1.1, in this case
in addition to the slip, the rotor resistance is also determined by the controller
and hence is unknown. This difficulty is overcome by noting a very interesting
feature of the expression for Pe and Qe of the induction generator. We note that
the expression for Pe and Qe can be recast as a quadratic function of a new
variable R2/s. Hence, even when R2 and s are unknown the
quantity R2/s (say Req) can be computed by solving the quadratic equation
in Req involving Pe. To compute Qe, this value of Req is used in the modified
expression for Qe. The quadratic equation for Req can be derived and is as
follows:
aReq2 + bReq + c = 0

where,
a = Pe(R12 + (Xl1 + Xm)2) - |V|2R12,

b = 2R1PeXm2 – Xm2|V|2

and
c = Pe(R1)2(Xl2 + Xm)2 + Pe(Xm2 – (Xm + Xl2)(Xm + Xl1))2 – R1(Xm + Xl2)2|V|2

Algorithm 2:

Semi-variable speed WTGU power output (Pe and Qe). Given wind
speed uw and the terminal voltage V
1. For the given uw obtain Pe from the power curve of the WTGU (provided by
the manufacturer similar to Fig. 2).
2. Compute Req by solving as
Req = max((-b + (b2 – 4ac)0.5)/2a), (-b - (b2 – 4ac)0.5)/2a))

where a, b and c are as defined in as above.


3. Knowing Req, compute Qe as

Qe = [R2eq(Xm + Xl1) – (Xm + Xl2)(Xm2 – (Xm + Xl2)(Xm + Xl1))]|V|2


_____________________________________________________________
[ReqR1 + (Xm2 – (Xm + Xl2)(Xm + Xl2))]2 + [Req(Xm + Xl1) + R1(Xm + Xl2)]2

7
3. Load flow analysis including WTGU
Load flow analysis is the primary tool for assessing the operation of the systems
in steady state. As the focus of this project is limited to the use of WTGU as
DGs, the systems of interest would be the primary distribution systems. These
systems are mostly radial. Inclusion of these WTGU into these systems results
in the increase in the number of buses where power is fed into such systems.
However, this does not require that the WTGU buses be treated as voltage
specified buses (PV buses) because none of the WTGU types have enough
reactive power capability to hold their terminal voltage at a specified value. The
WTGU buses can be treated as only PQ buses (with P and Q varying across
iterations in contrast to a conventional PQ bus where they remain constant).
Here, we use modified Newton-Raphson method so as to accommodate the
WTGUs.

3.1. Load flow analysis considering fixed wind speed


In situations where the wind speed at all WTGU is specified and the loads at
buses are known, a radial load flow algorithm can provide the solution with
very little computation. In this algorithm it is necessary to determine the real
and reactive current injection at all the buses. In each iteration at the beginning,
the power output of each of the WTGU for the given wind speed and terminal
voltage (voltage value obtained in the previous iteration) is obtained using the
studied algorithms depending on the type of WTGU. Using these computed
values as specified active and reactive powers for that buses change in voltages
at all the buses are found and voltage is updated for this iteration.

8
4. Simulation study
A simulation study aimed at understanding the impact of WTGU on the
distribution system has been carried out. In this study, it has been assumed that
the wind speed and its corresponding power output at a wind site at the instant
of interest is given/ known.

4.1. Impact of DG on the distribution network operation


The impact of wind based DG on distribution networks has been assessed
through load flow studies, considering a number of operating conditions. For
this study, the 33 bus radial distribution system from [2] has been considered.

Fig. 3. 33 bus test system with WTGU connected

4.1.1. WTGU data


The data for the semi-variable speed and pitch regulated type WTGU is taken
from [2].

9
Table 1. Induction generator circuit parameters

Type of WTGU Pitch regulated fixed speed Semi-variable speed

Rating (MW) 0.50 1.0

Rated (kV) 0.69 0.69

R1 (pu) 0.005986 0.005671

Xl1 (pu) 0.08212 0.15250

R2 (pu) 0.01690 0.00462

Xl2 (pu) 0.107225 0.096618

Xm (pu) 2.5561 2.8985

Xc (pu) 2.5561 2.8985

The pitch regulated fixed speed WTGU considered here is the Vestas unit of
1 MW rating. The induction generator circuit parameters for the same unit are
given in Table 1. The semi-variable speed WTGU considered here is the Vestas
unit of 1 MW rating. The induction generator circuit parameters are given
in Table 1.

4.1.2. Test system

The 12.66 kV 33 bus radial distribution test system given in ref. [2] has been
slightly modified by introducing four WTGU at four buses. The single line
diagram of the modified system is shown in Fig. 3. The modified test system
considered here, could be viewed as a typical example of emerging systems;
primary distribution system with dispersed generation. The pitch regulated fixed

10
speed and semi-variable speed type of WTGU are connected at different points
of the distribution system (Fig. 3) through four transformers (rated
12.66/0.69 kV, 1.2 MVA). The transformer reactance is 0.12 pu (on its own
base). Except for the four additional WTGU and transformers, the network and
load data are identical to that given in ref. [2] and these details are provided
in Appendix A (Table 4).

4.1.3. Results

Load flow solutions using Newton-Raphson load flow technique has been
obtained for 4 cases. In each case the wind speed at each WTGU is considered
to be known and fixed. The following load and wind speed conditions have
been considered to study the impact of terminal voltage as well as wind speed
variation on the power output of the WTGU and on the distribution network:

Case 1

WTGU operating below cut-in wind speed (which is equivalent to the system
without WTGU) and system loads corresponds to the base load .

Case 2

WTGU operating at low wind speeds (Pe taken as 50% of rated) and system
loads corresponds to the base load.

Case 3

WTGU operating at higher wind speeds than Case 2 (Pe taken as rated) and
system loads corresponds to the base load.

Case4

WTGU operating at wind speeds corresponding to Case and system load


corresponds to 30% of the base load.

In Case 1 the wind speeds are considered to be below cut-in so as represent the
system without WTGU. Cases 2 correspond to that with WTGU and the wind
speeds are considered to be between cut-in and nominal (i.e Pe < Prated). Case 3-
4 correspond to that with WTGU and the wind speeds are considered to be
above nominal (Pe = Prated).

11
Table 2 : Summary of load flow results at WTGU buses for various load and wind conditions

Case Bus No. Type of WTGU Pe (MW) Qe (MVAr) |V| pu


1 33 Pitch regulated fixed speed 0 0 0.8930
6 Semi-variable speed 0 0 0.9468
25 Pitch regulated fixed speed 0 0 0.9779
18 Semi-variable speed 0 0 0.9101
2 33 Pitch regulated fixed speed 0.5 0.381 0.9262
6 Semi-variable speed 0.5 0.376 0.9645
25 Pitch regulated fixed speed 0.5 0.418 0.9860
18 Semi-variable speed 0.5 0.373 0.9573
3 33 Pitch regulated fixed speed 1.0 0.569 0.9476
6 Semi-variable speed 1.0 0.615 0.9752
25 Pitch regulated fixed speed 1.0 0.579 0.9916
18 Semi-variable speed 1.0 0.614 0.9840
4 33 Pitch regulated fixed speed 1.0 0.588 1.0191
6 Semi-variable speed 1.0 0.613 1.0107
25 Pitch regulated fixed speed 1.0 0.583 1.0066
18 Semi-variable speed 1.0 0.615 1.0440

The load flow solution has been obtained for all the four cases. For all these
cases, the real and reactive power output as well as the voltage magnitude at the
WTGU buses obtained at the end of the load flow solution is given in Table 2.
In all the results presented here, the reactive power demand at any bus is
reckoned as positive (or Qe injected into the bus is negative). Fig. 4. shows the
system voltage profile (voltage magnitudes at all the buses) for all the four
cases. At the end of the load flow solution the real generation at all the WTGU
buses are known and the power fed by the substation (slack bus power) is
calculated. The sum of the WTGU generation and the power fed at the slack bus
gives the total power input to the system. As the system load is known, the real
power loss for each of the cases can be obtained as the difference between the
input power and the load. These details for all the four cases are given in Table
3.
Table 3 : System real power loss details

Case Total System Total WTGU Substation Power loss Loss %


Load (MW) Gen (MW) input (MW) (MW)
1 4.715 0.0 5.001 0.286 6.07
2 4.715 2.0 2.851 0.136 2.88
3 4.715 4.0 0.867 0.152 3.22
4 1.4145 4.0 -2.458 0.127 8.98

12
4.1.4. Discussion

1. System voltage profile: For a given load profile, with increase in the real
power output Pe of the WTGU, the voltage magnitude at all the buses increases.
From Fig. 4 it can be seen that with increase in the power output of WTGU
from zero (Case 1) to around rated values (Case 3) the voltage magnitude at all
the buses increases. This increase seen in the voltage magnitude at all the buses
of such a system is due to the increase in total Pe (in spite of the increase in
reactive power demand of the WTGU) injected by the WTGU. This behavior is
easily explained when once it is noted that the R/X ratio of the feeder is quite
high (around 2). Additionally, from Case 4 in Fig. 4 it can be seen that the
voltage magnitude at many of the system buses is higher than that of the slack
(substation) bus. This is because in Case 4 the net generation of the WTGU is
higher than the total system load. Thus it can be said that for given load profile
the system voltage magnitudes increase with increase in the net power injected
by the WTGU. Further if the total power output of the WTGU is greater than
the total load on the feeder then power is supplied to the grid at the substation
bus. Due to this the voltage magnitude at some of the buses of such systems
could be higher than that of the substation bus.

2. System loss: A comparison of the total system loss obtained for the first three
cases (Table 3) shows that the percentage loss decreases with increase in the
real power output of the WTGU. However, from Table 3 it can be seen that the
percentage loss in Case 4 is high, even though the magnitude of loss is low. In
Cases 2 and 3, the WTGU and the grid together supply power to the loads in the
system. However, in Case 4 the total power generated by the WTGU is much
higher than the total system load. Due to this some power is injected into the
grid at the slack bus. In order to investigate this issue further, the system loss
was obtained for a fixed load (30% of the base case load). From this it is evident
that with the feeder load remaining constant, as the total power supplied by the
WTGU increases the system loss decreases up to a certain limit and beyond this
the loss actually starts increasing.

13
1.05
Case 1
1.04 Case 2
Case 3
Case 4

1.02

1
VOLTAGE MAGNITUDE (pu)

0.98

0.96

0.94

0.92

0.9

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
BUS NUMBER

Fig. 4. Voltage profile of the 33-bus system with WTGUs connected

14
5. Conclusion
In this project steady state models of various types of WTGU have been studied
and their application for both deterministic load flow analysis has been
demonstrated. These models have been used to assess the steady state behavior
of the various WTGU types, under varying system conditions. In addition,
simulation studies have been carried out on a radial distribution system having
WTGU operating as DG sources.

Integration of DG to the grid at the distribution voltage levels seems to be


beneficial. At this voltage level the network R/X ratios are generally high. In
such situations the network voltage profiles improve with increase in
generation. The increase in wind generator Q demand with increase in real
generation does not seem to have any negative impact on the system voltage
profile. Finally, DG helps to reduce the distribution system real power losses.

Future Scope :

1. The power output can be related to the wind velocity and hence, velocity
vs power output can be evaluated.
2. The same Load Flow analysis can be done for other types of Wind
Turbine Generating Units such as stall regulated, DFIG etc.
3. The same analysis can be done using Matlab’s Simulink and can be made
more user interactive.

15
References

[1] N. G. Boulaxis, S. A. Papathanassiou, and M. P. Papadopoulos, “Wind


turbine effect on the voltage profile of distribution networks,” Renewable
Energy, vol. 25, no. 3, pp. 401–415, 2002.

[2] K. C. Divya and P. S. N. Rao, “Models for wind turbine generating systems
and their application in load flow studies,” Electric Power Systems Research, In
Press, Available online 28 December 2005.

[3] K. C. Divya, “Wind based distributed generation and grid interaction :


Modelling and analysis,” Ph.D. dissertation, Dept. of Electrical Engg.,, 2006.

[4] M. E. Baran and F. F. Wu, “Network reconfiguration in distribution systems


for loss reduction and load balancing,” IEEE Transactions on Power Delivery,
vol. 4, no. 2, pp. 1401–1407, 1989.

[5] Coath, G., and Al-Dabbagh, M., “Effect of steady-state wind turbine
generator models on power flow convergence and voltage stability limit,”
Australasian Universities Power Engineering Conference (AUPEC 2005),
Australia, 25–28 September 2005.

16
APPENDIX A
Main code :

% Program for Newton-Raphson Load Flow Analysis..

tic;
nbus = 33; %number of buses
Y = ybusppg(nbus); % Calling ybusppg.m...
y_bus_matrix = Y;
busd = busdatas3(nbus); % Calling busdatas..
BMva = 1; % Base MVA..
bus = busd(:,1); % Bus Number..
type = busd(:,2); % Type of Bus 1-Slack, 2-PV, 3-PQ..
V = busd(:,3); % Specified Voltage..
del = busd(:,4); % Voltage Angle..
Pg = busd(:,5)/BMva; % PGi..
Qg = busd(:,6)/BMva; % QGi..
Pl = busd(:,7)/BMva; % PLi..
Ql = busd(:,8)/BMva; % QLi..
Qmin = busd(:,9)/BMva; % Minimum Reactive Power Limit
Qmax = busd(:,10)/BMva; % Maximum Reactive Power Limit
P = Pg - Pl; % Pi = PGi - PLi for all buses
Q = Qg - Ql; % Qi = QGi - QLi for PQ buses
Psp = P; % P Specified..
Qsp = Q; % Q Specified..
G = real(Y); % Conductance matrix..
B = imag(Y); % Susceptance matrix..

pv = find(type == 2 ); % PV Buses..
pq = find(type == 3); % PQ Buses..
npv = length(pv); % No. of PV buses..
npq = length(pq); % No. of PQ buses..

%the parameters of the induction generator are with the same


base i.e 100MVA

x = 33; % because WTGU is attached on last bus

Pe1 = 1.0;

Tol = 1;

17
number_of_iterations = 0;

z=1;
while (z) % Iteration starting..

number_of_iterations = number_of_iterations + 1;
Pcal = zeros(nbus,1);
Qcal = zeros(nbus,1);

Ve1 = V(6);
Qsp(6) = semivar(Pe1 , Ve1)- Ql(6);
Ve2 = V(33);
Qsp(33) = pitchreg(Pe1 , Ve2)-Ql(33);
Ve3 = V(25);
Qsp(33) = pitchreg(Pe1 , Ve3)-Ql(25);
Ve4 = V(18);
Qsp(18) = pitchreg(Pe1 , Ve4)-Ql(18);

% Calculate Pcalc and Qcalc


for i = 1:nbus
for k = 1:nbus
Pcal(i) = Pcal(i) + V(i)*
V(k)*(G(i,k)*cos(del(i)-del(k)) + B(i,k)*sin(del(i)-
del(k)));
Qcal(i) = Qcal(i) + V(i)*
V(k)*(G(i,k)*sin(del(i)-del(k)) - B(i,k)*cos(del(i)-
del(k)));
end
end

% Calculate change from specified value


dPa = Psp-Pcal; %for all buses
dQa = Qsp-Qcal; %for all PQ buses
k = 1;
dQ = zeros(npq,1);
for i = 1:nbus
if type(i) == 3
dQ(k,1) = dQa(i);
k = k+1;
end
end
dP = dPa(2:nbus);
M = [dP; dQ]; % Mismatch Vector

18
Tol = max(abs(M)); % Tolerance..

if( Tol > 1e-6)


for i=1:nbus
if type(i) == 2
if ( Qcal(i) > Qmax(i))
type(i) = 3;
npq = npq +1 ;
npv = npv -1 ;
pv = find(type == 2); % PV Buses
pq = find(type == 3); % PQ Buses
Qcal(i) = Qmax(i);
elseif (Qcal(i) < Qmin(i))
type(i) = 3;
npq = npq +1 ;
npv = npv -1 ;
pv = find(type == 2); % PV Buses
pq = find(type == 3); % PQ Buses
Qcal(i) = Qmin(1);
end
end
end

% Calculate change from specified value


dPa = Psp-Pcal; %for all buses
dQa = Qsp-Qcal; %for all PQ buses
k = 1;
dQ = zeros(npq,1);
for i = 1:nbus
if type(i) == 3
dQ(k,1) = dQa(i);
k = k+1;
end
end
dP = dPa(2:nbus);
M = [dP; dQ]; % Mismatch Vector

% Jacobian
% J1 - Derivative of Real Power Injections with Angles..
J1 = zeros(nbus-1,nbus-1);
for i = 1:(nbus-1)
m = i+1;
for k = 1:(nbus-1)
n = k+1;

19
if n == m
for n = 1:nbus
J1(i,k) = J1(i,k) + V(m)* V(n)*(-
G(m,n)*sin(del(m)-del(n)) + B(m,n)*cos(del(m)-
del(n)));
end
J1(i,k) = J1(i,k) - V(m)^2*B(m,m);
else
J1(i,k) = V(m)*
V(n)*(G(m,n)*sin(del(m)-del(n)) - B(m,n)*cos(del(m)-
del(n)));
end
end
end

% J2 - Derivative of Real Power Injections with V..


J2 = zeros(nbus-1,npq);
for i = 1:(nbus-1)
m = i+1;
for k = 1:npq
n = pq(k);
if n == m
for n = 1:nbus
J2(i,k) = J2(i,k) +
V(n)*(G(m,n)*cos(del(m)-del(n)) + B(m,n)*sin(del(m)-
del(n)));
end
J2(i,k) = J2(i,k) + V(m)*G(m,m);
else
J2(i,k) = V(m)*(G(m,n)*cos(del(m)-
del(n)) + B(m,n)*sin(del(m)-del(n)));
end
end
end

% J3 - Derivative of Reactive Power Injections with


Angles..
J3 = zeros(npq,nbus-1);
for i = 1:npq
m = pq(i);
for k = 1:(nbus-1)
n = k+1;
if n == m
for n = 1:nbus

20
J3(i,k) = J3(i,k) + V(m)*
V(n)*(G(m,n)*cos(del(m)-del(n)) + B(m,n)*sin(del(m)-
del(n)));
end
J3(i,k) = J3(i,k) - V(m)^2*G(m,m);
else
J3(i,k) = V(m)* V(n)*(-
G(m,n)*cos(del(m)-del(n)) - B(m,n)*sin(del(m)-
del(n)));
end
end
end

% J4 - Derivative of Reactive Power Injections with V..


J4 = zeros(npq,npq);
for i = 1:npq
m = pq(i);
for k = 1:npq
n = pq(k);
if n == m
for n = 1:nbus
J4(i,k) = J4(i,k) +
V(n)*(G(m,n)*sin(del(m)-del(n)) - B(m,n)*cos(del(m)-
del(n)));
end
J4(i,k) = J4(i,k) - V(m)*B(m,m);
else
J4(i,k) = V(m)*(G(m,n)*sin(del(m)-
del(n)) - B(m,n)*cos(del(m)-del(n)));
end
end
end

J = [J1 J2; J3 J4]; % Jacobian Matrix..

X = inv(J)*M; % Correction Vector


dTh = X(1:nbus-1); % Change in Voltage Angle..
dV = X(nbus:end); % Change in Voltage
Magnitude..

% Updating State Vectors..


del(2:nbus) = dTh + del(2:nbus); %Voltage Angle..
k = 1;
for i = 2:nbus

21
if type(i) == 3
V(i) = dV(k) + V(i); %Voltage magnitude
k = k+1;
end
end

number_of_iterations = number_of_iterations + 1;

else
z=0;
end
end
loadflow(nbus,V,del,BMva); %Calling Loadflow.m
disp('number of iterations = ');
fprintf(' %2d', number_of_iterations);
fprintf('\n');
toc;
t = toc;

22
% Semi-variable WTGU function

function semi= semivar(Pe, Ve)

R1 = 0.005671;
Xl1 = 0.15250;
R2 = 0.00462;
Xl2 = 0.096618;
Xm = 2.8985;

a = Pe*(R1^2 + (Xl1 + Xm)^2) - Ve^2*R1^2;


b = 2*Pe*R1*Xm^2 - Ve^2*Xm^2;
c = Pe*R1^2*(Xl2 + Xm)^2 + Pe*(Xm^2 - (Xm +
Xl2)*(Xm + Xl1))^2 - R1*(Xm + Xl2)^2*Ve^2;
Req = max(abs((-b + ((b^2 - 4*a*c)^.5))/(2*a)) ,
abs((-b - ((b^2 - 4*a*c)^.5))/(2*a)));
num = (Req^2*(Xm + Xl1) - (Xm + Xl2)*(Xm^2 - (Xm
+ Xl2)*(Xm + Xl1)))*Ve^2;
den = (Req*R1 + (Xm^2 - (Xm + Xl2)*(Xm + Xl1)))^2
+ (Req*(Xm + Xl1) + R1*(Xm + Xl2))^2;
Qe = num/den;
semi = -Qe;

23
% Pitch regulated WTGU function
function pitch = pitchreg(Pe, Ve)

R1 = 0.005986;
Xl1 = 0.08212;
R2 = 0.01690;
Xl2 = 0.107225;
Xm = 2.5561;

a = Pe*R1^2*(Xl2 + Xm)^2 + Pe*(Xm*Xl2 + Xl1*(Xl2


+ Xm))^2 - Ve^2*R1*(Xl2 + Xm)^2;
b = 2*Pe*R1*R2*Xm^2 - Ve^2*R2*Xm^2;
c = Pe*R2^2*(Xl1 + Xm)^2 + Pe*(R2*R1)^2 -
Ve^2*R1*R2^2;
s = min(abs((-b + ((b^2 - 4*a*c)^.5))/(2*a)) ,
abs((-b - ((b^2 - 4*a*c)^.5))/(2*a)));
num = (Xm*Xl2*s^2*(Xm + Xl2) + Xl1*s^2*(Xm +
Xl2)^2 + R2^2*(Xm + Xl1))*Ve^2;
den = (R2*R1 + s*(Xm^2 - (Xm + Xl2)*(Xm +
Xl1)))^2 + (R2*(Xm + Xl1) + s*R1*(Xm + Xl2))^2;
Qe = num/den;
pitch = -Qe;

24
Loadflow Programme
% Program for Bus Power Injections, Line & Power flows
(p.u)...

function [Pi Qi Pg Qg Pl Ql] =


loadflow(nb,V,del,BMva)

Y = ybusppg(nb); % Calling Ybus program..


lined = linedatas3(nb); % Get linedats..
busd = busdatas3(nb); % Get busdatas..
Vm = pol2rect(V,del); % Converting polar to
rectangular..
Del = 180/pi*del; % Bus Voltage Angles in
Degree...
fb = lined(:,1); % From bus number...
tb = lined(:,2); % To bus number...
nl = length(fb); % No. of Branches..
Pl = busd(:,7); % PLi..
Ql = busd(:,8); % QLi..
Iij = zeros(nb,nb);
Sij = zeros(nb,nb);
Si = zeros(nb,1);

% Bus Current Injections..


I = Y*Vm;
Im = abs(I);
Ia = angle(I);

%Line Current Flows..


for m = 1:nl
p = fb(m); q = tb(m);
Iij(p,q) = -(Vm(p) - Vm(q))*Y(p,q); % Y(m,n) = -
y(m,n)..
Iij(q,p) = -Iij(p,q);
end
Iij = sparse(Iij);
Iijm = abs(Iij);
Iija = angle(Iij);

% Line Power Flows..


for m = 1:nb
for n = 1:nb
if m ~= n
Sij(m,n) = Vm(m)*conj(Iij(m,n))*BMva;
25
end
end
end
Sij = sparse(Sij);
Pij = real(Sij);
Qij = imag(Sij);

% Line Losses..
Lij = zeros(nl,1);
for m = 1:nl
p = fb(m); q = tb(m);
Lij(m) = Sij(p,q) + Sij(q,p);
end
Lpij = real(Lij);
Lqij = imag(Lij);

% Bus Power Injections..


for i = 1:nb
for k = 1:nb
Si(i) = Si(i) + conj(Vm(i))*
Vm(k)*Y(i,k)*BMva;
end
end
Pi = real(Si);
Qi = -imag(Si);
Pg = Pi+Pl;
Qg = Qi+Ql;

disp('###############################################
##########################################');
disp('-----------------------------------------------
------------------------------------------');
disp(' Newton Raphson
Loadflow Analysis ');
disp('-----------------------------------------------
------------------------------------------');
disp('| Bus | V | Angle | Injection |
Generation | Load |');
disp('| No | pu | Degree | MW | MVar |
MW | Mvar | MW | MVar | ');
for m = 1:nb
disp('-------------------------------------------
----------------------------------------------');

26
fprintf('%3g', m); fprintf(' %8.4f', V(m));
fprintf(' %8.4f', Del(m));
fprintf(' %8.3f', Pi(m)); fprintf(' %8.3f',
Qi(m));
fprintf(' %8.3f', Pg(m)); fprintf(' %8.3f',
Qg(m));
fprintf(' %8.3f', Pl(m)); fprintf(' %8.3f',
Ql(m)); fprintf('\n');
end
disp('-----------------------------------------------
------------------------------------------');
fprintf(' Total ');fprintf('
%8.3f', sum(Pi)); fprintf(' %8.3f', sum(Qi));
fprintf(' %8.3f', sum(Pi+Pl)); fprintf(' %8.3f',
sum(Qi+Ql));
fprintf(' %8.3f', sum(Pl)); fprintf(' %8.3f',
sum(Ql)); fprintf('\n');
disp('-----------------------------------------------
------------------------------------------');
disp('###############################################
##########################################');

disp('-----------------------------------------------
--------------------------------------');
disp(' Line FLow and
Losses ');
disp('-----------------------------------------------
--------------------------------------');
disp('|From|To | P | Q | From| To | P
| Q | Line Loss |');
disp('|Bus |Bus| MW | MVar | Bus | Bus|
MW | MVar | MW | MVar |');
for m = 1:nl
p = fb(m); q = tb(m);
disp('-------------------------------------------
------------------------------------------');
fprintf('%4g', p); fprintf('%4g', q); fprintf('
%8.3f', Pij(p,q)); fprintf(' %8.3f', Qij(p,q));
fprintf(' %4g', q); fprintf('%4g', p);
fprintf(' %8.3f', Pij(q,p)); fprintf(' %8.3f',
Qij(q,p));
fprintf(' %8.3f', Lpij(m)); fprintf(' %8.3f',
Lqij(m));
fprintf('\n');
27
end
disp('-----------------------------------------------
--------------------------------------');
fprintf(' Total Loss
');
fprintf(' %8.3f', sum(Lpij)); fprintf(' %8.3f',
sum(Lqij)); fprintf('\n');
disp('-----------------------------------------------
--------------------------------------');
disp('###############################################
######################################');

28
Ybus Programme
% Program to for Admittance And Impedance Bus Formation....

function Y = ybusppg(num) % Returns Y

linedata = linedatas3(num); % Calling Linedatas...


fb = linedata(:,1); % From bus number...
tb = linedata(:,2); % To bus number...
r = linedata(:,3); % Resistance, R...
x = linedata(:,4); % Reactance, X...
b = linedata(:,5); % Ground Admittance,
B/2...
a = linedata(:,6); % Tap setting value..
z = (r + i*x)/160.28; % Dividing by Z-base
y = zeros(num,1);
nl = length(fb); % No. of branches...
for t = 1:nl
y(t) = 1/z(t); % To get inverse of each
element...
end
b = i*b; % Make B imaginary...

nb = max(max(fb),max(tb)); % No. of buses...


nl = length(fb); % No. of branches...
Y = zeros(nb,nb); % Initialise YBus...

% Formation of the Off Diagonal Elements...


for k = 1:nl
Y(fb(k),tb(k)) = Y(fb(k),tb(k)) - y(k)/a(k);
Y(tb(k),fb(k)) = Y(fb(k),tb(k));
end

% Formation of Diagonal Elements....


for m = 1:nb
for n = 1:nl
if fb(n) == m
Y(m,m) = Y(m,m) + y(n)/(a(n)^2) + b(n);
elseif tb(n) == m
Y(m,m) = Y(m,m) + y(n) + b(n);
end
end
end
Y(6,6) = Y(6,6) + 1/(2.8985*i); %from the pdf

29
Y(25,25) = Y(25,25) + 1/(2.5561*i);
Y(18,18) = Y(18,18) + 1/(2.8985*i);
Y(33,33) = Y(33,33) + 1/(2.5561*i);
Y(nb,nb) = Y(nb,nb) + 1/(2.5561*i);

30
APPENDIX B

Table 4:Network and load data of the 33 bus test system

Sen
Nod
Br R S din S
Node Sendi e
. c. n. Branc Parm. g Br. Rc. n. Branch r Parm. X(
QL ng PL QL
n N N h r(Ω) X(Ω) PL no. Nd. N (Ω) Ω)
(kvar) (kW) (kva
o. d. d. (kW d.
r)
)

1 1 2 0.0922 0.0470 100 60 17 17 18 0.7320 0.5740 90 40

2 2 3 0.4930 0.2511 90 40 18 2 19 0.1640 0.1565 90 40

3 3 4 0.3660 0.1864 120 80 19 19 20 1.5042 1.3554 90 40

4 4 5 0.3811 0.1941 60 30 20 20 21 0.4095 0.4784 90 40

5 5 6 0.8190 0.7070 60 20 21 21 22 0.7089 0.9373 90 40

6 6 7 0.1872 0.6188 200 100 22 3 23 0.4512 0.3083 90 50

7 7 8 0.7114 0.2351 200 100 23 23 24 0.8980 0.7091 420 200

8 8 9 1.0300 0.7400 60 20 24 24 25 0.8960 0.7011 420 200

9 9 10 1.0440 0.7400 60 20 25 6 26 0.2030 0.1034 60 25

10 10 11 0.1966 0.0650 45 30 26 26 27 0.2842 0.1447 60 25

11 11 12 0.3744 0.1238 60 35 27 27 28 1.0590 0.9337 60 20

12 12 13 1.4680 1.1550 60 35 28 28 29 0.8042 0.7006 120 70

13 13 14 0.5416 0.7129 120 80 29 29 30 0.5075 0.2585 1200 600

14 14 15 0.5910 0.5260 60 10 30 30 31 0.9744 0.9630 150 70

15 15 16 0.7463 0.5450 60 20 31 31 32 0.3105 0.3619 210 100

16 16 17 1.2890 1.7210 60 20 32 32 33 0.3410 0.5302 60 40

31

You might also like