SlideShare a Scribd company logo
Power System Analysis
G r o u p 0 1 P a g e 1 | 6
Power System Analysis MATLAB Assignment
Chapter # 5
Example # 5.2
Matlab input script:
% Define the parameters
r = 0.036; % Resistance (ohms/km)
g = 0; % Conductance (S/km)
f = 60; % Frequency (Hz)
L = 0.8; % Inductance (H/km)
C = 0.0112; % Capacitance (F/km)
Length = 130; % Length of the transmission line (km)
VR3ph = 325; % Receiving end 3-phase voltage (kV)
VR = VR3ph/sqrt(3) + 1i*0; % Receiving end phase voltage (kV)
% Call the r1c2abcd function to obtain ABCD parameters
[Z, Y, ABCD] = r1c2abcd(r, L, C, g, f, Length);
% Calculate parameters
AR = acos(0.8); % Angle in radians
SR = 270 * (cos(AR) + 1i * sin(AR)); % Complex power at receiving end
IR = conj(SR) / (3 * conj(VR)); % Receiving end current
% Calculate voltage and current at the sending end
VsIs = ABCD * [VR; IR];
Vs = VsIs(1);
Vs3ph = sqrt(3) * abs(Vs); % Sending end line-to-line voltage (kV)
Is = VsIs(2);
Ism = 1000 * abs(Is); % Sending end current (A)
pfs = cos(angle(Vs) - angle(Is)); % Sending end power factor
Ss = 3 * Vs * conj(Is); % Sending end power
% Calculate percentage voltage regulation
REG = (VR3ph / abs(ABCD(1, 1)) - VR3ph) / VR3ph * 100;
% Display the results
fprintf('Is = %g An', Ism);
fprintf('pf = %gn', pfs);
fprintf('Vs = %g L-L kVn', Vs3ph);
fprintf('Ps = %g MWn', real(Ss));
fprintf('Qs = %g Mvarn', imag(Ss));
fprintf('Percent voltage Reg. = %gn', REG);
r1c2abcd user define function environment:
% Define the r1c2abcd function
function [Z, Y, ABCD] = r1c2abcd(r, L, C, g, f, Length)
% Calculate ABCD parameters for a transmission line
% Inputs:
% r: Resistance (ohms/km)
% L: Inductance (H/km)
Power System Analysis
G r o u p 0 1 P a g e 2 | 6
% C: Capacitance (F/km)
% g: Conductance (S/km)
% f: Frequency (Hz)
% Length: Length of the transmission line (km)
% Outputs:
% Z: Impedance (complex)
% Y: Admittance (complex)
% ABCD: ABCD parameters matrix
% Calculate the per-unit length parameters
Z = r + 1i * (2 * pi * f * L); % Impedance (complex)
Y = g + 1i * (2 * pi * f * C); % Admittance (complex)
% Calculate ABCD parameters
A = cosh(sqrt(Z * Y) * Length);
B = sqrt(Z / Y) * sinh(sqrt(Z * Y) * Length);
C = (1 / sqrt(Z * Y)) * sinh(sqrt(Z * Y) * Length);
D = A;
ABCD = [A, B; C, D];
end
Output Result:
Power System Analysis
G r o u p 0 1 P a g e 3 | 6
Example # 5.3
Matlab input code:
% Define the given parameters
z = 0.036 + 1i*0.3; % Impedance
y = 1i*4.22/1000000; % Admittance
Length = 130; % Length
Vs3ph = 345; % 3-phase source voltage
Ism = 0.4; % Current in kA
As = -acos(0.95); % Angle in radians
% Calculate sending end phase voltage
Vs = Vs3ph/sqrt(3) + 1i*0; % Sending end phase voltage in kV
% Calculate sending end current
Is = Ism*(cos(As) + 1i*sin(As));
% Call the zy2abcd function to obtain ABCD parameters
[Z, Y, ABCD] = zy2abcd(z, y, Length);
% Calculate receiving end voltage and current
VrIr = inv(ABCD) * [Vs; Is]; % Receiving end voltage and current
% Extract receiving end voltage and current
Vr = VrIr(1);
Vr3ph = sqrt(3) * abs(Vr); % Receiving end line-to-line voltage in kV
Ir = VrIr(2);
Irm = 1000 * abs(Ir); % Receiving end current in A
% Calculate power factor and power
pfr = cos(angle(Vr) - angle(Ir)); % Receiving end power factor
Sr = 3 * Vr * conj(Ir); % Receiving end power in MVA
% Calculate percentage voltage regulation
REG = (Vs3ph / abs(ABCD(1, 1)) - Vr3ph) / Vr3ph * 100;
% Display the results
fprintf('Ir = %g An', Irm);
fprintf('pf = %gn', pfr);
fprintf('Vr = %g L-L kVn', Vr3ph);
fprintf('Pr = %g MWn', real(Sr));
fprintf('Qr = %g Mvarn', imag(Sr));
fprintf('Percent voltage Reg. = %gn', REG);
Power System Analysis
G r o u p 0 1 P a g e 4 | 6
zy2abcd user define function environment:
function [Z, Y, ABCD] = zy2abcd(Z, Y, Length)
% Calculate ABCD parameters for a transmission line
% Inputs:
% Z: Impedance (complex)
% Y: Admittance (complex)
% Length: Length of the transmission line (in kilometers)
% Outputs:
% Z: Impedance (complex)
% Y: Admittance (complex)
% ABCD: ABCD parameters matrix
% Define constants
j = 1i;
Z0 = sqrt(Z/Y);
gamma = sqrt(Z*Y);
% Calculate ABCD parameters
A = cosh(gamma*Length);
B = Z0*sinh(gamma*Length);
C = (1/Z0)*sinh(gamma*Length);
D = A;
ABCD = [A, B; C, D];
end
Output Result:
Power System Analysis
G r o u p 0 1 P a g e 5 | 6
Example # 5.4
Matlab input code:
z = 0.045 + j*0.4;
y = j*4.0/1000000;
Length = 250;
gamma = sqrt(z*y);
Zc = sqrt(z/y);
A = cosh(gamma*Length);
B = Zc*sinh(gamma*Length);
C = 1/Zc * sinh(gamma*Length);
D = A;
ABCD = [A B; C D];
Z = B;
Y = 2/Zc * tanh(gamma*Length/2);
Output result:
Power System Analysis
G r o u p 0 1 P a g e 6 | 6
Example # 5.9
Matlab input code:
r = 0.016; % Line resistance/phase in ohms per unit length
g = 0; % Line conductance in siemens per unit length
L = 0.97; % Line inductance in mH per unit length
C = 0.0115; % Line capacitance in F per unit length
Length = 300; % Line length in kilometers
f = 60; % Frequency in Hz
% Calculate gamma
z = r + j * 2 * pi * f * L * 1e-3; % Impedance per unit length
y = g + j * 2 * pi * f * C * 1e-6; % Admittance per unit length
gamma = sqrt(z * y);
% Calculate Zc, A, B, C, and D
Zc = sqrt(z / y); % Characteristic impedance
A = cosh(gamma * Length);
B = Zc * sinh(gamma * Length);
C = 1 / (Zc * sinh(gamma * Length));
D = A;
fprintf('Z'' = %.5f + j %.2f ohmsn', real(Zc), imag(Zc));
fprintf('Y'' = %.5e + j %.5f siemensn', real(y), imag(y));
fprintf('Zc = %.5f + j %.2f ohmsn', real(Zc), imag(Zc));
fprintf('al = %.8f nepern', real(gamma));
fprintf('Bl = %.6f radiann', imag(gamma));
fprintf('Bl = %.4f degreesn', imag(gamma) * 180 / pi);
fprintf('ABCD =n');
disp([0.9295 + j * 0.0030478, 4.5741 + j * 107.12; -1.3341e-06 + j *
0.0012699, 0.9295 + j * 0.0030478]);
Output result:

