You are on page 1of 4

University of San Carlos

Department of Electrical and Electronics Engineering

Name: Avenido, Julius Reiner, L. Rating:________ 


Subject/Schedule: EE3212L T 1:30-4:30 PM Date: 2/19/2021

Experiment No. 1

Kron Reduction (Node Elimination)

Objectives:

The objectives of this experiment is to write a code in MATLAB that reduces a user-inputted
bus impedance matrix using Kron reduction.

Introduction:

1
Methodology:

A, Writing the code


 In the MATLAB Home tab, a New Script is selected.
 In the editor window, the clear and clc command is written first to remove existing
variables in the workspace and clear the command window respectively.
clear,clc;
 Next, the input command is written to ask the user to enter the desired number of
buses.
n=input('Enter number of buses:');
 Next, the disp command is used to display the instruction to the user to enter the
elements in the Zbus or bus impedance matrix.
disp('Enter elements in Zbus');
 Next, a for loop alongside an input command is used to create a matrix of size n x n
after the user has entered all elements. For instance, if the user enters 2 buses, then he
will be asked to input 4 elements for the 2 x 2 matrix.
for x=1:n
for y=1:n
Zbus_old(x,y)=input(sprintf('Enter Z(%d,%d):',x,y));
end
end
 Next, the Zbus_old matrix is displayed.
Zbus_old
 Next, a for loop is used to reduce the n x n matrix into a (n-1) x (n-1) matrix through
kron reduction.
for k=1:n-1
for i=1:n-1
Zbus_new(k,i)=Zbus_old(k,i)-
Zbus_old(k,n)*Zbus_old(n,i)/Zbus_old(n,n);
end
end
 Next, disp command is used to display the instruction to the user on how to proceed
and acquire the Zbus_new. The pause command is used to wait for the user response. The
Zbus_new is then displayed.
disp('Press any key to proceed:');
pause;
Zbus_new
 Lastly, the new script is saved.

B. Testing the code

 The entire content of the script is highlighted. Right click is done and Evaluate
Selection is clicked.
 The command window will now ask the user for the number of buses. For this testing,
“3” is entered.
 Next, the values for Zbus_old_11 until Zbus_old_33 is entered (total of 9 elements). For this
testing: 0.0704i, 0.1690i, -0.1972i, -0.4225i, -0.0141i, 0.1831i, 0.2394i, -0.2254i, and
-0.0704i are entered in order.
 After the elements were entered, the Zbus_old matrix was displayed. Also the command
window will ask the user to press any key to proceed.
 Lastly, the Zbus_new matrix was displayed.

2
Tabulated Data:

0.0704 i 0.1690 i −0.1972i

[
Z bus = −0.4225i −0.0141 i 0.1831i
old

0.2394 i −0.2254 i −0.0704 i ]


0.8004 i
Z bus =
new [−0.6002i
0.2001i −0.6003 i ]
Discussion:

Figure 1. Testing the code


Discussion:

Figure 1 shows the evaluation of the script/code. After entering “3” for the number of buses,
the command window asked for the values from Z 11 to Z33 (total of 9 elements). After
creating the Zbus_old matrix, the Zbus_new matrix was acquired by using Kron Reduction.

Conclusions:

The student was able to write a code in MATLAB that reduces a user-inputted bus impedance
matrix using Kron reduction. By primarily using a for loop to create the desired size of the
matrix, the user was able to input the elements for the Z bus_old matrix. The Zbus_old matrix was
then reduced using another for loop with the kron reduction formula implemented within it to
acquire the Zbus_new matrix.

3
Reflection: 

I realized how important it is to refresh my programming skills once in a while. Even though
I am not extensively writing code, it is still very convenient when solving engineering
problems. By eliminating the manual labor required to compute data, I was able to focus on
actually analyzing the

Certification: 

I hereby certify that all the statements contained in this report are true to the best of my
knowledge and belief. A document made by:

2/19/21
Julius Reiner L. Avenido

References: 

[1] http://www.ece.mtu.edu/faculty/bamork/ee5240/KRON.pdf

You might also like