Phasor Toolbox For AC Circuit Analysis Using MATLAB
Phasor Toolbox For AC Circuit Analysis Using MATLAB
Omer Farook is a member of the faculty of Electrical and Computer Engineering Technology at Purdue
University, Nothwest. Farook received the diploma of licentiate in mechanical engineering and B.S.M.E.
in 1970 and 1972, respectively. He further received B.S.E.E. and M.S.E.E. in 1978 and 1983, respec-
tively, from Illinois Institute of Technology. Farook’s current interests are in the areas of embedded
system design, hardware-software interfacing, digital communication, networking, image processing, and
biometrics, C++, Python, PHP and Java languages. He has a keen interest in pedagogy and instruction de-
livery methods related to distance learning. He has a deep commitment to social justice and in achieving
economic and educational equity.
Dr. Wangling Yu, Purdue University Northwest
Dr. Wangling Yu is an assistant professor in the Electrical & Computer Engineering Technology De-
partment of the Purdue University Northwest. He was a test engineer over 15 years, providing technical
leadership in the certification, testing and evaluation of custom integrated security systems. He received
his PhD degree in Electrical Engineering from the City University of New York in 1992, specializing in
control theory and electronic technology.
American
c Society for Engineering Education, 2018
PHASOR TOOLBOX FOR AC CIRCUIT ANALYSIS USING MATLAB
Abstract
MATLAB is a very useful tool which can be utilized in teaching DC and AC Circuits courses.
Introduction of MATLAB in the Engineering Technology program empowers the students in the
early stage of their learning process. This paper presents a MATLAB phasor toolbox for analyz-
ing ac sinusoidal circuits in the Electrical and Computer Engineering Technology program. The
toolbox has functions for conversion among complex, polar and phasor forms. It includes func-
tions for adding, subtraction, multiplication and division of phasors, plotting phasors on the
complex plane and in the time domain and many useful analysis.
1. INTRODUCTION
DC and AC circuit analysis is the beginning and the fundamental course in the Engineer-
ing/Technology programs. In this or similar courses, students learn to analyze electrical circuits
and networks by using basic electrical engineering laws like the Ohm’s law, Kirchoff’s laws,
component relations and impedance formulae for sinusoidal signals. This analysis generally
uses three steps, a) gather the given data from the word statements and list the expectations, b)
use basic laws to set up the equations and steps for the analysis and c) do the calculations and
plots if necessary by using formulae, mathematical tools and help at the disposal of the learner.
In the last step most students and instructors and textbooks prefer to use calculators, but it is
usually a long drawn procedure and often fraught with errors. In long calculations, the students
often loose attention while their immediate concerns become not to commit mathematical mis-
takes. As a consequence, they do not pay enough attention on the concepts and the underlying
reasons for doing what they are doing. This paper presents a MATLAB based Toolbox to do
most of these calculations and help in fortifying the conceptual learning. Students learn to use
MATLAB functions just like the mathematical formulae. The graphical displays from the tool
box further enhances understanding.
The proposed tools are designed with two objectives in mind a) to understand how to write
MATLAB codes to solve a problem using standard MATLAB functions and those in the pro-
posed toolbox, and b) to visualize the results graphically.
The toolbox contains functions that will perform most of the tasks encountered in ac and dc cir-
cuit analysis:
Conversion functions: such as the complex to polar and phasor and back.
Math operations on phasors/polar variables:
add, subtract, multiply and divide.
Complex plane plots: of polar and phasor quantities
Time domain plots of phasors
Series-Parallel network: determining voltage and current in all components and finding
input impedances.
Thevenin and Norton equivalent circuits
Power calculations: in single and three phase circuits
Full list of functions is as the following:
A general vector is a directed arrow from point a (x1, y1) to another point b (x2, y2) on the complex
plane. Plot of a vector on the complex plane is obtained in the MATLAB from the code
axis([-6, 6, -6, 6])
arrow([1, 2], [4, -4])
grid
If the frequency is constant, the signal amplitude varies in a sinusoidal manner as time proceeds.
The voltage amplitude at any time t1 can be represented by
Since is constant, we can assume it to be zero without loss of any information, then V1 can be
treated as a complex quantity:
or by a polar vector of length V from the origin, rotating counterclockwise on the complex plane in
a circle with the center at the origin:
the magnitude V is expressed in rms, the vector V1 is called the phasor. The term phasor is reserved
for expressing the sinusoidal voltage or current in polar vector format but with rms (root mean
square) magnitude. Thus, a vector from origin, point ‘o’ (0, 0) to a point a (x, y), is called a polar
vector or a phasor.
Phasor:
Plot of a phasor on the complex plane is obtained from
phplot([Ph])
Form conversions:
Calculate and draw the phasor diagrams, and time domain waveforms for I, VR, VL and VC in the
following circuit where R=2 ohms, L=1 mH, and C=1000 µF. Assume the frequency is 60 Hz.
Find currents I1, I2, and the input impedance seen by sources E1 and E2.
Find the Thevenin equivalent circuit as seen by ZL and the maximum power delivered to it.
E1 and E2 are respectively the 100 Hz and 200 Hz sources. Find the current I in the middle branch
and plot its waveform. The inductors L1 = 6.4 mH, L2 = 6.4 mH, and the capacitor C= 500 µF.
Find the total average, reactive and apparent power and the power factor.
Fig. 12 3-phase -generator, Y- load
%Y-load calculations
Zan=x2p(4+j*3); Zbn=Zan; Zcn=Zan;
[Van, Vbn, Vcn]=line2phase(EAB, EBC, ECA)
V=[Van, Vbn, Vcn];
Ian=p_div(Van, Zan); Ibn=p_div(Vbn, Zbn); Icn=p_div(Vcn, Zcn);
I=[Ian, Ibn, Icn];
[STy, QTy, PTy]=power_ph3d(V, I) %apparent, reactive and the average power in the Y- load
4. PLAN OF IMPLEMENTATION
The phasor toolbox was developed while teaching the class in the Fall semester of 2017. It is
planned to use the tool in ECET 15200: AC Circuit Analysis, ECET 21200: Electrical Power and
Machinery, and ECET 41200: Electric Drives in the future semesters in the Electrical Engineering
Technology undergraduate program. We plan to look at the effect on the content delivery and assess
the benefits of instruction by utilizing the Phasor Tool Box. All user defined functions will be made
available to those who ask for them.
5. SUMMARY
This paper presents a MATLAB phasor toolbox for analyzing ac sinusoidal circuits in the Electrical
and Computer Engineering Technology program. The toolbox has functions for conversion among
complex, polar and phasor forms, for adding, subtraction, multiplication and division of phasors,
plotting phasors on the complex plane and in their waveforms in the time domain. The toolbox also
enables the calculation of Thevenin equivalent circuits, input impedances in networks, and calcula-
tion of apparent, reactive and real power in single and 3-phase ac circuits. The toolbox has the ca-
pability of analyzing ac circuits with sources of different frequencies. It is also capable of drawing
Power Triangle diagrams and power factors in 3-phase networks.
References
[1] “Introductory Circuit Analysis” Robert Boylestad, 13th ed., Pearson Education Inc.
[2] MATLAB v. 2017b, Mathworks Inc.