Complex Numbers - University of Michigan
Download
Report
Transcript Complex Numbers - University of Michigan
Math Review with Matlab:
Complex
Numbers
Complex Number Theory
S. Awad, Ph.D.
M. Corless, M.S.E.E.
E.C.E. Department
University of Michigan-Dearborn
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Complex Number Theory
General Complex Numbers
General Complex Numbers in Matlab
Argand Diagrams
Exponential Form
Polar Form
Polar Form in Matlab
2
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Representing Complex Numbers
The conventional representation of a complex number z
is the sum of a real part x and an imaginary part y
z x iy
Complex
Real
i is the imaginary unit where:
Imaginary
i 1
2
Conventional representation is also referred to as the
rectangular form of a complex number
3
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Functional Notation
In different applications, the imaginary unit may be
represented as i or j and may be placed before or after
the imaginary part
z x iy
z x yi
z x jy
z x yj
In functional notation, it is sometimes convenient to write:
x Rez
y Imz
4
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Matlab Complex Numbers
Matlab complex numbers consist of a real portion plus an
imaginary portion
For example, use Matlab to find the square root of -1
» sqrt(-1)
ans =
0 + 1.0000i
Real Portion = 0
i 1
Imaginary Portion = -1
5
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Entering Complex Numbers
Both the variables i and j in the Matlab workspace are
reserved for representing imaginary numbers
Placing i or j after a number defines it as imaginary
Example: A complex number with real portion = 1 and
imaginary portion = 2 can be entered in two ways:
» z = 1+2i
» z = 1+2j
OR
z =
1.0000 + 2.0000i
z =
1.0000 + 2.0000i
6
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Real and Imag Commands
The real and imag functions extract the real and
imaginary portion of a complex number respectively
Example:
» z1= 2+4i
z1 =
2.0000 + 4.0000i
» z1_re = real(z1)
z1_re =
2
» z1_im = imag(z1)
z1_imag =
4
7
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Argand Diagram
A complex number can be
represented as a Point
P(x,y) in the xy-plane
(Cartesian plane)
Imz
y
This representation is called
an Argand Diagram
The xy-plane is often
referred to as the Complex
Plane or the z-plane
z x, y
x
Rez
Ordered Pair Notation
z x, y
8
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Feather Command
The feather command draws complex numbers as
arrows in the xy plane
»
»
»
»
»
»
»
»
»
»
z1=1+2j;
z2=3+3j;
z3=3+j;
feather(z1,'r');
hold on
feather(z2,'b');
feather(z3,'g');
feather(z3,'k');
ylabel('Imaginary');
xlabel('Real');
9
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Exponential Representation
Sometimes an exponential representation of a complex
number is easier to manipulate than the rectangular sum
of the real and imaginary part
The Complex Exponential Function ez will be used to
represent a complex number whose Taylor Series
Expansion is:
2
3
z
z
e z exp( z ) 1 z
2! 3!
We can assume that ez will be valid for all z
10
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Exponential Series
If z = iq, purely imaginary, where q is real, the complex
exponential function can be written using a Taylor Series
Expansion:
(iq ) (iq )
e 1 iq
2!
3!
2
iq
3
Which can be separated into real and imaginary
components since i raised to even powers of n will be -1
q2 q4
3
5
q
q
iq
e 1 i q
2! 4!
3! 5!
11
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Derivation of Euler’s Equation
3
5
q q
q q
iq
e 1 i q
2! 4!
3! 5!
2
Knowing that the Taylor Series Expansions for sine and
cosine functions are:
cosq 1
4
q2
2!
q4
4!
sin q q
q3 q5
3!
5!
Through substitution, Euler’s Equation is derived:
iq
e cosq i sin q
12
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Exponential Polar Form
Through Euler’s Equation we
see that:
re r cosq i sin q
iq
re iq x iy
This representation of a complex
number is referred to as the
Exponential Polar Form:
z re
Sometimes Polar Form is written
using the shortened notation:
z rq
iq
13
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Plotting Polar Form
Graphically depicting Euler’s
Equation in the First Quadrant of
an Argand Diagram we see:
z x, y
z re r cosq ir sin q
r
x Re( z ) r cosq
y Im( z ) r sin q
q
iq
Imz
y
x
Rez
r refers to the radius from z to the origin, commonly called
the Magnitude of z
q is the Angle of z with respect to the Real Axis measured in
degrees or radians
14
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Magnitude
Through use of the Pythagorean theorem, the Magnitude
(radius) of a complex number always has the relationship:
r x2 y2
This relationship always holds true regardless of which
quadrant of the Argand diagram that the number lies in
The Magnitude of a complex number z=x+iy is denoted
using Absolute Value notation
z r x y
2
2
15
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Angle
z q
The angle, q, of a complex
number z denoted by:
Determining the angle of a complex number depends on the
quadrant of the Argand diagram
Measuring the angle counter-clockwise from the x-axis gives
a positive q
Measuring the angle clockwise from the x-axis gives a
negative q
Example: The angle of
z=0+j can be represented
in multiple ways
3
z 90
270
2
2
16
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Angle of Quadrants I and IV
Quadrant I
Imz
y
z x, y
Quadrant IV
Imz
q
r
x
Rez
r
q
x
Rez
y
q tan
x
1
z x, y
y
y
1 y
q tan tan
x
x
1
17
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Angle of Quadrants II and III
Quadrant II
z x, y
Imz
y
Quadrant III
Imz
Rez
x
q
r
r
q
Rez
x
y
q tan
x
1
z x, y
y
y
q tan
x
1
18
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Purely Real or Imaginary
Numbers
Rectangular Rectangular Polar
Short
Long
Degrees
1
1
j
-j
1 i0
1 i0
0 i1
0 i1
10
110
10
10
Polar
Radians
10
1
1/2
1/2
19
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Abs and Angle Commands
The abs command in Matlab returns the magnitude of a
complex number
The angle command returns the angle of a complex
number in radians
Remember that the conversion between radians and
degrees is:
180
q q rad
rad
20
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Polar Example
Use Matlab to find the magnitude and angle of z=1+i
» z=1+i;
» r=abs(z)
r =
1.4142
» theta_rads=angle(z)
theta_rads =
0.7854
» theta_degs=theta_rads*180/pi
theta_degs =
45
r 12 12 2
r 1.4142
1
q tan
1
1
q RADS
4
0.7854
q DEGREES 45
21
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Entering Polar Form
Complex numbers can be directly entered into Matlab
using the exponential polar form
Example: Create a complex number z with a magnitude
of 2 and an angle of /2 radians
» z=2*exp(i*pi/2)
z =
0.0000 + 2.0000i
z 2e
2
i
z 2 2
z 290
z 2i
22
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Polar Plotting
Matlab’s compass(z) or compass(x,y) command can
be used to draw complex numbers on a polar plot
Note that z is a complex number in rectangular form
»
»
»
»
z1=3+3i;
compass(z1)
hold on
compass(4,-3)
Angles are displayed in
degrees
23
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Plotting Example
Example: Plot the following complex numbers by hand.
Use Matlab’s compass function to verify your results.
i 60
z1 20
z2 3e
z3 8 j 8
z4 4e
2
i
z5 2.5 150 z6 i 2
24
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Matlab Verification
z1 20
z 2 3ei 60
z 4 4e
z5 2.5 150 z6 i 2
2
i
z3 8 j 8
z(1) = 2;
z(2) = 3*exp(i*60*(pi/180));
z(3) = -(8^0.5) + j*(8^0.5);
z(4) = 4*exp(-i*pi/2);
z(5) = 2.5*exp(-i*150*(pi/180));
z(6) = 2i;
compass(z)
25
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Polar Plot
z1 20
i 60
z 2 3e
z3 8 j 8
2
i
z 4 4e
z5 2.5 150
z6 i 2
z6
z3
z2
z1
z5
z4
26
Complex Numbers: Complex Number Theory
Math Review with Matlab
U of M-Dearborn ECE Department
Summary
Representing complex numbers in rectangular,
exponential, and polar forms
Using Euler’s Equation to represent real and
imaginary parts of complex numbers
Determining magnitude and angles of complex
numbers
Graphing complex numbers using Argand
Diagrams
27