Math Review with Matlab Complex Numbers Sinusoidal Addition
Math Review with Matlab: Complex Numbers Sinusoidal Addition S. Awad, Ph. D. M. Corless, M. S. E. E. E. C. E. Department University of Michigan-Dearborn
Complex Numbers: Sinusoidal Addition A useful application of complex numbers is the addition of sinusoidal signals having the same frequency n n n General Sinusoid Euler’s Identity Sinusoidal Addition Proof Phasor Representation of Sinusoids Phasor Addition Example Addition of 4 Sinusoids Example 2
Complex Numbers: Sinusoidal Addition General Sinusoid n A general cosine wave, v(t), has the form: M = Magnitude, amplitude, maximum value w = Angular Frequency in radians/sec (w=2 p. F) F = Frequency in Hz T = Period in seconds (T=1/F) t = Time in seconds q = Phase Shift, angular offset in radians or degrees 3
Complex Numbers: Sinusoidal Addition Euler’s Identity n n A general complex number can be written in exponential polar form as: Euler’s Identity describes a relationship between polar form complex numbers and sinusoidal signals: 4
Complex Numbers: Sinusoidal Addition Useful Relationship n n Euler’s Identity can be rewritten as a function of general sinusoids: Resulting in the useful relationship: 5
Complex Numbers: Sinusoidal Addition Proof n Show that the sum of two generic cosine waves, of the same frequency, results in another cosine wave of the same frequency but having a different Magnitude and Phase Shift (angular offset) Given: Prove: 6
Complex Numbers: Sinusoidal Addition Complex Representation n Each cosine function can be written as the sum of the real portion of two complex numbers 7
Complex Numbers: Sinusoidal Addition Complex Addition n n ejwt is common and can be distributed out The addition of the complex numbers M 1 ejq 1 and M 2 ejq 2 results in a new complex number M 3 ejq 3 8
Complex Numbers: Sinusoidal Addition Return to Time Domain n n The steps can be repeated in reverse order to convert back to a sinusoidal function of time We see v 3(t) is also a cosine wave of the same frequency as v 1(t) and v 2(t), but having a different Magnitude and Phase 9
Complex Numbers: Sinusoidal Addition Phasors n n In electrical engineering, it is often convenient to represent a time domain sinusoidal voltages as complex number called a Phasor Standard Phasor Notation of a sinusoidal voltage is: Time Domain Voltage: v(t) Complex Domain Phasor: V(jw) 10
Complex Numbers: Sinusoidal Addition Phasor Addition n As shown previously, two sinusoidal voltages of the same frequency can easily be added using their phasors Time Domain Complex Domain Time Domain 11
Complex Numbers: Sinusoidal Addition Phasor Addition Example: Use the Phasor Technique to add the following two 1 k Hz sinusoidal signals. Graphically verify the results using Matlab. Given: Determine: 12
Complex Numbers: Sinusoidal Addition Phasor Transformation n n Since Standard Phasors are written in terms of cosine waves, the sine wave must be rewritten as: The signals can now be converted into Phasor form 13
Complex Numbers: Sinusoidal Addition Rectangular Addition n n To perform addition by hand, the Phasors must be written in rectangular (conventional) form Now the Phasors can be added 14
Complex Numbers: Sinusoidal Addition Transform Back to Time Domain n n Before converting the signal to the time domain, the result must be converted back to polar form: The result can be transformed back to the time domain: 15
Complex Numbers: Sinusoidal Addition Verification n Matlab can be used to verify the complex addition: » V 1=2*exp(j*0); » V 2=3*exp(-j*pi/2); » V 3=V 1+V 2 V 3 = 2. 0000 - 3. 0000 i » M 3=abs(V 3) M 3 = 3. 6056 » theta 3= angle(V 3)*180/pi theta 3 = -56. 3099 16
Complex Numbers: Sinusoidal Addition Time Domain Addition n The original cosine waves can be added in the time domain using Matlab: f =1000; T = 1/f; TT=2*T; t =[0: TT/256: TT]; % % v 1=2*cos(2*pi*f*t); v 2=3*sin(2*pi*f*t); v 3=v 1+v 2; Frequency Find the period Two periods Time Vector 17
Complex Numbers: Sinusoidal Addition Code to Plot Results Plot all signals in Matlab using three subplots subplot(3, 1, 1); plot(t, v 1); grid on; axis([ 0 TT -4 4]); ylabel('v_1=2 cos(2000pit)'); title('Sinusoidal Addition'); n v_1 prints v 1 n pi prints p subplot(3, 1, 2); plot(t, v 2); grid on; axis([ 0 TT -4 4]); ylabel('v_2=3 sin(2000pit)'); n subplot(3, 1, 3); plot(t, v 3); grid on; axis([ 0 TT -4 4]); ylabel('v_3 = v_1 + v_2'); xlabel('Time'); 18
Complex Numbers: Sinusoidal Addition Plot Results n Plots show addition of time domain signals 19
Complex Numbers: Sinusoidal Addition Verification Code n Plot the added signal, v 3, and the hand derived signal to verify that they are the same v_hand=3. 6056*cos(2*pi*f*t-56. 3059*pi/180); subplot(2, 1, 1); plot(t, v 3); grid on; ylabel('v_3 = v_1 + v_2'); xlabel('Time'); title('Graphical Verification'); subplot(2, 1, 2); plot(t, v_hand); grid on; ylabel('3. 6 cos(2000pit - 56. 3circ)'); xlabel('Time'); 20
Complex Numbers: Sinusoidal Addition Graphical Verification n n The results are the same Thus Phasor addition is verified 21
Complex Numbers: Sinusoidal Addition Four Cosines Example n Example: Use Matlab to add the following four sinusoidal signals and extract the Magnitude, M 5 and Phase, q 5 of the resulting signal. Also plot all of the signals to verify the solution. Given: Determine: 22
Complex Numbers: Sinusoidal Addition Enter in Phasor Form n Transform signals into phasor form n Create phasors as Matlab variables in polar form » » V 1 V 2 V 3 V 4 = = 1*exp(j*0); 2*exp(-j*pi/6); 3*exp(-j*pi/3); 4*exp(-j*pi/2); 23
Complex Numbers: Sinusoidal Addition Add Phasors n n Add phasors then extract Magnitude and Phase Convert back into Time Domain » V 5 = V 1 + V 2 + V 3 + V 4; » M 5 = abs(V 5) M 5 = 8. 6972 » theta 5_rad = angle(V 5); » theta 5_deg = theta 5_rad*180/pi theta 5_deg = -60. 8826 24
Complex Numbers: Sinusoidal Addition Code to Plot Voltages n Plot all 4 input voltages on same plot with different colors f =1000; T = 1/f; t =[0: T/256: T]; % Frequency % Find the period % Time Vector v 1=1*cos(2*pi*f*t); v 2=2*cos(2*pi*f*t-pi/6); v 3=3*cos(2*pi*f*t-pi/3); v 4=4*cos(2*pi*f*t-pi/2); plot(t, v 1, 'k'); hold on; plot(t, v 2, 'b'); plot(t, v 3, 'm'); plot(t, v 4, 'r'); grid on; title('Waveforms to be added'); xlabel('Time'); ylabel('Amplitude'); 25
Complex Numbers: Sinusoidal Addition Signals to be Added 26
Complex Numbers: Sinusoidal Addition Code to Plot Results n Add the original Time Domain signals v 5_time = v 1 + v 2 + v 3 + v 4; subplot(2, 1, 1); plot(t, v 5_time); grid on; ylabel('From Time Addition'); xlabel('Time'); title('Results of Addition of 4 Sinusoids'); n Transform Phasor result into time domain v 5_phasor = M 5*cos(2*pi*f*t+theta 5_rad); subplot(2, 1, 2); plot(t, v 5_phasor); grid on; ylabel('From Phasor Addition'); xlabel('Time'); 27
Complex Numbers: Sinusoidal Addition Compare Results n n The results are the same Thus Phasor addition is verified 28
Complex Numbers: Sinusoidal Addition Sinusoidal Analysis n n n The application of phasors to analyze circuits with sinusoidal voltages forms the basis of sinusoidal analysis techniques used in electrical engineering In sinusoidal analysis, voltages and currents are expressed as complex numbers called Phasors. Resistors, capacitors, and inductors are expressed as complex numbers called Impedances Representing circuit elements as complex numbers allows engineers to treat circuits with sinusoidal sources as linear circuits and avoid directly solving differential equations 29
Complex Numbers: Sinusoidal Addition Summary n n Reviewed general form of a sinusoidal signal Used Euler’s identity to express sinusoidal signals as complex exponential numbers called phasors Described how Phasors can be used to easily add sinusoidal signals and verified the results in Matlab Explained phasor addition concepts are useful for sinusoidal analysis of electrical circuits subject to sinusoidal voltages and currents 30
- Slides: 30