PPAGAF LFGS

Version 1.0.0 (75.6 KB) by Abhishek
HBYFJYTF
0 Downloads
Updated 25 Jun 2024

View License

% SLACK BUS
V1 = 1.04;
% PQ BUS
P2 = 0.5; Q2 = -0.2;
P3 = -1; Q3 = 0.5;
P4 = 0.3; Q4 = -0.1;
% GIVEN Y BUS
Y = [ (3-(1i)*9), (-2+(1i)*6), (-1+(1i)*3), 0;
(-2+(1i)*6), (3.666-(1i)*11), (-0.666 +(1i)*2), (-1+(1i)*3);
(-1+(1i)*3), (-0.666 +(1i)*2), (3.666-(1i)*11), (-2+(1i)*6);
0, (-1+(1i)*3), (-2+(1i)*6), (3-(1i)*9) ];
% ASSUME INITIAL CONDITION AND VOLTAGES W.R.T. BUS 1
min_error = 10;
n=0;
V12 = 1;
V13 = 1;
V14 = 1;
while min_error > 10^-4
V(2) = V12;
V(3) = V13;
V(4) = V14;
V12 = (1/Y(2,2))*(((P2-((1i)*(Q2)))/conj(V(2))) - (Y(2,1)*(V1)) - (Y(2,3)*V(3)) - (Y(2,4)*V(4)));
V13 = (1/Y(3,3))*(((P3-(1i)*(Q3))/conj(V(3))) - Y(3,1)*(V1) - Y(3,2)*V12 - Y(3,4)*V(4));
V14 = (1/Y(4,4))*(((P4-(1i)*(Q4))/conj(V(4))) - Y(4,1)*(V1) - Y(4,2)*V12 - Y(4,3)*V13);
error12 = abs(V12 - V(2));
error13 = abs(V13 - V(3));
error14 = abs(V14 - V(4));
min_error = min([error12 error13 error14]);
n=n+1;
V = [V12; V13; V14];
end
fprintf('Final Bus Voltages:\n');
disp(V)
fprintf('Number of iteration use: ')
disp(n)
Result : Final Bus Voltages: 1.0391 + 0.0155i
1.0460 - 0.1078i
1.0448 - 0.0348i
Number of iteration use: 11

Cite As

Abhishek (2026). PPAGAF LFGS (https://www.mathworks.com/matlabcentral/fileexchange/168831-ppagaf-lfgs), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.0