Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

EcE 224 Lab Act 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

LABORATORY ACTIVITY 1

Complex Numbers

Intended Learning Outcomes


By the end of this activity, you must be able to:
ILO 1 Describe complex numbers and complex plane conceptually and graphically
(CO 1)
ILO 2 Convert between rectangular, trigonometric, polar and exponential forms of
complex numbers (CO 2)
ILO 3 Apply basic properties and identities on operations of complex numbers and
complex functions (CO 2)

Introduction to Complex Numbers


Mathematicians once stumbled on a problem regarding roots of functions which
are not factorable by common mathematical rules. For example, given the following
quadratic function, what are its roots?

𝑓(𝑥) = 𝑥 2 + 2𝑥 − 1

If you try to solve this with the same rules in elementary algebra that we are familiar
with, it would be proved difficult and seems to have no correct answer. So,
mathematicians came with a solution to work around this problem and that came the idea
of complex numbers.

Let’s look on this another function:

𝑓(𝑥) = 𝑥 2 + 1

To solve for the roots, we must know what values of x that will make 𝑓(𝑥) = 0. To
do this we follow the steps below:

Equate 𝑓(𝑥) = 0 𝑥2 + 1 = 0

Transpose 1 𝑥 2 = −1

Get the square root of both sides 𝑥 = √−1

But we knew that there is no such real number as a square root of a negative
number. So, we must assign another kind of mathematical concept to represent √−1 and
that’s where imaginary unit 𝑖 𝑜𝑟 𝑗 came in.
𝑖 𝑜𝑟 𝑗 = √−1
Why is it represented by either of the two letters? Well, mathematicians usually
use 𝑖 but electrical engineers sometimes mistake it for the current. So, they use 𝑗 instead
of 𝑖 so to not cause confusion. But in this course we will prefer to the use of 𝑗 as the
imaginary unit during manual computation but refer to 𝑖 when programming in MATLAB®.

Mathematically, 𝑗 is called an imaginary unit but when multiplied by a constant, it


is now called an imaginary number. Nevertheless, all throughout this course, 𝑗 will always
be referred to as an imaginary number that is 𝑗 multiplied by 1.

On the other hand, complex number is any number that is represented by the form:

𝑎 + 𝑗𝑏

in which 𝑎 is a real number and 𝑗𝑏 is an imaginary number. 𝑎 in this sense is what we call
the real component while 𝑏 referred to as the imaginary component.

Complex Number Conversion

In general, a complex number ℤ is represented by the form

ℤ = 𝑎 + 𝑗𝑏

in which the real component 𝑅𝑒{ℤ} = 𝑎 and the imaginary component 𝐼𝑚{ℤ} = 𝑏 can be
graphically represented in the complex plane or Argand’s diagram as a point just like in a
Cartesian coordinate plane. For example, the following complex numbers 𝕄 and ℕ may
be plotted in the complex plane.

Fig 1. Plot of the complex numbers 𝕄 = 3 + 𝑗1 and ℕ = 2 − 𝑗2 in the


complex plane (Hayt, et.al., 2012)

ℤ = 𝑎 + 𝑗𝑏 is what we call the rectangular form of a complex number. However, we


also have a special identity called Euler’s identity. It says that:

𝑒 𝑗𝜃 = cos 𝜃 + 𝑗 sin 𝜃 (Euler’s identity)


Consequently, if we multiply each side with a constant 𝑟 and then equate it to the
real and imaginary components of the complex number ℤ = 𝑎 + 𝑗𝑏, we get:

Multiply by a constant 𝒓 𝒓𝑒 𝑗𝜃 = 𝒓 𝑐𝑜𝑠 𝜃 + 𝑗 𝒓 𝑠𝑖𝑛 𝜃


Equate 𝑎 to the real component 𝑎 = 𝒓 𝑐𝑜𝑠 𝜃

Equate 𝑏 to the imaginary component 𝑏 = 𝒓 𝑠𝑖𝑛 𝜃

Adding the squares of 𝑎 and 𝑏 𝑎2 + 𝑏 2 = (𝒓 𝑐𝑜𝑠 𝜃)2 + (𝒓 𝑠𝑖𝑛 𝜃)2


𝑎2 + 𝑏 2 = 𝒓2 (𝑐𝑜𝑠 2 𝜃 + 𝑠𝑖𝑛2 𝜃)= 𝒓2 (1)

Get the square root of 𝒓 𝒓2 = 𝑎 2 + 𝑏 2 ; 𝒓 = √𝑎2 + 𝑏 2

𝑏 𝒓 𝑠𝑖𝑛 𝜃 𝑏
To get 𝜃, we must divide 𝑎 from 𝑏 = 𝒓 𝑐𝑜𝑠 𝜃 = tan 𝜃; 𝜃 = tan−1 𝑎
𝑎

Now, we can equate the equivalence of the following forms of complex numbers
to obtain the exponential form:

