Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Complex Numbers
Prof. David Marshall
School of Computer Science & Informatics
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
x2 + 1 = 0 x 2 = 1 x = 1? The Problem: We cannot (yet) nd the square root of a negative number using real numbers since: When any real number is squared the result is either positive or zero, i.e. for all real numbers n2 0, n R1 .
1
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
We need another category of numbers, the set of numbers whose squares are negative real numbers. Members of this set are called imaginary numbers. We dene 1 = i (or j in some texts)2
Every imaginary number can be written in the form: ni where n is real and i = 1
If you read engineering books rather than maths books you may see j used in place of i - this is just a quirk in notation
3 / 80 2
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
4 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
5 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Examples: 16 = 16 1 = 16 1 = 4i 3 = 3 1 = 3 1 = i 3 (121) 2 =
1
121 =
123 1 =
121
1 = 11i
6 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary numbers can be added to or subtracted only from other imaginary numbers. Examples: 7i 2i = 5i 4i + 3i = (4 + 3)i (Note: i behaves like a special algebraic variable)
7 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Hence 10 i 2 = 10 1 = 10
8 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
1 1
1 1
1 1
1 1
= 1 = i
9 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Complex Numbers
Case 1: The need for Complex Numbers Consider the quadratic equation x 2 + 2x + 2 = 0. Using the quadratic formula we get:
x= b 2 b 2 4ac = 2a 22 4(2) 2 4 2 2i = = = 1 i 2 2 2
So x = 1 + i or1 i x is now a number with a real number part (1) and an imaginary number part (i ).
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Complex Numbers
Case 2: The need for Complex Numbers Very Useful Mathematical Representation, to name a few: Widely used in many branches of Mathematics, Engineering, Physics and other scientic disciplines
Control theory Advanced calculus: Improper integrals, Dierential equations, Dynamic equations Fluid dynamics potential ow, ow elds Electromagnetism and electrical engineering: Alternating current, phase induced in systems Quantum mechanics Relativity Geometry: Fractals (e.g. the Mandelbrot set and Julia sets), Triangles Steiner inellipse Algebraic number theory Analytic number theory
Signal analysis: Essential for digital signal and image processing (Phasors) studied later.
11 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Mathematical Notation: The set of all real numbers is denoted by R The set of all complex numbers is denoted by C The real part of a complex number z is denoted by Re(z ) or (z ) The imaginary part of a complex number z is denoted by Im(z ) or (z )
13 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
(z ) = 7 (z ) = 4
14 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Complex Numbers can be added (or subtracted) by adding (or subtracting) their real and imaginary parts separately.
Examples:
(2 + 3i ) + (4 i ) = 6 + 2i
(4 2i ) (3 + 5i ) = 1 7i
15 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
(2 + 3i )(4 i ) = 8 2i + 12i 3i 2 = 8 + 10i 3(1) = 8 + 10i + 3 = 11 + 10i (35i )(2+3i ) = 69i 10i 15i 2 = 619i +15 = 919i (2 + 3i )(2 3i ) = 4 6i + 6i 9i 2 = 4 + 9 = 13 Note that in the last example the product of the two complex numbers is a real number.
16 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Can we express z in the normal complex number form: z = e + , e , f R ? Direct division by a complex number cannot be carried out: The denominator is made up of two independent terms
The real and imaginary part of the complex number c + di
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
We need to deal with the denominator, zd . Here zd = c + di . We can readily obtain the complex conjugate of zd , zd = c di
We have already observed that any complex number its conjugate is a real number, zd zd R: c 2 + d 2
So to remove i from the denominator we can multiply both numerator and denominator by zd
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
We need to deal with the denominator,zd . Here zd = 5 2i . Obtain complex conjugate of zd , zd = 5 + 2i Multiply both numerator and denominator byzd 2 + 9i 5 + 2i 5 2i 5 + 2i 10 + 4i + 45i + 18i 2 25 4i 2 8 + 49i 29 8 49 + i 29 29
20 / 80
= = =
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
21 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
= 15 + 3i 10i + 2i 2 = 13 7i So x = 13 and y = 7.
22 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
A complex number is zero if and only if the real part and the imaginary part are both zero i.e. a + bi = 0 a = 0 and b = 0.
23 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
A complex number, z = a + ib , is made up of two parts, The real part, a and, The imaginary part, b
One way we may visualise this is by plotting these on a 2D graph: The x-axis represents the real numbers, and The y-axis represents the imaginary numbers.
24 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
P (a, b)
a + bi
or Re
or Re
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
z2
z1 + z2
z1 z2
26 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
If we plot two complex numbers on an Argand diagram then we see that they form two adjacent sides of a parallelogram their sum forms the diagonal.
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
a2 + b 2
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
r O
Quadrant 1
Quadrant 2
1
P
1
P
Quadrant 3
Quadrant 4
30 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
r O
Quadrant 1
Quadrant 2
1
P
1
P
Quadrant 3
Quadrant 4
31 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
y y y y y
The polar angle for the complex number 0 is undened, but usual arbitrary choice is the angle 0.
32 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Modulus r = |1 + i | =
12 + 12 =
Sketching the Argand diagram indicates that we are in the rst quadrant, therefore positive angle, between 0 and 90. Argument = arctan( 1 1 ) = 45 or 4 radians
1 2 1 i 2
Modulus 1 1 1 2 1 2 1 r = | i | = ( ) + ( ) = 1 2 + 2 =1 2 2 2 2 Sketching the Argand diagram indicates that we are in the fourth quadrant, therefore angle is negative between 0 and 90 (or between 270 and 360) degrees. Argument = arctan( (Radians sim.)
33 / 80
1 ( ) 2 1 2
) = arctan(1) = 45 or 315
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Find the modulus and argument of each of the following: 1.35 + 2.56i
1 4
3 4 i
34 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
P (a, b)
35 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
r sin
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Exercise
37 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Trigonometric form
From last slide a = r cos b = r sin Giving z = a + bi So if we substitute for a and b we get:
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
40 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
% A c o m p l e x number o f m a g n i t u d e 11 and p h a s e a n g l e 0 . 7 r a d i a n s >> z = 1 1 ( c o s ( 0 . 7 ) + s i n ( 0 . 7 ) i ) z = 8.4133 + 7.0864 i % R e c o v e r t h e m a g n i t u d e and p h a s e o f z >> [ a b s ( z ) , a n g l e ( z ) ] ans = 11.0000 0.7000
41 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
43 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
44 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
polar() Example
45 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
10 150 5 30
180
210
330
240 270
300
46 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
compass() Plot
The compass() knows how to plot a complex number directly: compass() Example >> c1 = 3 + 4 i ; >> compass ( c1 ) ;
47 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
180
210
330
240 270
300
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Phasor Notation
50 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
MATLAB Complex No. Phasor Declaration >> exp ( i ( p i / 4 ) ) ans = 0.7071 + 0.7071 i
51 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Phasers on stun!
52 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Electrical Signals: Can apply simplify AC circuits to DC circuit theory (e.g. Ohms Law)! Power engineering: Three phase AC power systems analysis Signal Processing: Fourier Theory, Filters
53 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
sin =
54 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
From trigonometry we have the following relations: sin(A B ) = sin A cos B cos A sin B , cos(A B ) = cos A cos B sin A sin B , So nally we have: z1 z2 = r1 r2 [cos(1 + 2 ) + i sin(1 + 2 )] z1 z2 = [r1 r2 , 1 + 2 ]
56 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
z1 z2 ,
1 Evaluate ( 2 +
3 3 2 i) ,
59 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Multiplying a complex number z = x + iy by i rotates the vector representing z through 90 anticlockwise Example: Let z 1 = 1. Then z2 = iz1 = i . Polar form of z1 = [1, 0 ]. Polar form of z2 = [1, 90 ], Q.E.D.
60 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Sinusoid : x (t ) = M cos( t + ), < t < a function of time Phasor : X = Me i = M cos() + iM sin() a complex number
61 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Phasors and Sinusoids are related: [Xe i t ] = = = [Me i e i t ] [Me i (t + )] [M (cos( t + ) + i sin( t + ))
= M cos( t + ) = x(t)
62 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
63 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
% C o s i n e i s same a s S i n e ( e x c e p t 90 d e g r e e s o u t o f p h a s e ) y c = amp c o s ( 2 p i n F w/ F s ) ; figure (2); h o l d on ; p l o t ( yc , b ) ; plot (y , r ) ; t i t l e ( Cos ( B l u e ) / S i n ( Red ) P l o t ( Note Phase D i f f e r e n c e ) ) ; hold o f f ;
65 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
66 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
f u n c t i o n s = m y s i n ( amp , f r e q , phase , dur , s a m p f r e q ) % e x a m p l e f u n c t i o n t o s o show how a m p l i t u d e , f r e q u e n c y and p h a % a r e changed i n a s i n f u n c t i o n % I n p u t s : amp a m p l i t u d e o f t h e wave % f r e q f r e q u e n c y o f t h e wave % p h a s e p h a s e o f t h e wave i n d e g r e e % d u r d u r a t i o n i n number o f s a m p l e s % samp freq sample f r e q u n c y x = 0 : dur 1; phase = phase p i /180; s = amp s i n ( 2 p i x f r e q / s a m p f r e q + p h a s e ) ;
68 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
90
180
270
360
450
540
630
720
69 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
90
180
270
360
450
540
630
720
71 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
90
180
270
360
450
540
630
73 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
A cos( t + ) + B cos( t + ) = =
[Ae i (t +) + Be i (t +) ] [e i t (Ae i + Be i )]
= C cos( t + )
75 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Which is neater?
Lets see
76 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Simplify 5 cos( t + 53 ) +
2 cos( t + 45 )
Hard way via trigonometry Use the cosine addition formula three times
see maths formula sheet handout for formula
77 / 80
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
2e i 45 ] = (3 + 4i ) + (1 + i ) = (4 + 5i ) = 6.4e i 51
= 6.4 cos( t + 51 )
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
Hard way via trigonometry Use the cosine addition formula three times
see maths formula sheet handout for formula
Imaginary Numbers
Complex Numbers
MATLAB
Phasors
= e i 90 (= i )
So we get: [e i 90 ] = cos(90 ) = 0 So: cos( t + 30 ) + cos( t + 150 ) + cos( t 90 ) = 0 or cos( t + 30 ) + cos( t + 150 ) + sin( t) = 0
80 / 80