PSA Lab Contents - Lab 14 Report PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 115

Laboratory Contents

Sr. No. Lab Title

1. Overview of lab and introduction to MATLAB commands & Simulink

2. Simulation and Performance Analysis Of Single And Three Phase Transformer

3. Plot the daily load curve for given data using MATLAB

4. Simulation and performance analysis of synchronous machine using Simulink

5. Plot instantaneous voltage, current, active and reactive power

6. Implementation of Y-Bus(admittance bus) in MATLAB

7. Bus/node elimination Kron reduction Method

8. Modification of Existing Z-Bus

9. Implementation of Z-Bus by z-bus building algorithm

10. Implementation of iterative methods (Gauss seidal, Newton Raphson)

11. Power flow solutions by Gauss seidal method

12. Power flow solutions by Newton Raphson method

13. Determination of all parameters 4 bus system (Group C presentation)

14. fault analysis using Simulink


Lab session 01

OBJECTIVE
Overview of Lab and Introduction To MATLAB Commands & SIMULINK

REQUIREMENT
 Intel based computer
 MATLAB
THEORY
SIMULATION:
A simulation is an approximate imitation of the operation of a process or system; the act of simulating
first requires a model is developed. This model is a well-defined description of the simulated subject,
and represents its key characteristics, such as its behaviour, functions and abstract or physical
properties. The model represents the system itself, whereas the simulation represents its operation
over time.Model and simulate dynamic system behaviour with MATLAB, Simulink, and Sims cape.
Modeling is a way to create a virtual representation of a real-world system that includes software and
hardware. Common representations for system models include block diagrams, schematics, and state
charts.

MATHEMATICAL FORMULATION:
After the problem has been defined, it is necessary to develop a mathematical model to represent the
physical system. This requires specifying the characteristics of individual system components as well
as the relations which govern the interconnection of the elements.

SELECTION OF A SOLUTION TECHNIQUE:

The formulation of engineering problems involves mathematical expressions, such as sets of nonlinear
equations, differential equations, and trigonometric functions, which can not be evaluated directly by
a digital computer. It is important to select a method which is practical for machine computation and
in particular, will produce the desired results in a reasonable amount of computer time.
PROGRAM DESIGN:

The sequence of logical step by which a particular problem is to be solved, the allocation of memory,
the access of data, and the assignment of input and output units are important aspects of computer
program design.

PROGRAMMING:

A digital computer has a series of instructions consisting of operation codes and addresses which it is
able to interpret and execute. Program verification: A systematic series of checks must be performed
to ensure the correctness or problem formulation, method of solution and operation of the program.
You can use Simulink® to model a system and then simulate the dynamic behavior of that system. The
basic techniques you use to create a simple model in this tutorial are the same as those you use for
more complex models. This example simulates simplified motion of a car. A car is typically in motion
while the gas pedal is pressed. After the pedal is released, the car idles and comes to a stop.

A Simulink block is a model element that defines a mathematical relationship between its input and
output. To create this simple model, you need four Simulink blocks.

Figure 1.1
OPEN NEW MODEL
Use the Simulink Editor to build your models.

1. Start MATLAB®. From the MATLAB toolstrip, click the Simulink button .

Figure 1.2

Click the Blank Model template.

The Simulink Editor opens.

Figure 1.3

OPEN SIMULINK LIBRARY BROWSER:

 Simulink provides a set of block libraries, organized by functionality in the Library Browser.
The following libraries are common to most workflows:
 Continuous — Blocks for systems with continuous states
 Discrete — Blocks for systems with discrete states
 Math Operations — Blocks that implement algebraic and logical equations
 Sinks — Blocks that store and show the signals that connect to them
 Sources — Blocks that generate the signal values that drive the model

 From the Simulink Editor toolbar, click the Library Browser button .

Figure 1.4

Set the Library Browser to stay on top of the other desktop windows. On the Library Browser toolbar,

select the Stay on top button .

To browse through the block libraries, select a category and then a functional area in the left pane. To
search all of the available block libraries, enter a search term.

For example, find the Pulse Generator block. In the search box on the browser toolbar, enter pulse,
and then press the Enter key. Simulink searches the libraries for blocks with pulse in their name or
description, and then displays the blocks.

Figure 1.5
Get detailed information about a block. Right-click a block, and then select Help for the Pulse
Generator block. The Help browser opens with the reference page for the block. Blocks typically have
several parameters. You can access all parameters by double-clicking the block.

Arrange the blocks as follows by clicking and dragging each block. To resize a block, click and drag a
corner.

Figure 1.6

CONNECT BLOCKS:
 Connect the blocks by creating lines between output ports and input ports.
 Click the output port on the right side of the Pulse Generator block.
 The output port and all input ports suitable for a connection get highlighted.

Figure 1.7

Click the input port of the Gain block.

Simulink connects the blocks with a line and an arrow indicating the direction of signal flow.
Figure 1.8
 Connect the output port of the Gain block to the input port on the Integrator, Second
Order block.
 Connect the two outputs of the Integrator, Second Order block to the two Output blocks.
 Save your model. Select File > Save and provide a name.

Figure 1.9
INTRODUCTION TO MATLAB AND ITS BASIC COMMANDS:
 INTRODUCTION TO MATLAB:
MATLAB is a widely used numerical computation package. It serves both as a simple calculator and
as a sophisticated tool for making long complicated calculations and plot graphs of different functions
depending upon requirement. Models of dynamic systems can be built easily using SIMULINK.

 MATLAB COMMANDS:
 4. Special Variables and Constants.
 Inf. Infinity. NaN. ...
 Input/Output and Formatting Commands. Input/Output Commands.
 disp Displays contents of an array or string. fscanf. ...
 %s. Format as a string. ...
 Vector, Matrix and Array Commands. Array Commands.
 cat. Concatenates arrays. ...
 eye. Creates an identity matrix.
 GENERAL PURPOSE COMMANDS:
1) Operators and Special Characters

Table 1.1

2) Commands for Managing a Session


3)

Table 1.2
4) Special Variables and Constants

Table 1.3

5) Input/ Output Commands

Table 1.4

6) Format Codes for f print f and f scan f

Table 1.5

CREATING SIMPLE PLOTS:


The MATLAB command to plot a graph is plot(x,y). The vectors x = (1, 2, 3, 4, 5, 6) and

y = (3, −1, 2, 4, 5, 1)

x = [1 2 3 4 5 6];

y = [3 -1 2 4 5 1];

plot(x,y)

For example, to plot the function sin (x) on the interval [0, 2π], we first create a vector of x values
ranging from 0 to 2π, then compute the sine of these values, and finally plot the result.

x = 0:pi/100:2*pi;

y = sin(x);
>>plot(x,y)

Figure 1.11: Plot for the vectors x and y

ADDING TITLES, AXIS LABELS, AND ANNOTATIONS:


MATLAB enables you to add axis labels and titles. For example, using the graph from the previous
example, add an x- and y-axis labels.

>>x label(’x = 0:2\pi’)

>>y label(’Sine of x’)

>>title(’Plot of the Sine function’)

Figure 1.12: Plot of the Sine function


MULTIPLE DATA SETS IN ONE PLOT:
Multiple (x, y) pairs arguments create multiple graphs with a single call to plot. For example, these
statements plot three related functions of x: y1 = 2 cos(x), y2 = cos(x), and y3 = 0.5 ∗ cos(x), in the
interval 0 ≤ x ≤ 2π.

>> x = 0:pi/100:2*pi;
>> y1 = 2*cos(x);
>> y2 = cos(x);
>> y3 = 0.5*cos(x);
>>plot (x,y1,’--’,x,y2,’-’,x,y3,’:’)
>>x label(’0 \leq x \leq 2\pi’)
>>y label(’Cosine functions’)
>>legend (’2*cos(x)’,’cos(x)’,’0.5*cos(x)’)
>>title(’Typical example of multiple plots’)
>>axis([0 2*pi -3 3])

Figure 1.13: Typical example of multiple plots


QUESTION & ANSWER
Question: What is SIMULINK?
Answer: Simulink Basics Tutorial. Simulink is a graphical extension to MATLAB for modeling and
simulation of systems. One of the main advantages of Simulink is the ability to model a nonlinear
system, which a transfer function is unable to do. When a transfer function is built, the initial
conditions are assumed to be zero.

Question: What is Command Window in MATLAB?


Answer: a = 1. MATLAB immediately adds variable a to the workspace and displays the result in
the Command Window. a = 1. When you do not specify an output variable, MATLAB uses the
variable ans , short for answer, to store the results of your calculation.

Question: What is the use of MATLAB for electrical students?

Answer: Electrical Engineers are associated with design of complex systems. This involves rigorous
mathematical calculations and analysis with manual approach being a nasty one. This is the point
where the terrific computational capability of MATLAB and Simulink Modelling comes handy.
Lab session 02

OBJECTIVE

Simulation and performance analysis of single phase transformer and three phase transformer

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

Simulink is a software package in MATLAB that enables you to model, simulate, and analyze system whose
outputs change over time. Such systems are often referred to as dynamic systems. Simulink can be used to
explore the behavior of a wide range of real-world dynamic systems, including electrical circuits, shock
absorbers, braking systems, and many other electrical, mechanical, and thermodynamic systems

LINEAR TRANSFORMER

A Transformer Is A Static Device Which Transfers Electrical Energy From One Circuit To Another
Through The Process Of Electromagnetic Induction. It Is Most Commonly Used To Increase ('Step Up')
Or Decrease ('Step Down') Voltage Levels Between Circuits..

RLC SERIES BRANCH

The Series RLC Branch Block Implements A Single Resistor, Inductor, Or Capacitor, Or A Series
Combination Of These. Use The Branch Type Parameter To Select Elements You Want To Include In The
Branch Negative Values Are Allowed For Resistance, Inductance, And Capacitance

PROCEDURE

1. Starting Simulink
2. To Start Simulink, You Must First Start Matlab.
3. Simulink Library Browsers
4. Using The Simulink Toolbar To Enter Commands
5. . A Small Window Appears Containing Text That Describes The Button. The Window Is Called A
Tooltip.
6. Generating A Sine Wave
7. On The Dialog Box That Appears, Notice That The Stop Time Is Set To 10.0 (Its Default Value),
Changes It’s Into Inf
.CIRCUIT ANALYSIS AND SCOPE WAVE AFTER DOING EXPERIMENT IN LAB

