330 likes | 620 Views
Math Review with Matlab:. Complex Numbers. Complex Math. S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn. Complex Number Math. Rectangular Addition Rectangular Subtraction Polar Multiplication Rectangular Multiplication Polar Division
E N D
Math Review with Matlab: ComplexNumbers Complex Math S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn
Complex Number Math • Rectangular Addition • Rectangular Subtraction • Polar Multiplication • Rectangular Multiplication • Polar Division • Complex Conjugate • Rectangular Division
Complex Addition • The addition of two complex number z1 and z2 gives another complex number • Addition of complex numbers is most easily done in Rectangular Form
Addition Example • As an example, the following two complex numbers can be added mathematically and graphically
Matlab Addition • This result can be verified in Matlab » Z1=2+3i; » Z2=4+i; » Z3=Z1+Z2 Z3 = 6.0000 + 4.0000i
Complex Subtraction • Similarly, subtraction of two complex number z1 and z2 gives another complex number • Subtraction of complex numbers is most easily done in Rectangular Form
Subtraction Example • As an example, the following two complex numbers can be subtracted graphically and mathematically • Subtracting z2 is the same as adding -z2
Matlab Subtraction • This result can be verified in Matlab » Z1=3+3i; » Z2=2+i; » Z3=Z1-Z2 Z3 = 1.0000 + 2.0000i
Polar Multiplication • Multiplication of complex numbers is most easily done in polar form since:
Polar Multiplication • Similarly, the shorthand angle notation can be used to express polar multiplication
Rectangular Multiplication • Multiplication of complex numbers can also be done in Rectangular Form by directly multiplying z1 and z2
Multiplication Example • Multiply the two complex numbers first using the direct rectangular form • Then verifythe results using the polar version of multiplication.
Direct Multiplication • Direct multiplication in the rectangular form yields:
Polar Multiplication • z1 and z2 must first be converted to polar form
Polar Multiplication • Verify that this is same result as rectangular multiplication
Matlab Verification • Verify the multiplication of z1 and z2 using Matlab » z1=3+2i; z2=1-4i; » mult=z1*z2 mult = 11.0000 -10.0000i » r = abs(mult) r = 14.8661 » theta=angle(mult) theta = -0.7378
Polar Division • Division of complex numbers is most easily done in Polar Form
Polar Division • Similarly, the shorthand angle notation can be used to express polar multiplication
Polar Division Example • Divide the complex number z1 by z2 by hand, then use Matlab to verify the result
Matlab Division » z1=10*exp(i*60*(pi/180)); » z2=5*exp(i*30*(pi/180)); Convert to Radians » div=z1/z2 div = 1.7321 + 1.0000i » Mag=abs(div) Mag = 2 » Theta=angle(div)*180/pi Theta = 30.0000 Convert to Degrees
Complex Conjugate • The Complex Conjugate of a complex number is found by changing the sign of the imaginary portion • Complex Conjugate is denoted as z* • This is equivalent to negating the angle • Corresponds to a reflection of z in the real axis of an Argand diagram
Conjugate Example • Plot the complex number z = 4 + i2 and it’s complex conjugate z*
Matlab Conjugate • The conj command returns the complex conjugate of a complex number » z=4+2i; » zconj=conj(z) zconj = 4.0000 - 2.0000i » feather(z); » hold on » feather(zconj,'r') » xlabel('Real'); » ylabel('Imaginary');
Useful ComplexConjugate Relationships Addition Subtraction Multiplication
Rectangular Division • Division of complex numbers can also be done in Rectangular Form by use of the Complex Conjugate • The result is the multiplication of z1 by the conjugate of z2 divided by the magnitude of z2 squared
Rectangular Division • Explicitly worked out, the division is:
Division Example • Divide z1 by z2 using the complex conjugate method
Matlab Verification • The previous result is easily verified using Matlab » z1=4+j; » z2=2-3j; » z3 = z1/z2 z3 = 0.3846 + 1.0769i
Summary • Complex addition and subtraction are most easily done using the rectangular form • Complex multiplication and division are most easily done using the exponential polar form • The complex conjugate can be used as a tool for implementing division using the rectangular form of complex numbers