loadflow analysis of wind turbine generating systems - project report

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

Upload: faraz-khan

Post on 27-Mar-2015

502 views

Category:

Documents


15 download

TRANSCRIPT

Load Flow Analysis Involving Wind Turbine Generating UnitsA Project ReportSubmitted in partial fulfilment of the requirements for the award of the degree of

BACHELOR OF TECHNOLOGY in ELECTRICAL ENGINEERINGSubmitted by : FARAZ Guided by: Dr. B. Das Dr. Vinay Pant G. VAMSI KRISHNA

DEPARTMENT OF ELECTRICAL ENGINEERING INDIAN INSTITUTE OF TECHNOLOGY ROORKEE ROORKEE 247667 (INDIA) MAY, 2010

DECLARATION BY THE CANDIDATESWe 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)

AcknowledgementFirst 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

AbstractThis 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.

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

Table of Contents

1. Introduction ......................................................................................2

1

1. IntroductionA 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 WTGUPresently 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 WTGUThis 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 WTGUIn 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 followsas2+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 ,

andc = PeR22(Xl1 + Xm)2 + Pe(R2R1)2 |V |2R1R22 ,5

Then the slip is given bys = 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 WTGUThis 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. The6

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

andc = 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 WTGULoad 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 speedIn 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 studyA 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 operationThe 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 dataThe 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) Rated (kV) R1 (pu) Xl1 (pu) R2 (pu) Xl2 (pu) Xm (pu) Xc (pu) 0.50 0.69 0.005986 0.08212 0.01690 0.107225 2.5561 2.5561 1.0 0.69 0.005671 0.15250 0.00462 0.096618 2.8985 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 systemThe 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 fixed10

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. ResultsLoad 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 34 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 1

2

3

4

Bus No. 33 6 25 18 33 6 25 18 33 6 25 18 33 6 25 18

Type of WTGU Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed Pitch regulated fixed speed Semi-variable speed

Pe (MW) 0 0 0 0 0.5 0.5 0.5 0.5 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0

Qe (MVAr) 0 0 0 0 0.381 0.376 0.418 0.373 0.569 0.615 0.579 0.614 0.588 0.613 0.583 0.615

|V| pu 0.8930 0.9468 0.9779 0.9101 0.9262 0.9645 0.9860 0.9573 0.9476 0.9752 0.9916 0.9840 1.0191 1.0107 1.0066 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 1 2 3 4 Total System Load (MW) 4.715 4.715 4.715 1.4145 Total WTGU Gen (MW) 0.0 2.0 4.0 4.0 Substation input (MW) 5.001 2.851 0.867 -2.458 Power loss (MW) 0.286 0.136 0.152 0.127 Loss % 6.07 2.88 3.22 8.98

12

4.1.4. Discussion1. 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 1.04 Case 1 Case 2 Case 3 Case 4

1.02

1VOLTAGE 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. ConclusionIn 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 Matlabs 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. 401415, 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. 14011407, 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, 2528 September 2005.

16

APPENDIX AMain code : % Program for Newton-Raphson Load Flow Analysis.. tic; nbus = 33; Y = ybusppg(nbus); y_bus_matrix = Y; busd = busdatas3(nbus); BMva = 1; bus = busd(:,1); type = busd(:,2); V = busd(:,3); del = busd(:,4); Pg = busd(:,5)/BMva; Qg = busd(:,6)/BMva; Pl = busd(:,7)/BMva; Ql = busd(:,8)/BMva; Qmin = busd(:,9)/BMva; Qmax = busd(:,10)/BMva; P = Pg - Pl; Q = Qg - Ql; Psp = P; Qsp = Q; G = real(Y); B = imag(Y); pv = find(type == 2 ); pq = find(type == 3); npv = length(pv); npq = length(pq);

%number of buses % Calling ybusppg.m... % Calling busdatas.. % Base MVA.. % Bus Number..

% Type of Bus 1-Slack, 2-PV, % Specified Voltage.. % Voltage Angle..% % % % % % % % % % % %

3-PQ..

PGi.. QGi.. PLi.. QLi.. Minimum Reactive Power Limit Maximum Reactive Power Limit Pi = PGi - PLi for all buses Qi = QGi - QLi for PQ buses P Specified.. Q Specified.. Conductance matrix.. Susceptance matrix..

% PV Buses..

% PQ Buses.. % No. of PV buses.. % No. of PQ buses..

%the parameters of the induction generator are with the same base i.e 100MVA

x = 33; Pe1 = 1.0; Tol = 1;

