EXPERIMENT 10 Phasors, Matlab and PSPICE Name(s): Objectives: Learn how to perform arithmetic with complex numbers in Matlab Learn how to transform sinusoids into phasor values Calculate Complex Impedance and Admittance Perform simple AC circuit analysis using Phasors and PSPICE I. Complex Numbers in Matlab Matlab uses the letters i or j to represent the square root of -1. Complex numbers can be entered directly at the command line in rectangular form and stored in variables for further computation. --> z = 10 - 12j z= 10.0000 - 12.0000i To enter a complex value in polar form, for example, w = 10<45, do the conversion to rectangular form as you type: --> w = 10*cosd(45) + j*10*sind(45) w= 7.0711 + 7.0711i BE CAREFUL to use sind and cosd when using degree angles. The regular sin and cos assume radians Once a value is entered into matlab in can be used in complex arithmetic. For example: --> u = w * z u= 155.5635 - 14.1421i and --> t = w + z t= 17.0711 - 4.9289i To convert a value from rectangular form to polar form use the abs command and the angle command --> abs(w) ans = 10 --> angle(w) ans = 0.7854 --> angle(w)*180/pi ans = 45 NOTE that angle returns angle in radians and must be converted to degrees Complex Drill Exercises Suppose we have four complex numbers, some in rectangular form others in polar form: a = 3 + 4i b= -5 + 6i c = 8<45 (This means a magnitude of 8 and an agle of 45 degrees) d = 12<250 Use Matlab to compute the following (enter your final answers in the space provided) I) Express these quantities in rectangular form: a+b a/b c c+d II) Express these quantities in polar form (magnitude and phase): a c/d ab a+c Phasor Transforms The phasor transform comes from Euler's identity, namely, 𝑒 ±𝑗𝜃 = cos(𝜃) ± 𝑗𝑠𝑖𝑛(𝜃) We can therefore think of cos(𝜃) as the Real part of 𝑒 𝑗𝜃 For a sinewave, 𝜃 = 𝜔𝑡 + 𝜑 but Euler's identity still applies. In fact we can consider v = Vm cos(𝜔𝑡 + 𝜑) = 𝑅𝑒{ 𝑉𝑚 𝑒 𝑗𝜔𝑡+ 𝜑 } = 𝑅𝑒{ 𝑉𝑚 𝑒 𝑗𝜔𝑡 𝑒 𝑗𝜑 } = 𝑅𝑒{ 𝑉𝑚 𝑒 𝑗𝜑 𝑒 𝑗𝜔𝑡 } In the previous equation 𝑉𝑚 𝑒 𝑗𝜑 is a complex number that carries the amplitude and phase angle of the original sinusoid. This complex number is the definition of the phasor transform of the given sinusoid. In other words, the phasor Note that V can also be represented in polar form: We use the phasor to solve various operations on sinusoids of different magnitudes and phases, as well as complex valued circuit elements. When we are finished, we take our solution back to the time domain with the inverse phasor transform: As an example, suppose we have a sinusoid v1 = 10 cos(wt + 45o) and we wish to add to it the sinewave v2 = 5 cos(wt + 60 o). We can find v = v1 + v2 either with trig identities (very messy) or phasors. Here we'll use phasors (see text for an example using trig identities) --> v1 = 10*cosd(45) + j*10*sind(45) v1 = 7.0711 + 7.0711i --> v2 = 5*cosd(60)+j*5*sind(60) v2 = 2.5000 + 4.3301i --> v = v1 + v2 v = 9.5711 + 11.4012i --> Vm = abs(v) Vm = 14.8860 --> phi = angle(v)*180/pi phi = 49.9872 Therefore our solution to v = v1 + v2 is v = 14.8 cos(wt + 49.9o) Phasor Drill Exercises First verify the solution to (a) in both problems above, then use Matlab to find answers to the other questions: 7.4 b) 7.4 c) 7.4 d) 7.5 b) 7.5 c) Basic Circuit Elements in the AC (Phasor) Domain In order to obtain a solution to a circuit with applied sinewave signals, we need to formulate the behavior of our familiar Resistor, Inductor and Capacitor circuit elements in the phasor domain. Whereas a resistor behaves in the phasor domain the same as in the time domain, inductors and capacitors now have "complex resistance" also called "impedance" Impedance is the complex valued relationship between phasor voltage and phasor current, while reactance is just the imaginary part of the impedance. We summarize these releations in the table below: Example: We sometimes refer to the impedance of a capacitor or inductor as Zc or ZL. Find Zc and ZL for the circuit shown: Given: w = 60 Hz: Zc = ZL = phasor Vin = AC Solution by Phasor Analysis We are now ready to find phasor Vout in the circuit above. Clearly, this is an example of a voltage divider formula. Therefore, our solution in Matlab for Vout will be similar to the voltage divider formula we developed for DC circuits: Vout = Vin*Zc / (1000 + ZL + ZC) And that's it! Of course, we still need to convert back into the time domain. Enter your solution for Vout and vout below: phasor domain Vout = time domain vout = We now turn to PSPICE to see how we can get independent verification of our results in Matlab. Include your matlab history showing your calculations, plus your final results. Also insert pictures of your pspice schematics and your pspice simulation results. % I) a b c d = = = = 3 + 4i; -5 + 6i; polar2rect(8+45i); polar2rect(12+250i); a d = a + b c e = c + d % % % % % % % % a = 3 + 4i -2 + 10i 5.6569 + 5.6569i 3.6569 + 15.657i d = c = e = % II) % All variables are already in rectangular form. I can therefore easily use % them with the rect2polar() function. f h g i = = = = rect2polar(a) rect2polar(c / d) rect2polar(a*b) rect2polar(a + b) % % % % % % % % ' f = 5 + 53.13i 0.78446 - 56.31i 39.051 - 177.06i 10.198 + 101.31i h = g = i =