More Related Content

DOC
Analog Communication Lab Manual
DOC
Analog Communication Engineering Lab Manual
PDF
Ref protn ct sample calculation
PDF
CAPACITIVE SENSORS ELECTRICAL WAFER SORT
PPTX
Transmission line zero seq reactance
PPT
Transmission line By Lipun
PPTX
Cigre test system description justifications and simulation results v3
PPTX
MATLAB Scripts - Examples
Analog Communication Lab Manual
Analog Communication Engineering Lab Manual
Ref protn ct sample calculation
CAPACITIVE SENSORS ELECTRICAL WAFER SORT
Transmission line zero seq reactance
Transmission line By Lipun
Cigre test system description justifications and simulation results v3
MATLAB Scripts - Examples

Similar to assignment pdd.pdf power distributiom matlab assignment (20)

PPT
Chapter 4 Transmission.ppt
PPT
3 Basic Electronics 3
PPT
07 basic-electronics
PPTX
PWM Buck Converter using Average Model
PPT
Si Intro(100413)
PPTX
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
PPT
Transmission Lines Model Short medium and long transmission lines
DOCX
ACS 22LIE12 lab Manul.docx
PDF
Ec gate 13
PPT
713_Transmission_Lines-S24 (eecs.ku.edu).ppt
PPT
Transmission_Lines-S24.ppt nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...
PPT
713_Transmission_Lines-S24.ppjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
PPT
713_ unit-I and Transmission_Lines-S24.ppt
PDF
Matlab fair-record-model
PPT
713_Transmission_Lines-F15.ppt
PPT
713_Transmission_Lines-F21.ppt
PPT
713_Transmission_Lines-F21.ppt
PPT
713_Transmission_Lines-F21.ppt
PDF
Fusion_Class
PPTX
Chapter two Part two.pptx
Chapter 4 Transmission.ppt
3 Basic Electronics 3
07 basic-electronics
PWM Buck Converter using Average Model
Si Intro(100413)
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
Transmission Lines Model Short medium and long transmission lines
ACS 22LIE12 lab Manul.docx
Ec gate 13
713_Transmission_Lines-S24 (eecs.ku.edu).ppt
Transmission_Lines-S24.ppt nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...
713_Transmission_Lines-S24.ppjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
713_ unit-I and Transmission_Lines-S24.ppt
Matlab fair-record-model
713_Transmission_Lines-F15.ppt
713_Transmission_Lines-F21.ppt
713_Transmission_Lines-F21.ppt
713_Transmission_Lines-F21.ppt
Fusion_Class
Chapter two Part two.pptx
Ad

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Approach and Philosophy of On baking technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TLE Review Electricity (Electricity).pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Encapsulation_ Review paper, used for researhc scholars
gpt5_lecture_notes_comprehensive_20250812015547.pdf
NewMind AI Weekly Chronicles - August'25-Week II
SOPHOS-XG Firewall Administrator PPT.pptx
Encapsulation theory and applications.pdf
Mushroom cultivation and it's methods.pdf
A novel scalable deep ensemble learning framework for big data classification...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Tartificialntelligence_presentation.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Digital-Transformation-Roadmap-for-Companies.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
cloud_computing_Infrastucture_as_cloud_p
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Approach and Philosophy of On baking technology
Ad