% because WTGU is attached on last bus

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 , Ve2 = V(33); Qsp(33) = pitchreg(Pe1 Ve3 = V(25); Qsp(33) = pitchreg(Pe1 Ve4 = V(18); Qsp(18) = pitchreg(Pe1

Ve1)- Ql(6); , Ve2)-Ql(33); , Ve3)-Ql(25); , Ve4)-Ql(18);

% Calculate Pcalc and Qcalc

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

V(i)* + B(i,k)*sin(del(i)V(i)* - B(i,k)*cos(del(i)-

% Calculate change from specified value %for all buses dPa = Psp-Pcal; 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 Vector18

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); pq = find(type == 3); Qcal(i) = Qmax(i); elseif (Qcal(i) < Qmin(i)) type(i) = 3; npq = npq +1 ; npv = npv -1 ; pv = find(type == 2); pq = find(type == 3); 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

% PV Buses % PQ Buses

% PV Buses % PQ Buses

% 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:nbus20

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]; X = inv(J)*M; dTh = X(1:nbus-1); dV = X(nbus:end);Magnitude.. % Updating State Vectors.. % Jacobian Matrix.. % Correction Vector % Change in Voltage Angle.. % Change in Voltage

del(2:nbus) = dTh + del(2:nbus); k = 1; for i = 2:nbus21

%Voltage Angle..

if type(i) == 3 V(i) = dV(k) + V(i); k = k+1; end end

%Voltage magnitude

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); lined = linedatas3(nb); busd = busdatas3(nb); Vm = pol2rect(V,del);rectangular.. % % % % Calling Ybus program.. Get linedats.. Get busdatas.. Converting polar to

Del = 180/pi*del;Degree...

% Bus Voltage Angles in % From bus number... % To bus number... % No. of Branches..% PLi..

fb = lined(:,1); tb = lined(:,2); nl = length(fb); Pl = busd(:,7); Ql = busd(:,8); Iij = zeros(nb,nb); Sij = zeros(nb,nb); Si = zeros(nb,1);% Bus Current Injections..

% QLi..

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 % % % % % % Calling Linedatas... From bus number... To bus number... Resistance, R... Reactance, X... Ground Admittance,

linedata = linedatas3(num); fb = linedata(:,1); tb = linedata(:,2); r = linedata(:,3); x = linedata(:,4); b = linedata(:,5);B/2...

a = linedata(:,6); z = (r + i*x)/160.28; y = zeros(num,1); nl = length(fb); for t = 1:nl y(t) = 1/z(t);element...

% Tap setting value.. % Dividing by Z-base % No. of branches... % To get inverse of each

end b = i*b; nb = max(max(fb),max(tb)); nl = length(fb); Y = zeros(nb,nb);

% Make B imaginary... % No. of buses... % No. of branches... % 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 pdf29

Y(25,25) Y(18,18) Y(33,33) Y(nb,nb)

= = = =

Y(25,25) Y(18,18) Y(33,33) Y(nb,nb)

+ + + +

1/(2.5561*i); 1/(2.8985*i); 1/(2.5561*i); 1/(2.5561*i);

30

APPENDIX BTable 4:Network and load data of the 33 bus test systemBr . n o. R c. N d. S n. N d. Sen din g PL (kW ) S n. N d. Nod e QL (kva r)

Branc h r()

Parm. X()

Node QL (kvar)

Br. no.

Rc. Nd.

Branch r ()

Parm. X( )

Sendi ng PL (kW)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

0.0922 0.4930 0.3660 0.3811 0.8190 0.1872 0.7114 1.0300 1.0440 0.1966 0.3744 1.4680 0.5416 0.5910 0.7463 1.2890

0.0470 0.2511 0.1864 0.1941 0.7070 0.6188 0.2351 0.7400 0.7400 0.0650 0.1238 1.1550 0.7129 0.5260 0.5450 1.7210

100 90 120 60 60 200 200 60 60 45 60 60 120 60 60 60

60 40 80 30 20 100 100 20 20 30 35 35 80 10 20 20

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

17 2 19 20 21 3 23 24 6 26 27 28 29 30 31 32

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

0.7320 0.1640 1.5042 0.4095 0.7089 0.4512 0.8980 0.8960 0.2030 0.2842 1.0590 0.8042 0.5075 0.9744 0.3105 0.3410

0.5740 0.1565 1.3554 0.4784 0.9373 0.3083 0.7091 0.7011 0.1034 0.1447 0.9337 0.7006 0.2585 0.9630 0.3619 0.5302

90 90 90 90 90 90 420 420 60 60 60 120 1200 150 210 60

40 40 40 40 40 50 200 200 25 25 20 70 600 70 100 40

31