Professional Documents
Culture Documents
Load Flow
Load Flow
%
%
%
%
%
%%
%------------------Important----------------------%
% load flow equations are non-linear in nature. To find the solution of such
equations, it is assumed that
% 1. solution exists thats is (f(x)=0)
% 2. equation are continuous and diffrentiable.
% How to solve these non-linear equations of power (P,Q) ?.
% one can solve these equations by considering assumptions 1 and 2 and using
linear
% approximation method (also known as newton-raphson method). also to be
% noted here is that the taylor series expnasion is the basis of the newtonraphson method.
% so if we have one equation whose solution we assume exists and is
% continuous and diffretiable then according to the newton-raphson
% f(x0)=-(x-x0)*f'(x0)
----(1)
% where x0 is our initial guess.Equation 1 here gives the linear
approximation of the function f(x) at point x0.
% this equation will always result in straight line (Tagent line of f(x) at
the x0)
% thus our solution in this case by manipulating equation 1 will be
% x = x0-f(x0)/f'(x0) ------ (2) (updated value of x0)
% It should be noted that the equation 1 is linear equation , and higher order
derivatives (higher than 1) are
% neglected. hence for the solution of f(x) (non- linear equation), an
% iterative method is required to match the solution we are looking for
(because we have truncted the non-linear
% equation after first derivative, so obivously the solution will not be
exact, so iterations are required to get the
% exact solution).
% Equation 1 can be used in matrix form, in that case, f'(x0), will be our
% Jacobian which is a matrix of a first order partial derivatives of the nonlinear
% function (P,Q) evaluated at x0.
%___________________________________________________________________________
%---------------Bascis-----------------%
% When applied to power flow problem, the newton raphson is used to solve
% for a vector of bus voltage magnitudes and angles i.e.
% x = [angle;abs(V)]
% Things to note :
% 1) the voltage and angle at the swing bus is specified and therefore not
part of the the solution vector
% 2) the bus voltage magnitudes at PV buses are specified and therefore not
% part of abs (V). Only the bus voltage magnitudes of PQ buses are included
% 3) angle includes all PQ and PV buses
% therefore vector x is an m*1 vector with
% m = 2*n_pq+n_pv
; Where n_pq are number of PQ buses and n_pv are number
% of PV buses
% __________________________________________________________________________
Y(3,2)=-1/Z23;
Y(3,3)=1/Z13 + 1/Z23;
Y; % Print Y=G+jB Admittance Matrix
%----------Conductance Values------------%
G(1,1)=real(Y(1,1));
G(1,2)=real(Y(1,2));
G(1,3)=real(Y(1,3));
G(2,1)=real(Y(2,1));
G(2,2)=real(Y(2,2));
G(2,3)=real(Y(2,3));
G(3,1)=real(Y(3,1));
G(3,2)=real(Y(3,2));
G(3,3)=real(Y(3,3));
%--------Susceptance Values----------%
B(1,1)=imag(Y(1,1));
B(1,2)=imag(Y(1,2));
B(1,3)=imag(Y(1,3));
B(2,1)=imag(Y(2,1));
B(2,2)=imag(Y(2,2));
B(2,3)=imag(Y(2,3));
B(3,1)=imag(Y(3,1));
B(3,2)=imag(Y(3,2));
B(3,3)=imag(Y(3,3));
%--------- Given Specifications in pu (Known)----------%
V1MAG=1.0;
ANG1=0;
V2MAG=1.05;
P2sp=2.0;
P3sp=-5.0;
Q3sp=-1.0;
% -------------Calulate ANG2, V3MAG and ANG3---------------%
% ----Solution Parameters----%
Tolerance= 0.001;
Iter_Max=25;
%----- Initialization-------%
Iter=0;
i=0;
ConvFlag=1;
delANG2=0;
delANG3=0;
delMAG3=0;
%-------------- to be determined (Flat start)-----------%%%%%%%%
ANG2=0;
ANG3=0;
V3MAG=1.0;
%------------------ Start Iteration Process for N-R-----------------%
while( ConvFlag==1 && Iter < Iter_Max)
Iter=Iter+1;
i=i+1;
%%----------- update the Voltage and Angles to calculate new jacobian---%
ANG2=ANG2+delANG2;
ANG3=ANG3+delANG3;
V3MAG=V3MAG+delMAG3;
P31 = real(V(3))*conj((V(3)-V(1))/Z13);
P32 = real(V(3))*conj((V(3)-V(2))/Z23);
Q12
Q13
Q21
Q23
Q31
Q32
P1
Q1
P2
Q2
P3
Q3
=
=
=
=
=
=
=
=
=
=
=
=
imag(V(1))*conj((V(1)-V(2))/Z12);
imag(V(1))*conj((V(1)-V(3))/Z13);
imag(V(2))*conj((V(2)-V(1))/Z12);
imag(V(2))*conj((V(2)-V(3))/Z23);
imag(V(3))*conj((V(3)-V(1))/Z13);
imag(V(3))*conj((V(3)-V(2))/Z23);
real(S(1));
imag(S(1));
real(S(2));
imag(S(2));
real(S(3));
imag(S(3));