1.circuit with load R and its wave foam when voltages are isolated ,DOWN AND UP
VOLTAGE DOWN

VOLTAGE UP
2. CIRCUIT WITH LOAD RL AND ITS WAVE FOAM WHEN VOLTAGES ARE
ISOLATED ,DOWN AND UP
VOLTAGE DOWN

VOLTAGE UP
3.CIRCUIT WITH NO LOAD AND ITS WAVE FOAM WHEN VOLTAGES ARE
ISOLATED ,DOWN AND UP
3 PHASE TRANSFORMER

Three-Phase Is Used So Often For Power Distribution Systems, It Makes Sense That We Would Need
Three-Phase Transformers To Be Able To Step Voltages Up Or Down. This Is Only Partially True, As
Regular Single-Phase Transformers Can Be Ganged Together To Transform Power Between Two Three-
Phase Systems In A Variety Of Configurations, Eliminating The Requirement For A Special Three-Phase
Transformer. However, Special Three-Phase Transformers Are Built For Those Tasks And Are Able To
Perform With Less Material Requirement, Less Size,

3 PHASE TRANFORMER CIRCUIT WITH R AND ITS ANALYSIS


QUESTIONS & ANSWERS

Question: What will be effect on voltages and current if we step up the Transformer?

Answer: When transformer will step up then voltages at secondary side will be greater than voltages at
primary side of transformer. Current at secondary side will be less than the current at primary side. Step
up transformer mainly used for large transmission lines to reduce voltage loss.

Question: If Transformer is Step Down then what will be effect on voltages and current?

Answer: When transformer will step down then voltages and secondary side will be less than voltages at
primary side of transformer. Current at secondary side will be greater than the current at primary side.
Step down transformer basically use at distribution level where electricity supplies to consumers. (11kV-
220V).

Question:What will be effect on current and voltages when primary and secondary winding
will equal(Isolated State)?

Answer: When primary winding and secondary winding of a transformer are equal then there will be no
change in current and voltages. Current and voltages will be equal at both primary and secondary side.
Question :what will be the effect on if load is R or RL?
While using R as load current and volagete will be in phase however
Lab session 03

OBJECTIVE

Plot the daily load curve for given date using MATLAB

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

LOAD:

An electrical load is an electrical component or portion of a circuit that consumes (active)


electric power. This is opposed to a power source, such as a battery or generator, which
produces power. In electric power circuits examples of loads are appliances and lights.

Fig. 2.1
LOAD VOLTAGE:

VOUT  RL
RL  Rs  Vs
Domestic load. Domestic load consists of lights, fans, refrigerators, heaters, television, small
motors for pumping water etc. Most of the residential load occurs only for some hours during
the day (i.e., 24 hours). For this reason, the load factor is low (10% to 12%).

Commercial load. Commercial load consists of lighting for shops, fans and electric appliances
used in restaurants etc. This class of load occurs for more hours during the day as compared to
the domestic load.

Industrial load. Industrial load consists of load demand by industries. The magnitude of
industrial load depends upon the type of industry. Thus small scale industry requires load up to
25 kW, medium scale industry between 25kW and 100 kW and large-scale industry requires
load above 500 kW. Industrial loads are generally not weather dependent.
PROCEDURE:
 Open the Editor in MATLAB.
 Saves the file with .m Extension.
 First enter the given data in editor in form of rows and column.
 Then separate the column with the extension data(:, no. of column)
 Find the difference between the load time
 Multiply the load time difference with the load at that time.
 Then we have find the average value of Load.
 And the find the peak value of load
 Find the load factor with the following formulae:
𝑨𝒗𝒆𝒓𝒂𝒈𝒆 (𝑳𝒐𝒂𝒅)
𝑳𝒐𝒂𝒅 𝑭𝒂𝒄𝒕𝒐𝒓 =
𝑴𝒂𝒙𝒊𝒎𝒖𝒎 (𝑳𝒐𝒂𝒅)
 Then find the length of the data
 Apply the for Loop For ploting the load curve
 Apply x-y axis, legend.title etc.
 Observe the graph.
 All the answers shown in the command window.
 The values enter in the format of 24 hours.
TASK GIVEN BY SIR :
For the following data find:
1: Find average value of load

2: Find Peak value.

3: Find load factor.

4: Plot the daily curve load

Interval from To Load(MW)


12 A.M 2 A.M 6
2 6 5
6 9 10
9 12 15
12 P.M 2 P.M 12
2 4 14
4 6 16
6 8 18
8 10 16
10 11 12
11 12 A.M 6

.
CODE ON MATLAB :
%power system analysis
%lab session 2
%11-02-2019
data=[0 2 6;2 6 5;6 9 10;9 12 15;12 14 12;14 16 14;16 18 16;18 20 18;20 22 16;22 23 12;23
24 6]
p= data (:,3); % it will give you the 3rd peak value
t1=data(:,1); % it will give you 2nd peak value
t2=data(:,2); % it will give you 3rd peak value
dt=t2-t1
w=p'*dt
pavg= w/sum(dt)
peak =max(p)
lf=(pavg/peak)
l=length(data)
tt =[t1,t2]
t=sort(reshape(tt,1,2*l))
for (n=1*l)
pp(2*n)=p(n)
end
plot (t,pp)
xlabel('time in hours ')
ylabel('power in mega watt')
title ('Load Curve')
grid on

OUTPUTS: load curve:

data =
0 2 6
2 6 5
6 9 10
9 12 15
12 14 12
14 16 16
16 18 16
18 20 18
20 22 16
22 23 12
Figure 2.1
23 24 6
w = 281
Average Power:
PAVG = 11.7083

Peak Value:
PEAK = 18

Load Factor:
LF = 65.0463

Question: Why we calculate the daily electric load curve?


Answer: It indicates the peak load which determines the maximum demand on the power
station. The area under the load curve gives the total energy generated in the period under
consideration. The area under the curve divided by the total numbers of hours gives the load.

Question: How do you calculate electrical load?


Answer: Locate the circuit for which you want to calculate the circuit load. Take the breaker
size and multiply it by the rated voltage. For example, a 20 amp breaker that operates at 120
volts has a maximum load of 2400 watts.

Question: What is electrical load Shifting?


Answer: Load shifting is one of the techniques used in demand-side management. It involves
moving the consumption of high wattage loads to different times within an hour or within a day
or even within a week. It doesn't lead to reduction in net quantity of energy consumed in an
electricity.

Question: What is the importance of load factor?


Answer: Its value is always less than one because maximum demand is never lower than
average demand, since facilities likely never operate at full capacity for the duration of an entire
24-hour day. A high load factor means power usage is relatively constant. Low load factor
shows that occasionally a high demand is set.
Lab session 04

OBJECTIVE

Simulation and performance analysis of synchronous machine using Simulink

REQUIREMENT

 Intel based computer

 MATLAB

 Simulink

THEORY

Synchronous Machine constitutes of both synchronous motors as well as synchronous generators. An AC


system has some advantages over DC system. Therefore, the AC system is exclusively used for generation,
transmission and distribution of electric power. The machine which converts mechanical power into AC
electrical power is called as Synchronous Generator or Alternator. However, if the same machine can be
operated as a motor is known as Synchronous Motor.

Basic Principles of Synchronous Machine


LAW OF ELECTROMAGNETIC INDUCTION AND LAW OF INTERACTION.

The detailed description is explained below.

Law of Electro-Magnetic Induction

This law is also called as Faraday’s First Law of Electromagnetic Induction. This law relates to the
production of emf, i.e.; emf is induced in a conductor whenever it cuts across the magnetic field as shown
above.
PROCEDURE

1. Starting Simulink
2. To Start Simulink, You Must First Start MATLAB.
3. Simulink Library Browsers
4. Using The Simulink Toolbar Browsers To Enter Commands
5. Write Constant ,3 Phase Synchronous Machine ,VI Measurement ,Bus Selector , 2 Scope ,RLC
// Load ,Power GUI and Add Them To Untitled
6. On The Dialog Box That Appears, Notice That The Stop Time Is Set To 10.0 (Its Default Value),
Changes It’s Into Inf
7. Connect The Parts As Shown In Figure And Then Set The Values To Be Required For This
Experiment
(i) Open The 3 Phase Synchronous Machine And Set Values
(ii) Open The Bus Selector (Select Swing Type) also select active reactive and rotor speed (pu)

EXPERIMENTAL WORK & OBSERVATION


1. SCOPE OF BUS SELECTOR

SCOPE OF VI MEASUREMENT
2.SCOPE OF VI MEASUREMENT
Question : What do you mean by the salient-pole type rotor?
Answer:Salient - pole type rotor means a low and moderate speed rotor having large diameter and small
axial length with projected poles coming out of the rotor frame the outer surface of which almost follows
the inner cylindrical surface of the stator frame.
Question: Define voltage regulation of an alternator?
Answer:The voltage regulation of an alternator is defined as the increase in terminal voltage when full load
is thrown off, assuming field current and speed remaining the same.
Percentage regulation = (E0 – V) /V x 100
E0 = No load terminal voltage
V = Full load rated terminal voltage.
Question : Write down the equation for frequency of EMF induced in an Altenator.
Answer:Frequency of emf induced in an Alternator,f ,expressed in cycles per second or Hz, is given by the
following equation
F = (PN)/120 Hz,
Where
P- Number of poles
N-Speed in rpm
Lab session 05

OBJECTIVE

Plot the instantaneous Voltage, Current, Active and Reactive Power

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

MATHEMATICAL ANALYSIS AND DERIVATION

Suppose a Voltage V is applied to a LCR circuit, where V is give by:

V(t)= Vm ×cos (ωt+Ɵv )


The current in this case is written by:

I(t)= Im ×cos (ωt+Ɵi )


Where, Vm = Voltage Amplitude, Im = Current Amplitude, ω = Angular Frequency, ø = Phase Constant

P(t)= V(t)* I(t)

P= Vm × cos (ωt+Ɵv )* Im ×cos (ωt+Ɵi )

P=VmIm cos (ωt+Ɵv )*cos (ωt+Ɵi)………. (1)