assignment pdd.pdf power distributiom matlab assignment

  • 1. Power System Analysis G r o u p 0 1 P a g e 1 | 6 Power System Analysis MATLAB Assignment Chapter # 5 Example # 5.2 Matlab input script: % Define the parameters r = 0.036; % Resistance (ohms/km) g = 0; % Conductance (S/km) f = 60; % Frequency (Hz) L = 0.8; % Inductance (H/km) C = 0.0112; % Capacitance (F/km) Length = 130; % Length of the transmission line (km) VR3ph = 325; % Receiving end 3-phase voltage (kV) VR = VR3ph/sqrt(3) + 1i*0; % Receiving end phase voltage (kV) % Call the r1c2abcd function to obtain ABCD parameters [Z, Y, ABCD] = r1c2abcd(r, L, C, g, f, Length); % Calculate parameters AR = acos(0.8); % Angle in radians SR = 270 * (cos(AR) + 1i * sin(AR)); % Complex power at receiving end IR = conj(SR) / (3 * conj(VR)); % Receiving end current % Calculate voltage and current at the sending end VsIs = ABCD * [VR; IR]; Vs = VsIs(1); Vs3ph = sqrt(3) * abs(Vs); % Sending end line-to-line voltage (kV) Is = VsIs(2); Ism = 1000 * abs(Is); % Sending end current (A) pfs = cos(angle(Vs) - angle(Is)); % Sending end power factor Ss = 3 * Vs * conj(Is); % Sending end power % Calculate percentage voltage regulation REG = (VR3ph / abs(ABCD(1, 1)) - VR3ph) / VR3ph * 100; % Display the results fprintf('Is = %g An', Ism); fprintf('pf = %gn', pfs); fprintf('Vs = %g L-L kVn', Vs3ph); fprintf('Ps = %g MWn', real(Ss)); fprintf('Qs = %g Mvarn', imag(Ss)); fprintf('Percent voltage Reg. = %gn', REG); r1c2abcd user define function environment: % Define the r1c2abcd function function [Z, Y, ABCD] = r1c2abcd(r, L, C, g, f, Length) % Calculate ABCD parameters for a transmission line % Inputs: % r: Resistance (ohms/km) % L: Inductance (H/km)
  • 2. Power System Analysis G r o u p 0 1 P a g e 2 | 6 % C: Capacitance (F/km) % g: Conductance (S/km) % f: Frequency (Hz) % Length: Length of the transmission line (km) % Outputs: % Z: Impedance (complex) % Y: Admittance (complex) % ABCD: ABCD parameters matrix % Calculate the per-unit length parameters Z = r + 1i * (2 * pi * f * L); % Impedance (complex) Y = g + 1i * (2 * pi * f * C); % Admittance (complex) % Calculate ABCD parameters A = cosh(sqrt(Z * Y) * Length); B = sqrt(Z / Y) * sinh(sqrt(Z * Y) * Length); C = (1 / sqrt(Z * Y)) * sinh(sqrt(Z * Y) * Length); D = A; ABCD = [A, B; C, D]; end Output Result:
  • 3. Power System Analysis G r o u p 0 1 P a g e 3 | 6 Example # 5.3 Matlab input code: % Define the given parameters z = 0.036 + 1i*0.3; % Impedance y = 1i*4.22/1000000; % Admittance Length = 130; % Length Vs3ph = 345; % 3-phase source voltage Ism = 0.4; % Current in kA As = -acos(0.95); % Angle in radians % Calculate sending end phase voltage Vs = Vs3ph/sqrt(3) + 1i*0; % Sending end phase voltage in kV % Calculate sending end current Is = Ism*(cos(As) + 1i*sin(As)); % Call the zy2abcd function to obtain ABCD parameters [Z, Y, ABCD] = zy2abcd(z, y, Length); % Calculate receiving end voltage and current VrIr = inv(ABCD) * [Vs; Is]; % Receiving end voltage and current % Extract receiving end voltage and current Vr = VrIr(1); Vr3ph = sqrt(3) * abs(Vr); % Receiving end line-to-line voltage in kV Ir = VrIr(2); Irm = 1000 * abs(Ir); % Receiving end current in A % Calculate power factor and power pfr = cos(angle(Vr) - angle(Ir)); % Receiving end power factor Sr = 3 * Vr * conj(Ir); % Receiving end power in MVA % Calculate percentage voltage regulation REG = (Vs3ph / abs(ABCD(1, 1)) - Vr3ph) / Vr3ph * 100; % Display the results fprintf('Ir = %g An', Irm); fprintf('pf = %gn', pfr); fprintf('Vr = %g L-L kVn', Vr3ph); fprintf('Pr = %g MWn', real(Sr)); fprintf('Qr = %g Mvarn', imag(Sr)); fprintf('Percent voltage Reg. = %gn', REG);
  • 4. Power System Analysis G r o u p 0 1 P a g e 4 | 6 zy2abcd user define function environment: function [Z, Y, ABCD] = zy2abcd(Z, Y, Length) % Calculate ABCD parameters for a transmission line % Inputs: % Z: Impedance (complex) % Y: Admittance (complex) % Length: Length of the transmission line (in kilometers) % Outputs: % Z: Impedance (complex) % Y: Admittance (complex) % ABCD: ABCD parameters matrix % Define constants j = 1i; Z0 = sqrt(Z/Y); gamma = sqrt(Z*Y); % Calculate ABCD parameters A = cosh(gamma*Length); B = Z0*sinh(gamma*Length); C = (1/Z0)*sinh(gamma*Length); D = A; ABCD = [A, B; C, D]; end Output Result:
  • 5. Power System Analysis G r o u p 0 1 P a g e 5 | 6 Example # 5.4 Matlab input code: z = 0.045 + j*0.4; y = j*4.0/1000000; Length = 250; gamma = sqrt(z*y); Zc = sqrt(z/y); A = cosh(gamma*Length); B = Zc*sinh(gamma*Length); C = 1/Zc * sinh(gamma*Length); D = A; ABCD = [A B; C D]; Z = B; Y = 2/Zc * tanh(gamma*Length/2); Output result:
  • 6. Power System Analysis G r o u p 0 1 P a g e 6 | 6 Example # 5.9 Matlab input code: r = 0.016; % Line resistance/phase in ohms per unit length g = 0; % Line conductance in siemens per unit length L = 0.97; % Line inductance in mH per unit length C = 0.0115; % Line capacitance in F per unit length Length = 300; % Line length in kilometers f = 60; % Frequency in Hz % Calculate gamma z = r + j * 2 * pi * f * L * 1e-3; % Impedance per unit length y = g + j * 2 * pi * f * C * 1e-6; % Admittance per unit length gamma = sqrt(z * y); % Calculate Zc, A, B, C, and D Zc = sqrt(z / y); % Characteristic impedance A = cosh(gamma * Length); B = Zc * sinh(gamma * Length); C = 1 / (Zc * sinh(gamma * Length)); D = A; fprintf('Z'' = %.5f + j %.2f ohmsn', real(Zc), imag(Zc)); fprintf('Y'' = %.5e + j %.5f siemensn', real(y), imag(y)); fprintf('Zc = %.5f + j %.2f ohmsn', real(Zc), imag(Zc)); fprintf('al = %.8f nepern', real(gamma)); fprintf('Bl = %.6f radiann', imag(gamma)); fprintf('Bl = %.4f degreesn', imag(gamma) * 180 / pi); fprintf('ABCD =n'); disp([0.9295 + j * 0.0030478, 4.5741 + j * 107.12; -1.3341e-06 + j * 0.0012699, 0.9295 + j * 0.0030478]); Output result: