0% found this document useful (0 votes)
175 views9 pages

ECE 024 Lab Activity 2 - Forms of Complex Numbers

This experiment aimed to use MATLAB to convert complex numbers between rectangular, polar, trigonometric and exponential forms. Students were asked to complete tables converting complex numbers between forms, plot the numbers using MATLAB, and differentiate results between plotting commands. They also practiced MATLAB operators for complex numbers including conjugate, magnitude, angle, and exponential and trigonometric forms.

Uploaded by

Joshua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
175 views9 pages

ECE 024 Lab Activity 2 - Forms of Complex Numbers

This experiment aimed to use MATLAB to convert complex numbers between rectangular, polar, trigonometric and exponential forms. Students were asked to complete tables converting complex numbers between forms, plot the numbers using MATLAB, and differentiate results between plotting commands. They also practiced MATLAB operators for complex numbers including conjugate, magnitude, angle, and exponential and trigonometric forms.

Uploaded by

Joshua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment No.

2
Different Forms of Complex Numbers
1. Objective(s):
This activity aims to use MATLAB in converting complex numbers from one form to another.
2. Intended Learning Outcomes (ILOs):
At the end of this activity, the student shall be able to
1. Use MATLAB to easily convert complex numbers from one form to another.
2. Use MATLAB to plot complex numbers.
3. Discussion

Employing rectangular coordinate axes, the complex number a+ jb is represented by the point whose
coordinates are (a,b). This coordinate system is also known as Argand diagram, named after Jean Robert Argand.

To plot numbers (3 + j2), (-2 + j5) and (-1 – j), we can write the following code in Matlab.

% Enter each coordinate (x,y) separated by commas


% Each point is marked by a blue circle ('bo')
plot(3,2,'bo', -2,5,'bo', -1,-1,'bo')

% You can define the limits of the plot [xmin xmax ymin ymax]
axis([-3 4 -2 6])

% Add some labels to explain the plot


xlabel('x (real axis)')
ylabel('y (imaginary axis)')

% Activate the grid


grid on

Following these, you will get:


Other Forms of Complex Numbers
The form z=x + jy is called rectangular form. It may be transformed to its polar form that is z=r ∠θ .
The distance r = √ x 2 + y 2 is always positive and is called the modulus of the complex number.
x=rcosθ ; y=rsinθ
−1 y
The angle θ is called the argument of the complex number; and can be solved by θ=tan .The argument
x
usually ranges from −π ≤θ ≤ π . That being said, adjustments must be made depending on the location of the
number.

Once the polar form has been solved, it is easy to get the trigonometric and exponential forms as we will be using
the same variables.
Trigonometric form of complex numbers is equal to z=r (cosθ+ jsinθ).
Lastly, to express a complex number in its exponential form, we just need to make use of Euler’s constant. The
exponential form of a complex number is written as z=r e jθ .

In MATLAB, we can effortlessly know the modulus and angle, expressed in radians, of any number by using the
abs and angle instructions. Example:

>> a = 3 – j4
>> magnitude = abs(a)
>> theta = angle(a)

a=
3.0000 – 4.0000i

magnitude =
5

theta =
-0.9273

Below is a summary of some of Matlab’s complex number operators:

conj Complex conjugate


abs Magnitude
angle Angle in radians (argument)
real Real part
imag Imaginary part
i, j Pre-defined as the √ −1
exp(j*theta) Function for the complex exponential e jθ
4. Resources:
To perform this activity, a computer workstation with MATLAB R2012a or higher installed is required.
5. Procedure:
1. Complete the table below:

Rectangular Form Polar Form Trigonometric Form Exponential Form

5− j 2

π
6∠
3

2(cos 70 °+ jsin70 °)


3e 8

2. Using MATLAB, plot the complex numbers given in number 1 using plot. (Note: Be sure to use a different
color and style for each number.)

3. Repeat number 2, use the command compass.

4. Differentiate the results obtained using plot and compass.


___________________________________________________________________________________
_______________________________________________________________________________________
__________________________________________

5. If x = 1, y = 2, find
a. z in rectangular form
b. z2 in rectangular form
c. the complex conjugate of z in rectangular form
d. the product of z and its complex conjugate
e. the magnitude r
f. the angle θ
g. z divided by its conjugate

Course: Experiment No.:


Group No.: Section:
Group Members: Date Performed:
Date Submitted:
Instructor:
6. Data and Results:

6. Complete the table below:

Rectangular Form Polar Form Trigonometric Form Exponential Form

5− j 2

π
6∠
3

2(cos 70 °+ jsin70 °)


3e 8

7. Using MATLAB, plot the complex numbers given in number 1 using plot. (Note: Be sure to use a different
color and style for each number.)
a. 5− j 2

π
b. 6 ∠
3

c. 2(cos 70 °+ jsin70 °)


d. 3 e 8

8. Repeat number 2, use the command compass.


a. 5− j 2
π
b. 6 ∠
3

c. 2(cos 70 °+ jsin70 °)


d. 3 e 8

9. Differentiate the results obtained using plot and compass.


___________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________

10. If x = 1, y = 2, find
h. z in rectangular form

i. z2 in rectangular form

j. the complex conjugate of z in rectangular form

k. the product of z and its complex conjugate

l. the magnitude r

m. the angle θ

n. z divided by its conjugate

7. Conclusion:
8. Assessment:

1. Consider two complex numbers z =2 e 4 and z 2=−√ 3+ j.
1

 Enter the complex numbers in Matlab, then plot them with zvect(), and also print them with zprint().
An x-y axis and the unit circle can be superimposed on your zvect() plot by doing the following: hold
on, zcoods, ucplot, hold off
 Compute the conjugate z* and the inverse 1/z for both z1 and z2 and plot the results as vectors. In
Matlab, see help conj. Display the results numerically with zprint.
 The function zcat() can be used to plot vectors in a “head-to-tail” format. Execute the statement
zcat([1+j,-2+j,1-2j]); to see how zcat() works when its input is a vector of complex numbers.
 Compute z1z2 and z2/z1 and plot the answers using zvect() to show how the angles of z 1 and z2
determine the angles of the product and quotient. Use zprint() to display the results numerically.
COURSE:____________________________ MEMBERS:
______________________________________________
SECTION: ___________________________ ________________________________________________________
INSTRUCTOR: ____________________________ ________________________________________________________
EXPERIMENT NO.: ____________________ ________________________________________________________
TITLE:______________________________________________ ________________________________________________________
_

PERFORMANCE INDICATORS BEGINNER ACCEPTABLE PROFICIENT SCORE


1 2 3
LABORATORY PERFORMANCE
Experimental Set-up Members are unable to set-up the Members are able to setup the Members are able to setup the
materials. materials with supervision. material with minimum
supervision.
Time Management/ Members do not finish on time with Members finish on time with Members finish ahead of time
Conduct of Experiment incomplete data. incomplete data. with complete data and time to
revise data.
Cooperative and Teamwork Members do not know their tasks and Members defined responsibilities Members are on tasks and have
have no defined responsibilities. Group most of the time. Group conflicts are defined responsibilities at all
conflicts have to be settled by the cooperatively managed most of the times. Group conflicts are
teacher. time. cooperatively
managed at all times.
Neatness and Orderliness Messy workplace during and after the Clean and orderly workplace with Clean and orderly workplace at
experiment. occasional mess during and after all times during and after the
the experiment. experiment.
Ability to do Members require supervision by the Members require occasional Members do not need to be
independent work teacher. supervision by the teacher. supervised by the teacher.
Student Outcomes ( d1)
Conduct experiments in accordance Members do not follow good and safe Members follow good and safe Members follow good and safe
with good and safe laboratory laboratory practice in the conduct of laboratory practice most of the time laboratory practice at all times in
practice. experiments. in the conduct of experiments. the conduct of experiments.
Operate equipment and instruments Members are unable to operate the Members are able to operate Members are able to operate the
with ease. equipment and instruments. equipment and instrument with equipment and instruments with
supervision. ease and with minimum
supervision.
Analyze data, validate experimental The group has incomplete data. The group has complete data but The group has complete data,
values against theoretical values to has no analysis and valid validates experimental values
determine possible experimental conclusion. against theoretical values, and
errors, and provide valid conclusions. provides valid conclusion.
(x2)
Discussion of Results, Conclusion and Assessment Task
Ideas are taken from the
Ideas are not in reference to the Ideas are in reference to result/data result/data gathered during the
Discussion of Results (x2) result/data gathered during experiment. gathered during experiment. Clear, experiment.
Not clear, incomplete and too short. but not complete and too short. Very clear, complete and
sufficient to form a discussion.
Ideas are somehow appropriate to Ideas are very much appropriate
Ideas are inappropriate to the
the experiment objectives and to the experiment objectives and
experiment objectives and intended
Conclusion (x3) intended learning outcomes. intended learning outcomes.
learning outcomes.
Clear but not complete and too Very clear, complete and
Not clear, incomplete and too short.
short. sufficient to form a conclusion.
Majority of the questions were All questions were correctly
Assessment Task (x3) Answers to questions were incorrect.
answered correctly. answered.
Total
Mean score Total score/3
Percentage score (Total score/51) x 100%

Evaluated by:
Printed Name and Signature of Faculty Member Date

You might also like