Derivation
By the trigonometric identity

2cosA cosB = cos (A−B) + cos (A+B)


Put this in equation 1
=Vm Im [0.5* cos (ωt + Ɵv –ωt -Ɵi )] + [0.5* cos (ωt +Ɵv +ωt +Ɵi)]
=0.5*Vm Im [ cos (Ɵv - Ɵi) ] + [0.5* cos (2*ωt +Ɵv + Ɵi)]
=0.5 *VmIm [ cos (Ɵv -Ɵi ) + cos (2 *ωt + Ɵv + Ɵv -Ɵv + Ɵi)]
=0.5*Vm Im [ cos (Ɵv - Ɵi) + cos 2 (ωt + Ɵv ) - ( Ɵv - Ɵi))]
Since cos ( α – β ) = cos α cos β + sin α sin β
=0.5* Vm Im [cos (Ɵv - Ɵi) + [ cos2 (wt+Ɵv )* cos (Ɵv - Ɵi)] + [sin2 (Ɵv -Ɵi) * sin (Ɵv -Ɵi)]] ……..(a)
Since Ɵ = Ɵv -Ɵi (+ve) for indicative load
Ɵ = Ɵv -Ɵ i (-ve) for capacitve load
Rms value of voltage = Vm / sqrt 2 = [V]
Rms value of current =Im / sqrt 2 = [I]
Replace Ɵ = Ɵv - Ɵi also 0.5* Vm Im = [V] [I]
Equation (a) Becomes
P(t) = [I] [V] {cos Ɵ+ [ cos 2 (ωt + Ɵv) cos Ɵ + sin 2 (wt+ Ɵv) sin Ɵ}
P(t) = [I] [V] cos Ɵ (1+cos 2 (wt+ Ɵv ) + [I] [V] (sinƟ sin2 (wt+ Ɵv)
Energy flow in circuit OR energy observed &returned by circuit
PR = [I] [V] cos [1 + cos 2 (ωt+Ɵv) ]
PX = [I] [V] [sin Ɵ sin2 (ωt+Ɵv) ]
POWER CONSUMPTION

Now we will use all the above formulae to derive Power in AC circuit. We know that P=VI. So we can write
power consumed in an AC circuit is: P=(Vm×sinωt) × (Im×sin(ωt+ϕ))

Note: Since P= V x I. So, If V=0 or I=0 then P=0. Also If V & I both are positive then P will be positive and
If anyone of either V & I is negative then power will be negative and If V&I both are negative then P will be
positive.

RESISTIVE CIRCUIT

Now for a Resistive Circuit we know that, Φ = 0 which implies cos Φ = 1

Pavg=Vrms×Rrms

INDUCTIVE CIRCUIT

But for a Inductive Circuit we know that, Φ = 90º which implies cos Φ = 0. This is as we know that voltage
across the inductor leads the current by 90 degrees.

Pavg=0

CAPACITIVE CIRCUIT

But for a Capacitive Circuit we know that, Φ = -90º which implies cos Φ = 0. This is as we know that voltage
across the inductor lags the current by 90 degrees.

Pavg=0

POWER FACTOR

The power factor of an AC electrical power system is defined as the ratio of the real power flowing to the
load to the apparent power in the circuit. It is dimensionless quantity and in the closed interval of -1 to 1.

realpower
powerfactor 
apparentpower
MATHLAB CODE

clc;
vm=100;
thetav=0;
z=1.25;
gama=60;
thetai=thetav-gama;
theta=(thetav-thetai)*pi/180;
im=vm/z;
wt=0:0.1:2*pi;
v=vm*cos(wt);
i=im*cos(wt+thetai*pi/180);
p=v.*i;
V=vm/sqrt(2);
I=im/sqrt(2);
P=V*I*cos(theta)
Q=V*I*sin(theta)
S=P+j*Q
pr=P*(1+cos(2*(wt+thetav)));
px=Q*(1+sin(2*(wt+thetav)));
pp=P*ones(1,length(wt))
xline=zeros(1,length(wt));
wt= (180/pi)*wt;
subplot(2,2,1)
plot(wt,v,wt,i,wt,xline)
grid on
title('instantanuous voltage &current')
xlabel('wt')
ylabel('instantanuous voltage ')
subplot(2,2,2)
plot(wt,p,wt,xline)
grid on
title('instantanuous power')
xlabel('wt')
ylabel('power')
subplot(2,2,3)
plot(wt,pr,wt,xline)
grid on
title('pr=P*1+cos2(wt+thetav)')
xlabel('wt')
ylabel('power')
subplot(2,2,4)
plot(wt,pr,wt,xline)
grid on
title('px=Q*1+sin2(wt+thetav;')
xlabel('wt')
ylabel('power')
WAVE FOAM AFTER PERFORM IN MATHLAB

instantanuous voltage &current instantanuous power


100 6000
instantanuous voltage

50 4000

power
0 2000

-50 0

-100 -2000
0 100 200 300 400 0 100 200 300 400
wt wt
pr=P*1+cos2(wt+thetav) px=Q*1+sin2(wt+thetav;
4000 4000

3000 3000
power

power

2000 2000

1000 1000

0 0
0 100 200 300 400 0 100 200 300 400
wt wt
QUESTIONS AND ANSWER

Question : What is single phase AC circuits ?

Answer:In electrical engineering, single-phase electric power is the distribution of alternating current
electric power using a system in which all the voltages of the supply .Single-phase distribution is used when
loads are mostly lighting and heating, with few large electric motors.

Question : What is average power in single phase AC circuits ?

Answer:AC Power. As in the case with DC power, the instantaneous electric power in an AC circuit is
given by P = VI, but these quantities are continuously varying. Almost always the desired power in an AC
circuit is the average power, which is given by Pavg = VI cosφ

Question : Why is average power of inductor is zero ?

Answer:"Zero time" can be an arbitrary chosen instant of time, because the process is periodic.
The average voltage across an ideal inductor is zero just as the average current into an ideal capacitor is
always zero. ... Eventually the current will reach a steady state where all the voltage is across this resistance.

Question:How does current flow in AC circuits ?

Answer: The electrons in an AC circuit don't really move along with the current flow. Instead, they sort of
back and forth. They move one direction for 1/60th of a second, and then turn around and go the other
direction for 1/60th of a second. ... Alternating current works in much the same way.
Lab session 06

OBJECTIVE

Implementation of Y-Bus (Admittance Bus) in MATLAB

REQUIREMENT
 Intel based computer

 MATLAB
THEORY

Bus Admittance Matrix


In a power system, Bus Admittance Matrix represents the nodal admittances of the various buses. With
the help of the transmission line, each bus is connected to the various other buses. Admittance matrix
is used to analyze the data that is needed in the load or a power flow study of the buses. It explains the
admittance and the topology of the network. The following are the advantages of the bus admittance
matrix.

 The data preparation of the bus admittance matrix is very simple.


 The formation of the bus admittance matrix and their modification is easy.
 The bus admittance matrix is a sparse matrix thus the computer memory requirement is less.

The amount of current present in the bus can be calculated with the help of formation of the
Admittance matrix. It is expressed as shown above. In the simplest form, the above matrix can be
written as shown below.

Where,

 I is the current of the bus in the vector form.


 Y is the admittance matrix
 V is the vector of the bus voltage.
Let us consider the figure given below.

Fig 4.1

From the above figure, the (3×3) admittance matrix is formed as shown below.

The diagonal elements of the Bus Admittance matrix are known as self-admittances and the off-
diagonal elements are known as mutual admittances.

PROCEDURE:

Steps for Solving Bus Admittance Matrix

1. First of all, form the bus Admittance matrix.


2. Select the reference bus to solve the network.
3. Define the known variables for all the other types of buses.
4. Assign the initial values for the voltage and angle for all the buses.
5. Calculate the power mismatch vector and power injection current.
6. Apply the various iteration methods like Newton-Raphson, Gauss-Siedel etc.
7. Check the mismatching vector that whether it is within the prescribed limit of 0.001 per unit. If
yes, then stop the procedure and if no then continues the steps of iteration to obtain the new
values.
8. Recheck the values again, whether the obtain values are within the limit.
LAB TASK:

TASK 1: IMPLEMENT THE Y-BUS METHOD

Fig 4.2

CODE IN MATLAB :
data=[1 2 10 -20j ; 1 3 10 -30j;2 3 16 -32j;1 0 0 -2j;2 0 0 -1j;3 0 2 -1j]
leftnode=data(:,1);
rightnode=data(:,2);
admittance=data(:,3)+data(:,4);
branches=length(data(:,2))
for ss=1:3;
for pp=1:3;
YBus(ss,pp)=0
end
end
%diagonal Enteries
for ii=1:3
for jj=1:3
if(ii==jj)
for k=1:branches
if(leftnode(k)==ii)||(rightnode(k)==jj)
YBus(ii,jj)=YBus(ii,jj)+admittance(k)
end
end
else
for k=1:branches
if(leftnode(k)==ii)&&(rightnode(k)==jj)||(leftnode(k)==jj)&&(rightnode(k)==ii)
YBus(ii,jj)=YBus(ii,jj)-admittance(k)
end
end
end
end
end

RESULTS:
data =
1.0000 + 0.0000i 2.0000 + 0.0000i 10.0000 + 0.0000i 0.0000 -20.0000i
1.0000 + 0.0000i 3.0000 + 0.0000i 10.0000 + 0.0000i 0.0000 -30.0000i
2.0000 + 0.0000i 3.0000 + 0.0000i 16.0000 + 0.0000i 0.0000 -32.0000i
1.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 2.0000i
2.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 1.0000i
3.0000 + 0.0000i 0.0000 + 0.0000i 2.0000 + 0.0000i 0.0000 - 1.0000i
branches =6
YBus = 0
YBus = 0 0
YBus = 0 0 0
YBus =
0 0 0
0 0 0
YBus =
0 0 0
0 0 0
YBus =
0 0 0
0 0 0

YBus =
0 0 0
0 0 0
0 0 0
YBus =
0 0 0
0 0 0
0 0 0
YBus =
0 0 0
0 0 0
0 0 0
YBus =
10.0000 -20.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -50.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 10.0000 -20.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -52.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i -16.0000 +32.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i -16.0000 +32.0000i
-10.0000 +30.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i -16.0000 +32.0000i
-10.0000 +30.0000i -16.0000 +32.0000i 0.0000 + 0.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i -16.0000 +32.0000i
-10.0000 +30.0000i -16.0000 +32.0000i 10.0000 -30.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i -16.0000 +32.0000i
-10.0000 +30.0000i -16.0000 +32.0000i 26.0000 -62.0000i
YBus =
20.0000 -52.0000i -10.0000 +20.0000i -10.0000 +30.0000i
-10.0000 +20.0000i 26.0000 -53.0000i -16.0000 +32.0000i
-10.0000 +30.0000i -16.0000 +32.0000i 28.0000 -63.0000i

TASK 2:
IMPLEMENT THE Y-BUS METHOD AND TAKE DATA FROM THE USER
CODE IN MATLAB :
%data=[1 2 0 -4j ;1 4 0 -2.5j; 1 3 0 -10j;2 4 0 -6.25j;3 4 0 -5j;1 0 0 -4j;2 0 0 -5j;3 0 0 -0.25j;4 0 2 -
0.5j]
y=input('enter the matrix')
leftnode=data(:,1);
rightnode=data(:,2);
admittance=data(:,3)+data(:,4);
branches=length(data(:,2))
for ss=1:4;
for pp=1:4;
YBus(ss,pp)=0;
end
end
%diagonal Enteries
for ii=1:4
for jj=1:4
if(ii==jj)
for k=1:branches
if(leftnode(k)==ii)||(rightnode(k)==jj)
YBus(ii,jj)=YBus(ii,jj)+admittance(k)
end
end
else
for k=1:branches
if(leftnode(k)==ii)&&(rightnode(k)==jj)||(leftnode(k)==jj)&&(rightnode(k)==ii)
YBus(ii,jj)=YBus(ii,jj)-admittance(k)
end
end
end
end
end
YBus

RESULTS:
enter the matrix[1 2 0 -4j ;1 4 0 -2.5j; 1 3 0 -10j;2 4 0 -6.25j;3 4 0 -5j;1 0 0 -4j;2 0 0 -5j;3 0 0 -0.25j;4
0 2 -0.5j]
y=
1.0000 + 0.0000i 2.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 4.0000i
1.0000 + 0.0000i 4.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 2.5000i
1.0000 + 0.0000i 3.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 -10.0000i
2.0000 + 0.0000i 4.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 6.2500i
3.0000 + 0.0000i 4.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 5.0000i
1.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 4.0000i
2.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 5.0000i
3.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 0.2500i
4.0000 + 0.0000i 0.0000 + 0.0000i 2.0000 + 0.0000i 0.0000 - 0.5000i
branches = 9
YBus =
0.0000 - 4.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 - 6.5000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -16.5000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 - 4.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -10.2500i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -10.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 0.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 5.0000i 0.0000 + 0.0000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 5.0000i 0.0000 - 2.5000i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 5.0000i 0.0000 - 8.7500i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 5.0000i 0.0000 -13.7500i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 5.0000i 2.0000 -14.2500i
YBus =
0.0000 -20.5000i 0.0000 + 4.0000i 0.0000 +10.0000i 0.0000 + 2.5000i
0.0000 + 4.0000i 0.0000 -15.2500i 0.0000 + 0.0000i 0.0000 + 6.2500i
0.0000 +10.0000i 0.0000 + 0.0000i 0.0000 -15.2500i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 6.2500i 0.0000 + 5.0000i 2.0000 -14.2500i
Question: What is primitive admittance matrix?

Answer:In power engineering, nodal admittance matrix (or just admittance matrix) or Y Matrix or Y
bus is an N x N matrix describing a power system with N buses. It represents the nodal admittance of
the buses in a power system.

Question:What is admittance in power system?

Answer :In electrical engineering, admittance is a measure of how easily a circuit or device will allow
a current to flow. It is defined as the reciprocal of impedance. The SI unit of admittance is the siemens
(symbol S); the older, synonymous unit is mho, and its symbol is ℧ (an upside-down uppercase omega
Ω).

Question:Why bus admittance matrix is sparse matrix?

Answer :The elements Admittance matrices in load flow system are maximum zero. they created sparse
matrix, which is computationally easy. Because in load flow all bus are not connected to all bus.
Whereas bus impedance matrix is an full matrix.
Lab Session 07
OBJECTIVE
Bus/Node Elimination kron reduction Method
REQUIREMENT

 Intel based computer

 MATLAB
THEORY
Kron Reduction
In power engineering, Kron reduction is a method used to reduce or eliminate the desired node without
need of repeating the steps like in Gaussian elimination.

Figure 6.1: Kron Reduction Example

In Kron Reduction the generating source cannot be attached with elimination part.
Pivot Bus
The which have to be removed called the pivot bus.
Pivot Entries
The diagonal entries of the removed bus called the pivot entries.
Consider an equation of the form
Ax=b

where A is an ( n X n ) real or complex valued matrix, x and b are vectors in either Rn or Cn . assume that

the b vector has a zero element in the nth row such that is given as

We can then eliminate the kth row and kth column to obtain a reduced ( n - 1) number of equations of the

The elimination is performed using the following elementary operations


PROCEDURE

Step_1:Select the specific bus that you want to be eliminated

Step_2:Remove that bus from the matrix such as the whole column and the whole row

Step_3:So the pivot point of removing matrix is

Step_4:Now write remaining all columns and rows in matrix as like

Step_5:For calculating the remaining elements we use the formula

Y jk(new ) = Y jk(old) – Y jp- Y pk


Y pp

Here for calculating the Y11 j = 1, K= 1 , P = 2


Step_6:After calculating the all values we have by the above formula we have

LAB TASK
CODE ON MATLAB
clc;
clear;
prompt = 'please enter values of y buses=';
y = input(prompt)
prompt1 = 'please enter value of pivot bus=';
p = input(prompt1) % pivot bus
size(y) =[row,col] %row/column size
y_new=zeros(row,col) %initialize zeros of (N-1) order
for j=1:row %in loop all (‘p’) are replaced by zeros
for k=1:col
if j==p||k==p
y_new(j,k)=0
else
y_new(j,k)=y(j,k)-(y(j,p)*y(p,k)/y(p,p))
end
end
end
y_new(:,p)=[]
y_new(p,:)=[]
y_new

Results

please enter values of y buses=[-16.75j 11.75j 2.5j 2.5j; 11.75j -19.25j 2.5j 5j; 2.5j 2.5j -5.8j 0; 2.5j 5j 0 -
8.3j]
y=
0.0000 -16.7500i 0.0000 +11.7500i 0.0000 + 2.5000i 0.0000 + 2.5000i
0.0000 +11.7500i 0.0000 -19.2500i 0.0000 + 2.5000i 0.0000 + 5.0000i
0.0000 + 2.5000i 0.0000 + 2.5000i 0.0000 - 5.8000i 0.0000 + 0.0000i
0.0000 + 2.5000i 0.0000 + 5.0000i 0.0000 + 0.0000i 0.0000 - 8.3000i

please enter value of pivot bus=2


p= 2
row = 4
col = 4

y_new =
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i

y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 - 5.4753i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.0000i 0.0000 + 0.6494i 0.0000 + 0.0000i
y_new =
0.0000 - 9.5779i 0.0000 + 0.0000i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 + 0.0000i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.0000i 0.0000 + 0.6494i 0.0000 - 7.0013i
y_new =
0.0000 - 9.5779i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 4.0260i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.6494i 0.0000 - 7.0013i
y_new =
0.0000 - 9.5779i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 4.0260i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.6494i 0.0000 - 7.0013i
y_new =Kron Reduction
0.0000 - 9.5779i 0.0000 + 4.0260i 0.0000 + 5.5519i
0.0000 + 4.0260i 0.0000 - 5.4753i 0.0000 + 0.6494i
0.0000 + 5.5519i 0.0000 + 0.6494i 0.0000 - 7.0013i

Question. What is kron reduction ?


Answer: In power engineering, Kron reduction is a method used to reduce or eliminate the desired node
without need of repeating the steps like in Gaussian elimination. It is named after American electrical
engineer Gabriel Kron
Lab session 08

Modification of Existing Z-Buses (Case 1, Case 2,Case 3,Case 4)

OBJECTIVE

 Adding a new bus with reference bus


 Adding a new bus with existing bus
 Adding an existing bus to the reference bus
 Connect two existing buses

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

Case 1: Adding of new bus with reference bus

The addition of the new bus ® connected to the reference node through Zb without a connection to any of
the buses of the original network cannot alter the original bus voltages when a current Ip is injected at the
new bus. The We note that the column vector of curren ts multiplied by the new Z bus will not alter the

voltages of the original ne twork and w ill result in the correct voltage at the new bus ®.
Case 2: Adding a new bus with existing bus
PROCEDURE

1. This procedure will add a new bus with reference bus


2. Now enter the values of matrix in MATLAB
3. Put the values of connected buses in matrix foam
4. Calculate the length of the matrix
5. Now add a new bus having some value of impedance with the reference bus
6. The addition of the new bus connected to the reference node through Zb without a connection to
any of the buses of the original network
7. It cannot alter the original bus voltages when a current Ip is injected at the new bus
8. the order of new matrix will increase L=L+1
9. for loop i=l:1 ,j=1:l
10. it will add new bus such as value of zb is in diagonal and the non-diagonal values will be zero
11. similarly for adding a new bus with existing bus
12. Calculate the length of the matrix
13. on the rows and columns use for loop for calculating the values of new bus such as
(i) z_new = z_org +z_bus
CODE ON MATLAB
% Case 1:Adding new bus with reference bus
clc
clear
prompt = 'plz enter values of Adding new buses=';
z_org = input(prompt)
%z_org=[1 2 3 4; 2 5 6 7; 3 6 8 9; 4 7 9 10]
z_bus=17;
l=length(z_org)
for i=1:l+1
for j=1:l+1
if i<=l && j<=l
z_new(i,j)=z_org(i,j)
else
if i==l+1 && j==l+1
z_new(i,j)=z_bus
else
z_new(i,j)=0
end
end
end
end
Command Window

plz enter values of Adding new buses=[1 2 3 4; 2 5 6 7; 3 6 8 9; 4 7 9 10]

z_org =

1 2 3 4

2 5 6 7

3 6 8 9

4 7 9 10

l =4

z_new =

1 2 3 4 0

2 5 6 7 0

3 6 8 9 0

4 7 9 10 0

0 0 0 0 17

z_bus=17
%CASE 2:ADDING A NEW BUS WITH EXISTING BUS
prompt = 'plz eneter values of Adding new buses=';
z_org = input(prompt)
%z_org=[1 2 3 4; 2 5 6 7; 3 6 8 9; 4 7 9 10]
z_bus=17;
l=length(z_org)
row=z_org(l,:)
col=z_org(:,l)
for i=1:l+1
for j=1:l+1
if i==l+1 && j==l+1
z_new(i,j)=z_org(l,l)+z_bus
end
if i<=l && j<=l
z_new(i,j)=z_org(i,j)
else
if i==l+1
for p=1:l
z_new(i,p)=row(p)
end
else if j==l+1
for q=1:l
z_new(q,j)=col(q)
end
end
end
end
end
end
Command Window

plz eneter values of Adding new buses=[1 2 3 4; 2 5 6 7; 3 6 8 9; 4 7 9 10]

z_org =

1 2 3 4

2 5 6 7

3 6 8 9

4 7 9 10

l = 4 , z_bus=17

z_new =1 2 3 4 4

2 5 6 7 7

3 6 8 9 9
4 7 9 10 10

4 7 9 10 27

Case 3: Adding an Existing Bus To The Reference Bus

PROCEDURE FOR CASE 3

14. This procedure will add a new bus with reference bus
15. Now enter the values of matrix in MATLAB
16. Put the values of connected buses in matrix foam
17. Calculate the length of the matrix
18. Actual bus (P) is connected to the bus (K) through zb
19. Restore order of original matrix eliminate bus (p) by the kron reduction method
20. Bus (P) eliminate bus (K) is connected to reference bus
21. Use the formula

MATLAB CODE

% Case 3: Adding an existing bus to the reference bus

prompt = 'please enter values of buses=';


z_org = input(prompt)
%z_org=[1 2 3 4 ;2 5 6 7 ;3 6 8 9 ;4 7 9 10]
z_bus=5
l=length(z_org)
row=z_org(l,:)
col=z_org(:,l)
for i=1:l+1
for j=1:l+1
if i==l+1 && j==l+1
z_new(i,j)=z_org(l,l)+z_bus
end
if i<=l && j<=l
z_new(i,j)=z_org(i,j)
else
if i==l+1
for p=1:l
z_new(i,p)=row(p)
end
else if j==l+1
for q=1:l
z_new(q,j)=col(q)
end

end
end
end
end
end

%kron reduction
y=z_new
x=length(y)
p=x
[row,col]=size(y)
y_new=zeros(row,col)
for j=1:row
for k=1:col
if j==p||k==p
y_new(j,k)=0
else
y_new(j,k)=y(j,k)-( y(j,p)*y(p,k)/y(p,p) )
end
end
end
y_new(:,p)=[]
y_new(p,:)=[]
y_new
Command Window

please enter values of buses=[1 2 3 4 ;2 5 6 7 ;3 6 8 9 ;4 7 9 10]

z_org =

1 2 3 4

2 5 6 7

3 6 8 9

4 7 9 10

z_bus =5

l=4

y_new =

-0.0667 0.1333 0.6000 1.3333

0.1333 1.7333 1.8000 2.3333

0.6000 1.8000 2.6000 3.0000

1.3333 2.3333 3.0000 3.3333

Case 4: Connect Two Existing Buses


PROCEDURE FOR CASE 4

1. This procedure will add a new bus with reference bus


2. Now enter the values of matrix in MATLAB
3. Put the values of connected buses in matrix foam
4. Calculate the length of the matrix
5. Repeat the case 2 with little modification such that
P = RJ – R K

Z_PP=(Z_JJ+Z_KK-2Z_JK)+Z_B

6. Kron reduction to restore the original matrix connect two existing buses
7. A virtual bus (p) is added between bus (J) and (K) via z_b

MATLAB CODE

% Case 4: Adding two existing bus

prompt = 'please enter values of buses=';

Zorg = input(prompt)
%Zorg=[1 2 3 4;2 5 6 7;3 6 8 9;4 7 9 10]
Zb=5
l=length(Zorg)
Row1 =Zorg(l,:)
Col1 =Zorg(:,l)
Row2 =Zorg(l-1,:)
Col2 =Zorg(:,l-1)
for i=1:l+1
for j=1:l+1
if i==l+1 && j==l+1
Znew(i,j)=Zb+Zorg(l,l)+Zorg(l-1,l-1)-(2*Zorg(l,l-1)); %formula
Zbb=Zb+Zjj+Zkk-2Zjk
end
if i<=l && j<=l
Znew(i,j)=Zorg(i,j)
else
if i==l+1
for p=1:l
Znew(i,p)=Row1(p)-Row2(p)
end
else
if j==l+1
for q=1:l
Znew(q,j)=Col1(q)-Col2(q)
end
end
end
end
end
end
Znew
%kron reduction
Y=Znew
x=length(Y)
p=x
[row,col]=size(Y)
Y_new=zeros(row,col)%produce 4*4 matrix of zeros
for j=1:row;
for k=1:col;
if j==p||k==p;
Y_new(j,k)=0;
else
Y_new(j,k)=Y(j,k)-((Y(j,p)*Y(p,k))/Y(p,p));
end
end
end
%To remove p row and column
Y_new(:,p)=[];
Y_new(p,:)=[];
%Y_new
zfinal=Y_new
zfinal

Command Window

please enter values of buses=[1 2 3 4;2 5 6 7;3 6 8 9;4 7 9 10]

Zorg =

1 2 3 4

2 5 6 7

3 6 8 9

4 7 9 10

Zb =5

l =4

Row1 = 4 7 9 10
Col1 =

10

Row2 =

3 6 8 9

Col2 =

Y_new =

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

Z_final =

0.8000 1.8000 2.8000 3.8000

1.8000 4.8000 5.8000 6.8000

2.8000 5.8000 7.8000 8.8000

3.8000 6.8000 8.8000 9.8000


QUESTIONS AND ANSWER

Question. What is the modification of bus ?

Answer: It will gives the relation between the bus impedance and admittance matrices. However it may
be possible that the topology of the power system changes by the inclusion of a new bus or line. In that
case it is not necessary to recomputed the Ybus matrix again for the formation of Zbus matrix the e aim is to
modify the matrix Zorig when a new bus or line is connected to the power system

Question. How to add new bus with reference bus ?

Answer: It is assumed that a new bus p (p > n) is added to the reference bus through an impedance Zp.
Since this bus is only connected to the reference bus, the voltage-current relations form the new system .

Question. How to add new bus with existing impedance bus ?

Answer: This is the case when a bus, which has not been a part of the original network, is added to an
existing bus through a transmission line with an impedance of Zb. Let us assume that p (p > n) is the new
bus that is connected to bus k (k < n) through Zb. Note from this figure that the current Ip flowing from
bus p will alter the voltage of the bus k
Lab session 09

OBJECTIVE

Implementation of Existing Z-Bus by z-bus building algorithm

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

Modification of Bus Impedance Matrix

Below equation gives the relation between the bus impedance and admittance matrices.
However it may be possible that the topology of the power system changes by the
inclusion of a new bus or line. In that case it is not necessary to recompute
the Ybus matrix again for the formation of Zbus matrix. We shall discuss four possible
cases by which an existing bus impedance matrix can be modified.

Let us assume that an n -bus power system exists in which the voltage-current relations
are given in terms of the bus impedance matrix as

The aim is to modify the matrix Zorig when a new bus or line is connected to the power
system.

Fig:Bus Impedance Matrix


IT HAS FOLLOWING CASES:

 Adding a New Bus with Reference Bus

It is assumed that a new bus p ( p > n ) is added to the reference bus through
an impedance Zp . The schematic diagram for this case is shown in Fig. 7.1.
Since this bus is only connected to the reference bus, the voltage-current
relations the new system are

Fig. 7.1 A new bus is added to the reference bus.

 Adding a New Bus to an Existing Bus through an Impedance

This is the case when a bus, which has not been a part of the original network, is added
to an existing bus through a transmission line with an impedance of Zb . Let us assume
that p ( p > n ) is the new bus that is connected to bus k ( k < n ) through Zb. Then the
schematic diagram of the circuit is as shown in Fig. 3.8. Note from this figure that the
current Ip flowing from bus p will alter the voltage of the bus k . We shall then have

In a similar way the current Ip will also alter the voltages of all the other buses as

Furthermore the voltage of the bus p is given by


Therefore the new voltage current relations are

It can be noticed that the new Zbus matrix is also symmetric.

Fig. 7.2 A new bus is added to an existing bus through an impedance.

MATLAB CODE for the implementation of z bus


%Method (General)
clc
clear all
o=input('plz enter the total number of buses < ')
count=0;
while count<=o
k=input('if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5
respectively')
switch k
case 1
zorg=input('zb of first bus to be attached with refrence bus')
case 2
l=input('plz enter the present number of buses < ')
for i=1:l^2%for loop
zold(i)=input('elements< ');
end
zorg=reshape(zold,l,l)
zb=input('plz enter the value of zb < ')
row=zorg(l,:)
col=zorg(:,l)
for i=1:l+1
for j=1:l+1
if i<=l&&j<=l
zorg(i,j)=zorg(i,j)
else
if i==l+1 && j==l+1
zorg(i,j)=zorg(l,l)+zb
else
if i==l+1
p=1:l;
zorg(i,p)=0
else if j==l+1
for q=1:l;
zorg(q,j)=0

end
end
end
end
end
end
end
case 3
l=input('plz enter the present number of buses < ')
for i=1:l^2%for loop
zold(i)=input('elements < ');
end
zorg=reshape(zold,l,l)
zb=input('plz enter the value of zb < ')

row=zorg(l,:)
col=zorg(:,l)
for i=1:l+1
for j=1:l+1
if i<=l&&j<=l
zorg(i,j)=zorg(i,j)
else
if i==l+1 && j==l+1
zorg(i,j)=zorg(l,l)+zb
else
if i==l+1
p=1:l;
zorg(i,p)=row(p)
else if j==l+1
for q=1:l;
zorg(q,j)=col(q)

end
end
end
end
end
end
end
case 4
l=input('plz enter the present number of buses < ')
for i=1:l^2%for loop
zold(i)=input('elements < ');
end
zorg=reshape(zold,l,l)
zb=input('plz enter the value of zb < ')
zc=input('plz enter the no of existing bus to be connected with
refrence bus')
zorg=zorg-((1/(zb+zorg(zc,zc)))*(mtimes(zorg(:,zc),zorg(zc,:))))
case 5
l=input('plz enter the present number of buses < ')
for i=1:l^2%for loop
zold(i)=input('elements <');
end
zorg=reshape(zold,l,l)
zb=input('plz enter the value of zb < ')
ze=input('plz enter the no of first existing bus to be connected
with second existing bus')
zf=input('plz enter the no of second existing bus to be connected with
first existing bus')
zorg=zorg-((1/(zb+zorg(ze,ze)+zorg(zf,zf)-2*zorg(ze,zf)))*(mtimes((zo
rg(:,ze)-zorg(:,zf)),((zorg(ze,:)-zorg(zf,:))))))
end
count=count+1
end

RESULTS:
command window processing
plz enter the total numer of buses < 5

o=5

if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5 respectively1

k=1

zb of first bus to be attached with refrence bus1.25i

zorg = 0.0000 + 1.2500i

count =1

if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5 respectively3

k=3

plz enter the present numer of buses < 1

l=1

elements < 1.25i

zorg = 0.0000 + 1.2500i

plz enter the value of zb < 0.25i

zb =0.0000 + 0.2500i

row = 0.0000 + 1.2500i

col = 0.0000 + 1.2500i

zorg =0.0000 + 1.2500i

zorg =0.0000 + 1.2500i 0.0000 + 1.2500i


zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 0.0000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i

count = 2

if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5 respectively3

k =3

plz enter the present numer of buses < 2

l=2

elements < 1.25i

elements < 1.25i

elements < 1.25i

elements < 1.5i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i

plz enter the value of zb < 0.4i

zb = 0.0000 + 0.4000i

row =0.0000 + 1.2500i 0.0000 + 1.5000i

col = 0.0000 + 1.2500i

0.0000 + 1.5000i

zorg =0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 0.0000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 0.0000i


zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i

count = 3

if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5 respectively3

k =3

plz enter the present numer of buses < 3

l=3

elements < 1.25i

elements < 1.25i

elements < 1.25i

elements < 1.25i

elements < 1.5i

elements < 1.5i

elements < 1.25i

elements < 1.5i

elements < 1.9i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i

plz enter the value of zb < 0.125i

zb =0.0000 + 0.1250i

row =0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i

col = 0.0000 + 1.2500i

0.0000 + 1.5000i

0.0000 + 1.9000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 0.0000i


0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 0.0000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 0.0000i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 2.0250i

count =4

if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5 respectively5

k=5

plz enter the present numer of buses < 4

l=4

elements <1.25i

elements <1.25i

elements <1.25i

elements <1.25i

elements <1.25i

elements <1.5i

elements <1.5i

elements <1.5i
elements <1.25i

elements <1.5i

elements <1.9i

elements <1.9i

elements <1.25i

elements <1.5i

elements <1.9i

elements <2.025i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 2.0250i

plz enter the value of zb < 0.02i

zb =0.0000 + 0.0200i

plz enter the no of first existing bus to be connected with second existing bus3

ze = 3

plz enter the no of second existing bus to be connected with first existing bus4

zf =4

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9172i

count = 5

if you want to perform case 1,2,3,4,5 then press 1,2,3,4,5 respectively4

k =4

plz enter the present numer of buses < 4

l=4

elements < 1.25i

elements < 1.25i

elements < 1.25i

elements < 1.25i


elements < 1.25i

elements < 1.5i

elements < 1.5i

elements < 1.5i

elements < 1.25i

elements < 1.5i

elements < 1.9i

elements < 1.9i

elements < 1.25i

elements < 1.5i

elements < 1.9i

elements < 1.9172i

zorg = 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i 0.0000 + 1.2500i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.5000i 0.0000 + 1.5000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000 + 1.9000i

0.0000 + 1.2500i 0.0000 + 1.5000i 0.0000 + 1.9000i 0.0000+1.9172i

plz enter the value of zb < 1.25i

zb =0.0000 + 1.2500i

plz enter the no of existing bus to be connected with refrence bus3

zc =3

zorg = 0.0000 + 0.7469i 0.0000 + 0.60763i 0.0000 + 0.53520i 0.0000 + 0.58461i

0.0000 + 0.6073i 0.0000 + 0.7292i 0.0000 + 0.64226i 0.0000 + 0.7015i

0.0000 + 0.53520i 0.0000 + 0.64226i 0.0000 + 0.71469i 0.0000 + 0.66528i

0.0000 + 0.58461i 0.0000 + 0.70157i 0.0000 + 0.60528i 0.0000 + 0.75361i

count =6
QUESTIONS & ANSWERS
Question. What are the benefits of modification of buses ?
Answer: we can be easily add a bus of remove a bus from the huge network of buses .it will be
very helpful in power consumption and power needed.it is very helpful in fault in power
distribution .for the power need high we can add an extra bus with the original network such as
the voltage of the existing bus will not be change

Question. What is the actual formula for calculating the z_new in case 4?
Answer: the formula used in case 4 as

P = R_j – R_k
Z_pp=(Z_jj+Z_kk - 2 Z_jk)+Z_b
Lab session 10

OBJECTIVE

Implementation of iterative methods (Gauss seidal, Newton Raphson)

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

GUASS SEIDAL METHOD


PROCEDURE FOR GUASS SEIDAL METHOD

1. First of all locate the buses and load


2. Named the buses with respect to load
3. The system given by

4.
5. Has a unique solution.
6. The coefficient matrix has no zeros on its main diagonal, namely a11,a22…..ann are nonzero.
7. At start iterative calculation, there are some assumed values for the unknown values. The process
continues till errors between all the known and actual quantities reduce below a pre-specified
value. At Gauss-Seidel load flow, by assuming the initial busses voltage of the ith by Vi(0), i = 2, n.
8. The active and reactive power injected at any busses can expand equation (5) as:
9. Apply the convergence theorm

MATLAB CODE
iter=0
k=1
x(k)=2
err=2
while((err>=(0.00001)) && (iter<=10))
x(k+1)=(-x(k).^3+6*x(k).^2+4)/9
err=x(k+1)-x(k)
k=k+1

disp('the given iteration is')


x
end

COMMOND WINDOW
Guasssiedal
iter = 0
k =1
x=2
err = 2
x =2.0000 2.2222
err =0.2222
k=2
the given iteration is
x = 2.0000 2.2222
x = 2.0000 2.2222 2.5173
err =0.2951
k=3
the given iteration is
x = 2.0000 2.2222 2.5173
x = 2.0000 2.2222 2.5173 2.8966
err = 0.3793
k=4
the given iteration is
x = 2.0000 2.2222 2.5173 2.8966
x =2.0000 2.2222 2.5173 2.8966 3.3376
err = 0.4410
k =5
the given iteration is
x =2.0000 2.2222 2.5173 2.8966 3.3376
x =2.0000 2.2222 2.5173 2.8966 3.3376 3.7398
err = 0.4022
k=6
the given iteration is
x =2.0000 2.2222 2.5173 2.8966 3.3376 3.7398
x =2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568
err = 0.2170
k= 7
the given iteration is
x = 2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568
x = 2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568 3.9988
err = 0.0420
k=8
the given iteration is
x =2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568 3.9988
x = 2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568 3.9988 4.0000
err =0.0012
k=9
the given iteration is
x =2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568 3.9988 4.0000
x =2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568 3.9988 4.0000 4.0000
err = 1.0162e-06
k =10
the given iteration is
x = 2.0000 2.2222 2.5173 2.8966 3.3376 3.7398 3.9568 3.9988 4.0000 4.0000
err =1.0162e-06
k =10
ans =11
NEWTON’S RAPSON METHOD

MATLAB CODE

%Newton Raphson Method


clear all
close all
clc
%change here for different functions
f=@(x) cos(x)-3*x+1
%this is the derivative of the above function
df=@(x) -sin(x)-3
%change lower limit 'a' and upper limit 'b'
a=0; b=1;
x=a;
for i=1:1:100
x1=x-(f(x)/df(x));
x=x1;
end
sol=x;
fprintf('Approximate Root is%.15f',sol)
a=0; b=1;
x=a;
er(5)=0;
for i=1:1:5
x1=x-(f(x)/df(x));
x=x1;
er(i)=x1-sol;
end
plot(er)
xlabel('Number of iteration')
ylabel('Error')
title('Error vs Number of iteration')

%Find the roots of given simultaneous equations using gauss seidel Method:
clc;
f1=@(x,y,z) (1/20)*(17-y+2*z);
f2=@(x,y,z) (1/20)*(-18-3*x+z);
f3=@(x,y,z) (1/20)*(25-2*x+3*y);
x=0; y=0; z=0;
for i=1:5
f1(x,y,z);
f2(x,y,z);
f3(x,y,z);
x=f1(x,y,z);
y=f2(x,y,z);
z=f3(x,y,z);
end
x
y
z

COMMOND WINDOW

x = 1.0000
y = -1.0000
z = 1.0000
QUESTIONS & ANSWERS

Question.Which of the following is an iterative method

Answer: terative method. In computational mathematics, an iterative method is a


mathematical procedure that uses an initial guess to generate a sequence of improving
approximate solutions for a class of problems, in which the n-th approximation is derived from
the previous ones.

Question.Does Gauss Seidel always converge?

Answer: Gauss-Seidel method is an iterative technique whose solution may or may notconverge.
Convergence is only ensured is the coefficient matrix, @ADnxn,is diagonally dominant,
otherwise the method may or may not converge.

Question. What is the Newton method process ?

Answer: In numerical analysis, Newton's method (also known as the Newton–Raphson method), named
after Isaac Newton and Joseph Raphson, is a method for finding successively better approximations to the
roots (or zeroes) of a real-valued function. It is one example of a root-finding algorithm.

Question.Does Newton's method always converge?

Answer: Newton's method will not converge at all. Generally, Newton's method doesnot converge if the
derivative is zero for one of the iteration terms, if there is no root to be found in the first place, or if the
iterations enter a cycle and alternates back and forth between different values.

---------------------------------------------------*********---------------------------------------------------------------
Lab session 11

OBJECTIVE

Power flow solutions by Gauss seidal method

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

INTODUCTION:

 The Gauss–Seidel method is also known as the Liebmann method and also known as method of
successive displacement
 It was only mentioned in a private letter from Gauss to his student Gerling in 1823
 A publication was not delivered before 1874 by Seidel

 It is an iterative method used to solve a linear system of equations. It is named after the German
mathematicians Carl Friedrich Gaussand Philipp Ludwig von Seidel.

 Guass seidel method is one of the common methods employed for solving power flow

BASIC FORMULA(NEED OF GSM ITERATION):


 EQUATION .

Va
Vb

Vc
Vn

GS METHOD IS VERY USEFUL FOR VERY SMALL SYSTEMS.


Ii=Io+I1+I2+……….I3
Ii=yi0Vi+yi1 (Vi-V1)+……..yin (Vi-Vn)
Ii=(yi0+yi1+yi2+……yin)vi-(yi1v1+yi2v2+yi3v3+…….+yinvn)

Yii=yi0+yi1+yi2+…… yin Ii=yiiVi+


Ii=(Pi-JQi/Viӿ)
Vin+1=1/yii [(Pi-JQi/Vi*n)+
NOTE: It is contradictory condition(we have to find Vi and also need Vi to find it so for that reason we use
Itterative methods).e.g. Guass-Siedel Method e.t.c.
In Guass siedel method convergence also depends on various other set of factors such as: selection of slack
bus, initial solution, acceleration factor, tolerance limit, level of accuracy of results needed, type and quality
of computer/ software used, etc
APPLICATION

Application in Engineering:
• The Guass-Siedel Method is a technical improvement which speeds the convergence of the
Jacobi method.

Other Application:
• It is of vital importance in iteration process in the diagonal element isolation method for thermal
radiation transfer rroblems.
• It is used to solve sound transmission problems
EXAMPLE 6.7 (THEORATICALLY) :
MATLAB CODE FOR THE THEORATICALLY SOLVED EXAMPLE USING GSM :
y12=input('plz enter line impedance between bus 1 and 2 < ')
y13=input('plz enter line impedance between bus 1 and 3 < ')
y23=input('plz enter line impedance between bus 2 and 3 < ')
disp('The line impedances are')
y12=y12
y13=y13
y23=y23
disp('The line impedances are converted to admittences')
y12=1/y12
y13=1/y13
y23=1/y23
v1=1.05+j*0;%slack bus voltage taken as refrence
%code for part A
iter=0;
s2=-2.566-j*1.102;
s3=-1.386-j*0.452;
v2=1+j*0.0;%assumed for guass siedal iteration
v3=1+j*0.0;%assumed for guass siedal iteration
for l=1:10%limit assumed for iteration
iter=iter+1;
v2=(conj(s2)/conj(v2)+y12*v1+y23*v3)/(y12+y23);
v3=(conj(s3)/conj(v3)+y13*v1+y23*v2)/(y13+y23);
end
v2
v3
%code for part b
pslack=conj(v1)*[v1*(y12+y13)-(y12*v2+y13*v3)]
%code for part c
l12=y12*(v1-v2);
l21=-l12;
l13=y13*(v1-v3);
l31=-l13;
l23=y23*(v2-v3);
l32=-l23;
s12=v1*conj(l12);
s21=v2*conj(l21);
s13=v1*conj(l13);
s31=v3*conj(l31);
s23=v2*conj(l23);
s32=v3*conj(l32);
SL12=s12+s21
SL13=s13+s31
SL23=s23+s32
MATLAB CODE (RESULTS)
ANSWERS:
plz enter line impedance between bus 1 and 2 < 0.02+j*0.04
y12 = 0.0200 + 0.0400i
plz enter line impedance between bus 1 and 3 < 0.01+j*0.03
y13 =0.0100 + 0.0300i
plz enter line impedance between bus 2 and 3 < 0.0125+j*0.025
y23 =0.0125 + 0.0250i
The line impedances are
y12 = 0.0200 + 0.0400i
y13 = 0.0100 + 0.0300i
y23 = 0.0125 + 0.0250i
The line impedances are converted to admittences
y12 = 10.0000 -20.0000i
y13 = 10.0000 -30.0000i
y23 = 16.0000 -32.0000i
iter = 10
v2 = 0.9800 - 0.0600i
v3 = 1.0000 - 0.0500i
pslack = 4.0949 - 1.8900i
SL12 = 0.0850 + 0.1700i
SL13 = 0.0500 + 0.1500i
SL23 = 0.0080 + 0.0160i
QUESTION & ANSWERS

Question : What is guass seidal method for power flow ?


Answer :It is an iterative method used to solve a linear system of equations. It is named after the German
mathematicians Carl Friedrich Gaussand Philipp Ludwig von Seidel.

Question : what are the advacement of guass-seidal method for power flow?
Answer :
ADVANCEMENTS

• Newton Rephson Method


• Steffensen’s Method
• Secant Method
• Frozen Slope Method

Question : what are the advantages of guass seidal method for power flow ?
 Simplicity in technique
 Small computer memory requirement
 Less computational time per iteration
 Guass Siedel method is very efficient for systems having less number of buses.
 Gauss-Seidel method can provide control of voltage magnitude and their angle
Lab session 12

OBJECTIVE

Power flow solutions by Newton Raphson method

REQUIREMENT

 Intel based computer

 MATLAB

THEORY

Newton Raphson Method is an iterative technique for solving a set of various nonlinear equations with
an equal number of unknowns. There are two methods of solutions for the load flow using Newton
Raphson Method. The first method uses rectangular coordinates for the variables while the second
method uses the polar coordinate form. Out of these two methods the polar coordinate form is used
widely.

Let us understand this method with the help of the equations.

The above equation (3) and (4) can also be written as shown below.

We have Δf = J ΔX

then I = 1, 2, ….n, I ≠ slack, and if


Then I = 1, 2, ….n, i ≠ slack, i ≠ PV bus
Where, the subscripts sp and cal denote the specified and calculated values, respectively, then the
equation (7) can be written as shown below.

The off diagonal and diagonal elements of the sub matrices H, N, M and L are determined by
differentiating equation (3) and (4) with respect to δ and |V|.

PROCEDURE OF NEWTON RAPHSON METHOD

The computational procedure for Newton Raphson Method using polar coordinate is given below.

 Form Y bus.
 Assume the initial value of the bus voltages |Vi|0 and phase angle δi0 for i = 2, 3, …..n for load buses
and phase angles for PV buses. Normally we set the assumed bus voltage magnitude and its phase angle
equal to the slack bus quantities |V1| = 1.0, δ1 = 0⁰ .
 Compute Pi and Qi for each load bus from the following equation (5) and (6) shown above.
 Now, compute the scheduled errors ΔPi and ΔQi for each load bus from the following relations given
below.

 For PV buses, the exact value of Qi is not specified, but its limits are known. If the calculated value of
Qi is within the limits only ΔPi is calculated. If the calculated value of Qi is beyond the limits, then an
appropriate limit is imposed and ΔQi is also calculated by subtracting the calculated value of Qi from
the appropriate limit. The bus under consideration is now treated as a load bus.
 Compute the elements of the Jacobian matrix.

 Obtain the value of Δδ and Δ|Vi| from the equation shown below.
 Using the values of Δδi and Δ|Vi| calculated in the above step, modify the voltage magnitude and phase
angle at all load buses by the equations shown below.

 Start the next iteration cycle following the step 2 with the modified values of |Vi|and δi.
 Continue until scheduled errors for all the load buses are within a specified tolerance that is

Where, ε denotes the tolerance level for load buses.

 Calculate the line and power flow at the slack bus same as in the Gauss Seidel method.

MATLAB TASK :

A fourth-order polynomial equation is given by (x4 −21x3 +147x2 −379x+252 = 0)


Write a MATLAB program to find the roots of the above polynomial by Newton Raphson method.
The program should prompt the user to input the initial estimate. Run using the initial estimates
of 0.

MATLAB CODE:

The following commands show the procedure for the solution of the given equation by the
Newton-Raphson method.

dx=1; % Change in variable is set to a high value

x=input(’Enter the initial estimate -> ’); % Initial estimate

iter = 0; % Iteration counter

disp(’iter Dc J dx x’) %Heading for result

while abs(dx) >= 0.001 & iter < 100 % Test for convergence

iter = iter + 1; % No. of iterations

Dc=0 - (x^4-21*x^3+147*x^2-379*x+252); % Residual

J = 4*x^3-63*x^2+ 294*x-379; % Derivative

dx= Dc/J; %Change in variable

x=x+dx; % Successive solution

fprintf(’%g’, iter), disp([Dc, J, dx, x])


RESULTS

Enter the initial estimate -> 0

Iter Dc J dx x

1 -252.0000 -379.0000 0.6649 0.6649

2 -59.0114 -210.1938 0.2807 0.9457

3 -8.0942 -153.9333 0.0526 0.9982

4 -0.2541 -144.3174 0.0018 1.0000

5 -0.0003 -144.0003 0.0000 1.0000


QUESTIONS & ANSWERS:

Question 1: What is Newton Raphson method ?

Answer : The Newton-Raphson method (also known as Newton's method) is a way to quickly find a
good approximation for the root of a real-valued function f(x)=0. It uses the idea that a continuous and
differentiable function can be approximated by a straight line tangent to it.

Question 2 : what are advantages of Newton Raphson method for power flow study ?

Answer :

 It possesses quadratic convergence characteristics. Therefore, the convergence is very fast.


 the number of iterations is independent of the size of the system. Solutions to a high
accuracy is obtained nearly always in two to three iterations for both small and large
systems.
 The Newton Raphson Method convergence is not sensitive to the choice of slack bus.

Question 3: what are limitations of Newton Raphson method for power flow study?

Answer :

 This solution technique is difficult.


 It takes longer time as the elements of the Jacobian are to be computed for each iteration.
 The computer memory requirement is large.
Lab session 13

OBJECTIVE
Determination all parameters for bus system using power flow method

REQUIREMENT
 Intel based computer
 MATLAB
THEORY
BUS:

 a bus in a power system is defined as the vertical line or bar at which several components of the
power system like generators,loads etc are connected.

 Four quanities associated with each bus:

 voltage magnitude

 phase angle

 real power

 reactive power

BUS TYPES:

There are three major types of buses in power system:

• slack bus/swing bus

• load bus

• voltage controlled bus

SLACK BUS:

• slack bus is also known as swing bus.at slack bus voltage magnitude and angle are specified.

• real and reactive power components are unknown.

it is also known as reference bus

LOAD BUS

• Also known as P-Q bus.

• at load bus real and reactive power are specified.


• voltage magnitude and phase angle are unknown.

VOLTAGE CONTROL BUS:

• Also known as PV,generator bus,regulated bus and power bus.

• real power and voltage magnitude are specified.

• phase angle and reactive power components are unknown.

METHODS:

• At each bus in power system only two quantities are specified that describe its type.

so,we find other two quantities by using different methods:

• Gauss-seidel

• Newton raphson

• Decoupled method

GAUSS-SEIDEL METHOD:

We use gauss seidel method there because of following reasons:

• It is an iterative method used to solve a linear system of equations. It is named after the German
mathematicians Carl Friedrich Gaussand Philipp Ludwig von Seidel.

• Guass seidel method is one of the common methods employed for solving power flow equations.

• GS method is very useful for very small systems.


MATHEMATICAL FORMULAE’S:
TASKS:
y12= input( 'entre y12=' )
y13=input('entre y13=')
y23=input('entre y23=')
disp('The line impedances are converted to admittences')
y12=1/y12
y13=1/y13
y23=1/y23
k=input('plz number number of buses=')
c=1
for (g=1:k)
disp('slack bus=1')
disp('PQ bus=2')
disp('voltage controlled bus=3')
w=input('plz enter type of bus=')
if w==1
v(w)=input('voltage of slack bus=')
angle(w)=input('angle of slack bus=')
s(w)=0
p(w)=0
end
if w==2
s(w)=input('enter power in p.u of PQ bus=')
v(w)=input('enter voltage=')
p(w)=0
end
if w==3
v(w)=input('enter voltage of voltage control bus=')
p(w)=input('enter real power of voltage control bus=')
s(w)=0
end

if v(w)==0
v(w)=1
end
c=c+1
end
iter=0;
for l=1:7%limit assumed for iteration
iter=iter+1;
v(1,2)=((conj(s(1,2))/conj(v(1,2)))+(y12*v(1,1))+(y23*v(1,3)))/(y12+y23);
q=-imag(conj(v(1,3))*[v(1,3)*(y13+y23)-(y13*v(1,1))-(y23*v(1,2))]);
v(1,3)=(complex(p(1,3),-q)/conj(v(1,3))+(y13*v(1,1))+(y23*v(1,2)))/(y13+y23);
end
disp('number of iteration')
iter
disp('reactive power of bus 3')
q
disp('final solution is...........')
disp('voltages of bus 2')
v(1,2)
disp('voltages of bus 3')
v(1,3)
disp('power of slack bus')
pslack=conj(conj(v(1,1))*[v(1,1)*(y12+y13)-(y12*v(1,2)+y13*v(1,3))])
disp('power of voltage control bus')
pbus3=complex(p(1,3),q)
%-------------------
%code for part c
l12=y12*(v(1,1)-v(1,2));
l21=-l12;
l13=y13*(v(1,1)-v(1,3));
l31=-l13;
l23=y23*(v(1,2)-v(1,3));
l32=-l23;
s12=v(1,1)*conj(l12);
s21=v(1,2)*conj(l21);
s13=v(1,1)*conj(l13);
s31=v(1,3)*conj(l31);
s23=v(1,2)*conj(l23);
s32=v(1,3)*conj(l32);
disp('line losse are.....')
SL12=s12+s21
SL13=s13+s31
SL23=s23+s32

RESULTS :
entre y12=0.02+0.04i

y12 = 0.0200 + 0.0400i

entre y13=0.01+0.03i

y13 = 0.0100 + 0.0300i

entre y23=0.0125+0.025i

y23 = 0.0125 + 0.0250i

The line impedances are converted to admittences

y12 = 10.0000 -20.0000i


y13 =10.0000 -30.0000i

y23 = 16.0000 -32.0000i

plz number number of buses=3

k=3
c= 1
slack bus=1
PQ bus=2
voltage controlled bus=3
plz enter type of bus=1
w=1
voltage of slack bus=1.05
v = 1.0500
angle of slack bus=0
angle = 0
s =0
p=0
c= 2
slack bus=1
PQ bus=2
voltage controlled bus=3
plz enter type of bus=2
w= 2
enter power in p.u of PQ bus=-4-2.5i
s = 0.0000 + 0.0000i -4.0000 - 2.5000i
enter voltage=0
v = 1.0500 0
p =0 0
v = 1.0500 1.0000
c =3
slack bus=1
PQ bus=2
voltage controlled bus=3
plz enter type of bus=3
w =3
enter voltage of voltage control bus=1.04
v = 1.0500 1.0000 1.0400
enter real power of voltage control bus=2
p =0 0 2
s =0.0000 + 0.0000i -4.0000 - 2.5000i 0.0000 + 0.0000i
c=4
number of iteration
iter =7
reactive power of bus 3
q =1.2985
final solution is...........
voltages of bus 2
ans =0.9685 - 0.0450i
voltages of bus 3
ans =1.0367 - 0.0078i
power of slack bus
pslack =2.1856 + 1.5755i
power of voltage control bus
pbus3 = 2.0000 + 1.2985i
line losse are.....
SL12 = 0.0867 + 0.1735i
SL13 = 0.0024 + 0.0071i
SL23 =0.0968 + 0.1935i
QUESTONS & ANSWERS

Question : What is slack bus?


Answer :
• slack bus is also known as swing bus.at slack bus voltage magnitude and angle are specified.

• real and reactive power components are unknown.

it is also known as reference bus

Question :What is P_Q bus?


Answer :
• Also known as laod bus.

• at load bus real and reactive power are specified.

• voltage magnitude and phase angle are unknown.

Question : what is P_V buses


Answer :
• Also known as P V ,generator bus ,regulated bus and power bus.

• real power and voltage magnitude are specified.

• phase angle and reactive power components are unknown.


Lab session 14

OBJECTIVE
Fault analysis using SIMULINK
REQUIREMENT
 Intel based computer
 MATLAB
THEORY
FAULT ANALYSIS:
Under normal conditions, a power system operates under balanced conditions with all equipment
carrying normal load currents and the bus voltages within the prescribed limits. This condition can be
disrupted due to a fault in the system. A fault in a circuit is a failure that interferes with the normal flow
of current. A short circuit fault occurs when the insulation of the system fails resulting in low impedance
path either between phases or phase(s) to ground. This causes excessively high currents to flow in the
circuit, requiring the operation of protective equipment’s to prevent damage to equipment. The short
circuit faults can be classified as:

1. Symmetrical faults
2. Unsymmetrical faults.

1.SYMMETRICAL FAULTS:
A three phase symmetrical fault is caused by application of three equal fault impedances Z¯ f to the
three phases, as shown in Fig. 14.1. If Z¯ f = 0 the fault is called a solid or a bolted fault. These faults
can be of two types: (a) line to line to line to ground fault (LLLG fault) or (b) line to line to line fault
(LLL fault). Since the three phases are equally affected, the system remains balanced. That is why, this
fault is called a symmetrical or a balanced fault and the fault analysis is done on per phase basis. The
behaviour of LLLG fault and LLL fault is identical due to the balanced nature of the fault. This is a
very severe fault that can occur in a system and if Z¯ f = 0, this is usually the most severe fault that can
occur in a system. Fortunately, such faults occur infrequently and only about 5% of the system faults
are three phase faults.

Fig 14.1
2. UNSYMMETRICAL FAULTS:
Faults in which the balanced state of the network is disturbed are called unsymmetrical or unbalanced
faults. The most common type of unbalanced fault in a system is a single line to ground fault (LG fault).
Almost 60 to 75% of faults in a system are LG faults. The other types of unbalanced faults are line to
line faults (LL faults) and double line to ground faults (LLG faults). About 15 to 25% faults are LLG
faults and 5 to 15% are LL faults. These faults are shown in Fig. 14.2.

Fig 14.2

PROCEDURE:
1. First open the MATLAB & open Simulink library
2. Then extract the components from Simulink library.
3. Then connect the components to make a proper network. As shown in figure
4. Then set the values of the components like resistance, inductance, fault time etc.
5. Then we run the system to observe its outcomes.
LAB TASK :

1) DETERMINE THE FAULT ANALYSIS OF LLG OF THE GIVEN SYSTEM.

Voltage output:

Current output:
2) DETERMINE THE FAULT ANALYSIS OF LG OF THE GIVEN SYSTEM.

VOLTAGE OUTPUT:

CURRENT OUTPUT:
3) DETERMINE THE FAULT ANALYSIS OF LLLG OF THE GIVEN SYSTEM.

Voltage output:

Current output:
Questions And Answers:

Question: What is fault analysis in a power system?

Answer: In an electric power system, a fault or fault current is any abnormal electric current.
The analysis of these types of faults is often simplified by using methods such as symmetrical
components. The design of systems to detect and interrupt power system faults is the main objective
of power-system protection.

Question: Which fault is most severe?

Answer: Three-phase symmetrical faults are known to be the most severe in a power system due to
large fault currents. However, single phase to ground faults are more common faults that occurs. If not
checked in due time, these faults may grow to symmetrical fault which is uncommon but most severe.

Question:Why is fault analysis necessary?

Answer: The analysis of Power Systems under fault condition represents one of the most important
and complex task in Power Engineering. The studies and detection of these faults is necessary to ensure
that the reliability and stability of the power system do not suffer a decrement as a result of a critical
event such a fault.

You might also like