𝑎 + 𝑗𝑏 (𝑟𝑒𝑐𝑡𝑎𝑛𝑔𝑢𝑙𝑎𝑟) ⇔ 𝒓𝑒 𝑗𝜃 (𝑒𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙)
𝑏
in which 𝒓 = √𝑎2 + 𝑏 2 and 𝜃 = tan−1 𝑎 and conversely 𝑎 = 𝒓 𝑐𝑜𝑠 𝜃 and 𝑏 = 𝒓 𝑠𝑖𝑛 𝜃.
Further, the exponential form has a shorthand notation of 𝒓∠𝜃 for simplicity referred to as
polar form making it:

𝑎 + 𝑗𝑏 (𝑟𝑒𝑐𝑡𝑎𝑛𝑔𝑢𝑙𝑎𝑟) ⇔ 𝒓∠𝜃 (𝑝𝑜𝑙𝑎𝑟)

The polar form can be plotted in the complex plane as the following:

(𝑎, 𝑗𝑏)

𝒓
𝑏 = 𝒓 𝑠𝑖𝑛 𝜃

𝑎 = 𝒓 𝑐𝑜𝑠 𝜃

Fig 2. Polar form of a complex number in the complex plane (Hayt, et.al., 2012)

Examples

Convert the following:


4
1. 3 + 𝑗4 to polar: 𝒓 = √32 + 42 = 5; 𝜃 = tan−1 3 = 53.13𝜊 ; Ans = 𝟓∠𝟓𝟑. 𝟏𝟑𝝄
2. 13∠67.38𝜊 to rectangular: 𝑎 = 13 𝑐𝑜𝑠(67.38𝜊 ) = 5; 𝑏 = 13 𝑠𝑖𝑛(67.38𝜊 ) = 12;
Ans = 𝟓 + 𝒋𝟏𝟐

Operations on Complex Numbers

Here are some important identities you need to remember when performing
operations on complex numbers.
1
𝑗 2 = −1 = −𝑗 (𝒓∠𝜃)𝑚 = 𝒓𝒎 ∠𝑚𝜃 = 𝒓𝒎 [cos 𝑚𝜃 + 𝑗 sin 𝑚𝜃]
𝑗

𝑖𝑓 ℤ = 𝑎 + 𝑗𝑏, 𝑖𝑡𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑥 𝑐𝑜𝑛𝑗𝑢𝑔𝑎𝑡𝑒 ℤ∗ = (𝑎 + 𝑏)∗ = 𝑎 − 𝑗𝑏

Addition/Subtraction of Complex Numbers

(𝑎 + 𝑗𝑏) + (𝑐 + 𝑗𝑑) = (𝑎 + 𝑐) + 𝑗(𝑏 + 𝑑)

(𝑎 + 𝑗𝑏) − (𝑐 + 𝑗𝑑) = (𝑎 − 𝑐) + 𝑗(𝑏 − 𝑑)

Note: Complex numbers in polar form cannot be added or subtracted directly unless they
are converted first to rectangular form.

Multiplication of Complex Numbers

(𝑎 + 𝑗𝑏)(𝑐 + 𝑗𝑑) = (𝑎𝑐 − 𝑏𝑑) + 𝑗(𝑎𝑑 + 𝑏𝑐)

(𝑨∠𝜃1 )(𝑩∠𝜃2 ) = 𝑨𝑩∠(𝜃1 + 𝜃2 )

Division of Complex Numbers


ℤ1
For the given complex numbers ℤ1 = 𝑎 + 𝑗𝑏 and ℤ2 = 𝑐 + 𝑗𝑑, the quotient of is
ℤ2
obtained by rationalizing the denominator with its complex conjugate:

ℤ1 ℤ1 ℤ∗2 𝑎 + 𝑗𝑏 𝑐 − 𝑗𝑑 (𝑎 + 𝑗𝑏)(𝑐 − 𝑗𝑑)


= ( ) ( ∗) = ( )( )=
ℤ2 ℤ2 ℤ2 𝑐 + 𝑗𝑑 𝑐 − 𝑗𝑑 𝑐 2 + 𝑑2

For complex numbers in polar form:

𝑨∠𝜃1 𝑨
= ∠(𝜃1 − 𝜃2 )
𝑩∠𝜃2 𝑩
Examples

Evaluate the following:

1. (2 + 𝑗5) − (1 − 𝑗2) 𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛: (2 − 1) + 𝑗(5 − (−2)) = 𝟏 + 𝒋𝟕

2. (2∠67𝜊 )(10∠−135𝜊 ) 𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛: (2)(10)∠(67𝜊 + (−135𝜊 )) = 𝟐𝟎∠ − 𝟔𝟖𝝄

6+𝑗4 6+𝑗4 −2−𝑗3 (6+𝑗4)(−2−𝑗3) −𝑗26


3. (−2+𝑗3) 𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛: (−2+𝑗3) (−2−𝑗3) = = = −𝒋𝟐
(−2)2 +32 13

Materials

MATLAB® R2016a or later version installed in a computer or


MATLAB® Application installed in mobile phone

Procedure

A. Creating New M-File

1. Make sure you already have installed MATLAB software or app in your computer
or mobile phone. Click the software/app to open.
2. For those using the software:
a. In the Menu bar, click New Script.

b. Save your output by Clicking on Save or alternately you can press the
keyboard shortcut key CTRL+S.
c. Save filename as “(your surname)_EcE224Lab1.m”.

For those using the mobile app:


a. Click the three bars on the top left of the app.

b. On the sidebar, click Files.

c. Click the plus sign on the top right then select New Script.

d. Type the filename of your activity based on above format and click Create.
EcE

B. Conversion of Complex Numbers (ILO 1.1)

1. Type the following line of code in MATLAB script to convert the following
rectangular complex number to polar: 𝟑. 𝟏𝟐 − 𝒋√𝟑 ⇒ 𝒓∠𝜃

2. Click run then write on the space below the output you see in the
Command Window.
>>

3. Highlight previous code, press CTRL+R (For those using MATLAB App, you can
only place the comment symbol % instead before each line so they will be ignored
and will not be executed) and type this different code using cart2pol function and
compare it with your previous result.

4. Now we do the reverse. Using the saved values of 𝒓 and 𝜃 from the previous codes,
highlight previous code, press CTRL+R (For those using MATLAB App, you can
only place the comment symbol % instead before each line so they will be ignored
and will not be executed) and type the code below to convert it back to rectangular
form. 𝒓∠𝜃 ⇒ 𝒂 − 𝒋𝒃

5. Click run then write on the space below the output you see in the
Command Window.
>>

6. Highlight previous code, press CTRL+R (For those using MATLAB App, you can
only place the comment symbol % instead before each line so they will be ignored
and will not be executed) and type this different code using pol2cart function and
compare it with your previous result.
7. Repeat steps 1-3 with the example given on item no. 1 page 3. Write on the space
below the output you see in the Command Window.
>>

8. Repeat steps 4-6 with the example given on item no. 2 page 3. Write on the space
below the output you see in the Command Window. Note that you need to specify
the value of 𝒓 and 𝜃 before you run the code.
>>

C. Operations on Complex Numbers (ILO 1.2)

1. Given the complex numbers ℤ1 = −2.3 + 𝑗6.5 and ℤ2 = 1.4 − 𝑗0.86, highlight
previous code, press CTRL+R (For those using MATLAB App, you can only place
the comment symbol % instead before each line so they will be ignored and will
not be executed) and type the following to solve for their sum ℤ1 + ℤ2 and
difference ℤ1 − ℤ2 .

2. Click run then write on the space below the output you see in the
Command Window.
>>

3. Given the same complex numbers above, highlight previous code, press CTRL+R
(For those using MATLAB App, you can only place the comment symbol % instead
before each line so they will be ignored and will not be executed) and type the
following code to solve for their product ℤ1 ∗ ℤ2 and quotient ℤ1 /ℤ2 .

4. Click run then write on the space below the output you see in the
Command Window.
>>
D. Submission of Output

1. Write the manual solution of Part B, steps 1 and 4 and Part C, steps 1 and 3 on a
sheet of paper and take photos of them. Name each photo as “Lab Act
1_Solution_(number based on sequence)”.
2. Answer the guide questions below and accomplish Laboratory Report 1 with the
template to be provided by the faculty in charge.
3. Upload the Laboratory Report 1 in PDF form along with the photos of the manual
solution and the M-file to the submission link to be provided by the faculty in
charge.

Guide Question

1. Compare your manual solutions on conversion of complex numbers with that of


the results of the MATLAB codes. Cite the advantage of doing one over the other.
(ILO 2)
2. Compare your manual solutions on operations on complex numbers with that of
the results of the MATLAB codes. Cite the advantage of doing one over the other.
(ILO 3)
3. What command functions are you unfamiliar with that was used in the codes?
Research about their uses and explain them.
4. Share your experiences in using MATLAB software or app? What new learnings
or interest did you gain? What challenges and problems did you encounter?
5. Do you find MATLAB helpful to you personally as an engineering student? In what
ways?

Rubrics
Your Laboratory Report 1 shall be rated based on the following rubric.

RATING QUALITATIVE DESCRIPTION


Exemplary (5) The response/output clearly followed the instructions
and shows achievement of the aligned Intended
Learning Outcome (ILO) with deeper understanding
Satisfactory (4) The response/output clearly followed the instructions
and has achieved the Intended Learning Outcome
(ILO) but not to the point of showing deeper
understanding
Developing (3) The response/output followed the instructions and has
provided sensible and acceptable answer but not to the
point of achieving the Intended Learning Outcome (ILO)
Beginning (2) The response/output followed the instructions but has
unclear or unacceptable answer
Poor (1) The response/output does not follow the instructions

You might also like