Analysis With Matlab

Embed Size (px)

Citation preview

Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-1Copyright Orchard PublicationsChapter 1Second Order Circuitshis chapter discusses the natural, forced and total responses in circuits that contain resis-tors, inductors and capacitors. These circuits are characterized by linear second-order dif-ferential equations whose solutions consist of the natural and the forced responses. We willconsider both DC (constant) and AC (sinusoidal) excitations.1.1 Response of a Second Order CircuitA circuit that contains energy storage devices (inductors and capacitors) is said to be an nth-order circuit, and the differential equation describing the circuit is an nth-order differential equa-tion. For example, if a circuit contains an inductor and a capacitor, or two capacitors or twoinductors, along with other devices such as resistors, it is said to be a second-order circuit and thedifferential equation that describes it will be a second order differential equation. It is possible,however, to describe a circuit having two energy storage devices with a set of two first-order dif-ferential equations, a circuit which has three energy storage devices with a set of three first-orderdifferential equations and so on. These are called state equations and are discussed in Chapter 7.As we know from previous studies,* the response is found from the differential equation describ-ing the circuit, and its solution is obtained as follows:1. We write the differential or integrodifferential (nodal or mesh) equation describing the circuit.We differentiate, if necessary, to eliminate the integral.2. Weobtaintheforced(steady-state)response.Sincetheexcitationinourworkherewillbeeither a constant (DC) or sinusoidal (AC) in nature, we expect the forced response to havethe same form as the excitation. We evaluate the constants of the forced response by substitu-tion of the assumed forced response into the differential equation and equate terms of the leftside with the right side. The form of the forced response (particular solution),isdescribedinAppendix H.3. We obtain the general form of the natural response by setting the right side of the differentialequation equal to zero, in other words, solve the homogeneous differentialequationusingthecharacteristic equation.4. We add the forced and natural responses to form the complete response.5. Using the initial conditions, we evaluate the constants from the complete response.*The natural and forced responses for first-order circuits are discussed in Circuit Analysis I with MATLABComputing and Simulink/ SimPowerSystems Modeling, ISBN 978-1-934404-17-1.Tn Chapter 1Second Order Circuits1-2 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard Publications1.2 Series RLC Circuit with DC ExcitationConsider the circuit of Figure 1.1 where the initial conditions are,, and is the unit step function.* We want to find an expression for the current for. Figure 1.1. Series RLC CircuitFor this circuit(1.1)and by differentiationTo find the forced response, we must first specify the nature of the excitation, that is DC orAC.If is DC ( ), the right side of (1.1) will be zero and thus the forced response com-ponent. If is AC ( , the right side of (1.1) will be another sinusoidand therefore. Since in this section we are concerned with DC excitations, theright side will be zero and thus the total response will be just the natural response.The natural response is found from the homogeneous equation of (1.1), that is,(1.2)whose characteristic equation isorfrom which*The unit step function and other elementary functions used in science and engineering are discussed in Chapter3. iL0 ( ) I0= vC0 ( ) V0=u0t () i t () t 0 >R+-vSu0t ()i t ()LCRi Ldidt-----1C---- i t d0t}V0+ + + vS= t 0 >Rdidt----- Ld2idt2-------iC---- + +dvSdt-------- = t 0 > ,vSvSvScons t tan =if0 = vSvSV ct 0 + ( ) cos =ifI ct + ( ) cos =Rdidt----- Ld2idt2-------iC---- + + 0 =Ls2Rs1C---- + + 0 =s2 RL----s1LC-------- + + 0 =Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-3Copyright Orchard PublicationsSeries RLC Circuit with DC Excitation(1.3)We will use the following notations:(1.4)where the subscript stands for series circuit. Then, we can express (1.3) as(1.5)or(1.6)Case I: If, the roots and are real, negative, and unequal. This results in the over-damped natural response and has the form(1.7)Case II: If, the roots and are real, negative, and equal. This results in the criticallydamped natural response and has the form(1.8)Case III: If,therootsandarecomplexconjugates.Thisisknownastheunder-damped or oscillatory natural response and has the form(1.9)Typical overdamped, critically damped and underdamped responses are shown in Figure 1.2, 1.3,and 1.4 respectively where it is assumed that.1.2.1 Response of Series RLC Circuits with DC ExcitationDepending on the circuit constants,, and, the total response of a series circuit whichis excited by a DC source, may be overdamped, critically damped or underdamped. In this sectionwe will derive the total response of series circuits that are excited by DC sources.s1s2,R2L------- R24L2---------1LC-------- =oSR2L------- =o or DampingCoefficientc01LC------------ =ResonantFrequencySoS2c02 =BetaCoefficient cnSc02oS2 =Damped NaturalFrequency ss1s2, oS oS2c02 oS S if oS2c02> = =s1s2, oS c02oS2 oS cnS if c02oS2> = =oS2c02> s1s2int () k1es1tk2es2t+ =oS2c02= s1s2int () AeoSt k1k2t + ( ) =c02oS2> s1s2int () eoSt k1cnScos t k2cnSt sin + ( ) k3eoSt cnScos t + ( ) = =in0 ( ) 0 =R L C RLCRLCChapter 1Second Order Circuits1-4 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard PublicationsFigure 1.2. Typical overdamped responseFigure 1.3. Typical critically damped responseFigure 1.4. Typical underdamped (oscillatory) responseExample 1.1For the circuit of Figure 1.5,,, and the resistor represents theresistance of the inductor. Compute and sketch for.Solution:This circuit can be represented by the integrodifferential equation(1.10)Typical Overdamped ResponseTimeVoltageTypical Critically Damped ResponseTimeVoltageTypical Underdamped Response TimeVoltageiL0 ( ) 5 A = vC0 ( ) 2.5 V = 0.5 Oi t () t 0 >Ri Ldidt-----1C---- i t d0t}vC0 ( ) + + + 15 = t 0 > ,Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-5Copyright Orchard PublicationsSeries RLC Circuit with DC ExcitationFigure 1.5. Circuit for Example 1.1Differentiating and noting that the derivatives of the constants and are zero, we obtainthe homogeneous differential equationorand by substitution of the known values,, and (1.11)The roots of the characteristic equation of (1.11) are and. The totalresponse is just the natural response and for this example it is overdamped. Therefore, from (1.7),(1.12)The constants and can be evaluated from the initial conditions. Thus from the first initialcondition and (1.12) we obtainor(1.13)We need another equation in order to compute the values of and. This equation will makeuse of the second initial condition, that is,. Since, we differ-entiate (1.12), we evaluate it at, and we equate it with this initial condition. Then,(1.14)Also, at,+-15u0t () Vi t ()0.5 O 1 mH100 6 mF 'vC0 ( ) 15Rdidt----- Ld2idt2-------iC---- + + 0 =d2idt2-------RL----didt-----iLC-------- + + 0 =R L Cd2idt2------- 500didt----- 60000i + + 0 =s1200 = s2300 =i t () int () k1es1tk2es2t+ k1e200 tk2e300 t+ = = =k1k2iL0 ( ) i 0 ( ) 5 A = =i 0 ( ) k1e0k2e0+ 5 = =k1k2+ 5 =k1k2vC0 ( ) 2.5 V = iCt () i t () CdvCdt--------- = =t 0+=didt----- 200k 1e200 t300k2 e300 t and =didt-----t 0+=200k 1300 k2=t 0+=Chapter 1Second Order Circuits1-6 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard Publicationsand solving for we obtain(1.15)Next, equating (1.14) with (1.15) we obtain:(1.16)Simultaneous solution of (1.13) and (1.16) yields and. By substitution into(1.12) we find the total response as(1.17)Check with MATLAB*:syms t; %Define symbolic variable t%Must have Symbolic Math Toolbox installedR=0.5; L=10^(-3); C=100*10^(-3)/6; %Circuit constantsy0=115*exp(-200*t)-110*exp(-300*t); %Let solution i(t)=y0y1=diff(y0); %Compute the first derivative of y0, i.e., di/dty2=diff(y0,2); %Compute the second derivative of y0, i.e, di2/dt2%Substitute the solution i(t), i.e., equ (1.17) %into differential equation of (1.11) to verify that%correct solution was obtained. We must also% verify that the initial conditions are satisfied.y=y2+500*y1+60000*y0;i0=115*exp(-200*0)-110*exp(-300*0);vC0=-R*i0-L*(-23000*exp(-200*0)+33000*exp(-300*0))+15;fprintf(' \n');...disp('Solution was entered as y0 = '); disp(y0);...disp('1st derivative of solution is y1 = '); disp(y1);...disp('2nd derivative of solution is y2 = '); disp(y2);...disp('Differential equation is satisfied since y = y2+y1+y0 = '); disp(y);...disp('1st initial condition is satisfied since at t = 0, i0 = '); disp(i0);...disp('2nd initial condition is also satisfied since vC+vL+vR=15 and vC0 = ');...disp(vC0);...fprintf(' \n')*An introduction to MATLAB is presented in Appendix A.Ri 0+( ) Ldidt-----t 0+=vc0+( ) + + 15 =didt-----t 0+=didt-----t 0+=15 0.5 5 2.5 103 --------------------------------------- 10000 = =200k 1300 k210000 =k 11.5 k250 =k1115 = k2110 =i t () int () 115e200 t110 e300 t= =Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-7Copyright Orchard PublicationsSeries RLC Circuit with DC ExcitationSolution was entered as y0 = 115*exp(-200*t)-110*exp(-300*t)1st derivative of solution is y1 = -23000*exp(-200*t)+33000*exp(-300*t)2nd derivative of solution is y2 = 4600000*exp(-200*t)-9900000*exp(-300*t)Differential equation is satisfied since y = y2+y1+y0 = 01st initial condition is satisfied since at t = 0, i0 = 52nd initial condition is also satisfied since vC+vL+vR=15 and vC0= 2.5000We denote the first term as, the second term as, and the totalcurrent as the difference of these two terms. The response is shown in Figure 1.6.Figure 1.6. Plot for of Example 1.1 In the above example, differentiation eliminated (set equal to zero) the right side of the differen-tial equation and thus the total response was just the natural response. A different approach how-ever, may not set the right side equal to zero, and therefore the total response will contain boththe natural and forced components. To illustrate, we will use the following approach.The capacitor voltage, for all time t, may be expressed as and as before, the cir-cuit can be represented by the integrodifferential equation(1.18)and sincei1t () 115e200t = i2t () 110e300t =i t ()i t () 115e200 t110 e300 t=i1t () 115e200 t=i2t () 110e300 t=Time (sec)Current (A)i t ()vCt ()1C---- i t d t}=Ri Ldidt-----1C---- i t d t}+ + 15 = u0t ()Chapter 1Second Order Circuits1-8 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard Publicationswe rewrite (1.18) as(1.19)We observe that this is a non-homogeneous differential equation whose solution will have boththe natural and the forced response components. Of course, the solution of (1.19) will give us thecapacitor voltage. This presents no problem since we can obtain the current by differentia-tion of the expression for.Substitution of the given values into (1.19) yieldsor(1.20)The characteristic equation of (1.20) is the same as of that of (1.11) and thus the natural responseis(1.21)Since the right side of (1.20) is a constant, the forced response will also be a constant and wedenote it as. By substitution into (1.20) we obtainor(1.22)The total solution then is the summation of (1.21) and (1.22), that is,(1.23)As before, the constants and will be evaluated from the initial conditions. First, using and evaluating (1.23) at, we obtainor(1.24)Also,(1.25)i iCCdvCdt--------- = =RCdvCdt--------- LCdvC2dt2--------- vC+ + 15 = u0t ()vCt ()vCt ()506------ 103 dvCdt--------- 1 103 1006---------103 dvC2dt2--------- vC+ + 15 = u0t ()dvC2dt2--------- 500dvCdt--------- 60000vC+ + 9 105 = u0t ()vCnt () k1es1tk2es2t+ k1e200 tk2e300 t+ = =vCfk3=0 0 60000k3+ + 900000=vCfk315 = =vCt () vCnt () vCf+ = k1e200 tk2e300 t15 + + =k1k2vC0 ( ) 2.5 V = t 0 =vC0 ( ) k1e0k2e015 + + 2.5 = =k1k2+ 12.5 =iLiCCdvCdt--------- = =dvCdt---------iLC---- anddvCdt---------t 0 =iL0 ( )C------------5100 6 ' 103 -------------------------------- 300 = = = = ,Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-9Copyright Orchard PublicationsSeries RLC Circuit with DC ExcitationNext, we differentiate (1.23), we evaluate it at and equate it with (1.25). Then,(1.26)Equating the right sides of (1.25) and (1.26) we obtainor(1.27)From (1.24) and (1.27), we obtain and. By substitution into (1.23), we obtainthe total solution as(1.28)Check with MATLAB:syms t %Define symbolic variable t. Must have Symbolic Math Toolbox installedy0=22*exp(-300*t)-34.5*exp(-200*t)+15; %The total solution y(t)y1=diff(y0) %The first derivative of y(t)y1 = -6600*exp(-300*t)+6900*exp(-200*t)y2=diff(y0,2) %The second derivative of y(t)y2 = 1980000*exp(-300*t)-1380000*exp(-200*t)y=y2+500*y1+60000*y0 %Summation of y and its derivativesy = 900000Using the expression for we can find the current as(1.29)We observe that (1.29) is the same as (1.17). The plot for (1.28) is shown in Figure 1.7.The same results are obtained with the Simulink/SimPowerSystems* model shown in Figure 1.8.The waveforms for the current and the voltage across the capacitor are shown in Figure 1.9.*For an introduction to Simulink SimPowerSystems please refer to Appendices B and C respectively.t 0 =dvCdt--------- 200k1 e200 t300k2 e300 t and dvCdt---------t 0 =200k1 300k2 = =200k1 300k2 300=k1 1.5k2 1.5 =k134.5 = k222 =vCt () 22e300 t34.5 e200 t15 + ( )u0t () =vCt ()i iL= iCCdvCdt---------1006--------- 103 6900e200t 6600 e300t ( ) 115e200t 110 e300t A = = = =Chapter 1Second Order Circuits1-10 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard PublicationsFigure 1.7. Plot for of Example 1.1Figure 1.8. Simulink/SimPowerSystems model for the circuit in Figure 1.5Figure 1.9. Waveforms produced by the Simulink/SimPowerSystems model in Figure 1.8vCt () 22e300 t34.5 e200 t15 + ( )u0t () =Time (sec)Voltage (V)vCt ()Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-11Copyright Orchard PublicationsSeries RLC Circuit with DC Excitation1.2.2 Response of Series RLC Circuits with AC ExcitationThe total response of a series RLC circuit, which is excited by a sinusoidal source, will also consistof the natural and forced response components. As we found in the previous section, the naturalresponse can be overdamped, or critically damped, or underdamped. The forced component willbe a sinusoid of the same frequency as that of the excitation, and since it represents the ACsteady-state condition, we can use phasor analysis to find it. The following example illustrates theprocedure.Example 1.2For the circuit in Figure 1.10,,, and the resistor represents theresistance of the inductor. Compute and sketch for.Figure 1.10. Circuit for Example 1.2Solution:This circuit is the same as that in Example 1.1 except that the circuit is excited by a sinusoidalsource; therefore it can be represented by the integrodifferential equation(1.30)whose solution consists of the summation of the natural and forced responses. We know its natu-ral response from the previous example. We begin with(1.31)where the constants and will be evaluated from the initial conditions after has beenfound. The steady state (or forced) response will have the form in thetime domain ( ) and the form in the frequency domain ( ).To find we will use the phasor analysis relation where is the phasor current, isthe phasor voltage, and is the impedance of the phasor circuit which, as we know, is iL0 ( ) 5 A = vC0 ( ) 2.5 V = 0.5 Oi t () t 0 >vS200 10000t cos ( )u0t () V =i t ()0.5 O 1 mH100 6 mF 'vSRi Ldidt-----1C---- i t d0t}vC0 ( ) + + + 200 10000t cos = t 0 >i t () int () ift () + k1e200 tk2 e300 tift () + + = =k1k2ift ()ift () k310000t 0 + , ( ) cos =t domain k30 Z jc domain ift () I VZ ' = I VZChapter 1Second Order Circuits1-12 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard Publications(1.32)The inductive and capacitive reactances areandThen,Also,and this yields. Then, by substitution into (1.32),and thusThe total solution is(1.33)As before, the constants and are evaluated from the initial conditions. From (1.33) and thefirst initial condition we obtain oror(1.34)We need another equation in order to compute the values of and. This equation will makeuse of the second initial condition, that is,. Since, we differ-entiate (1.33), we evaluate it at, and we equate it with this initial condition. Then,(1.35)Z R j cL1cC-------- \ .| |+ R2cL1cC-------- \ .| |2+ cL1cC-------- \ .| |R '1 tan Z = =XLcL 104103 10O = = =XC1cC--------1104100 6 ' ( )103 --------------------------------------------- 6 103 O = = =R 20.5 ( )20.25 andcL1cC-------- \ .| |210 6 103 ( )299.88 = = = =cL1cC-------- \ .| |R '1 tan10 6 103 ( )0.5------------------------------------1 tan9.9940.5-------------\ .| |1 tan = =0 1.52 rads 87.15 = =Z 0.25 99.88 + 0 oZ 10 87.15 oZ = =IVZ----200 0oZ10 87.15 oZ--------------------------- 20 87.15 oZ = = = 20 10000t 87.15 o( ) cos = ift () =i t () int () ift () + k1e200 tk2e300 t20 10000t 87.15 o( ) cos + + = =k1k2iL0 ( ) 5 A =i 0 ( ) k1e0k2e020 87.15 o( ) cos + + = 5 =i 0 ( ) k1k220 0.05 + + = 5 =k1k2+ 4 =k1k2vC0 ( ) 2.5 V = iCt () i t () CdvCdt--------- = =t 0 =didt----- 200k 1e200 t300k2 e300 t2 105 10000t 87.15 o( ) sin =Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-13Copyright Orchard PublicationsSeries RLC Circuit with DC Excitationand at,(1.36)Also, at and solving forwe obtain (1.37)Next, equating (1.36) with (1.37) we obtainor(1.38)Simultaneous solution of (1.34) and (1.38) yields and. Then, by substitutioninto (1.31), the total response is(1.39)The plot is shown in Figure 1.11 and it was created with the following MATLAB script:t=0:0.005:0.25; t1=-38.*exp(-200.*t); t2=42.*exp(-300.*t); t3=20.*cos(10000.*t-87.5*pi/180);x=t1+t2+t3; plot(t,t1,t,t2,t,t3,t,x); gridFigure 1.11. Plot for of Example 1.2t 0 =didt-----t 0 =200k 1300k2 2 106 87.15 o( ) sin = 200k 1300k2 2 105 + =t 0+=Ri 0+( ) Ldidt-----t 0+=vc0+( ) + + 200 0 ( ) cos 200 = =didt-----t 0+=didt-----t 0+=200 0.5 5 2.5 103 ------------------------------------------ 195000 = =200k 1300 k25000 =k11.5k2+ 25 =k138 = k242 =i t () 38 e200 t42e300 t20 10000t 87.15 o( ) A cos + + =i t ()i2t () 42e300t =i1t () 38e200t =Time (sec)Current (A)i t ()Chapter 1Second Order Circuits1-14 Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems ModelingCopyright Orchard PublicationsThe same results are obtained with the Simulink/SimPowerSystems model shown in Figure 1.12.Figure 1.12. Simulink/SimPowerSystems model for the circuit in Figure 1.10The waveforms for the current and the voltage across the capacitor are shown in Figures 1.13 and1.14 respectively. We observe that the steady-state current is consistent with the waveform shownin Figure 1.11, and the steady state voltage across the capacitor is small since the magnitude ofthe capacitive reactance is.Figure 1.13. Waveform displayed in Scope 1 for the Simulink/SimPowerSystems model in Figure 1.12XC6 103 O =Circuit Analysis II with MATLAB Computing and Simulink / SimPowerSystems Modeling 1-15Copyright Orchard PublicationsParallel RLC CircuitFigure 1.14. Waveform displayed in Scope 2 for the Simulink/SimPowerSystems model in Figure 1.121.3 Parallel RLC CircuitConsider the circuit of Figure 1.10 where the initial conditions are,, and is the unit step function. We want to find an expression for the voltage for. Figure 1.15. Parallel RLC circuitFor this circuitorBy differentiation,(1.40)To find the forced response, we must first specify the nature of the excitation, that is DC or AC.If is DC ( ), the right side of (1.40) will be zero and thus the forced response com-ponent. If is AC ( , the right side of (1.40) will be another sinusoid andtherefore. Since in this section we are concerned with DC excitations, theright side will be zero and thus the total response will be just the natural response.The natural response is found from the homogeneous equation of (1.40), that is, iL0 ( ) I0= vC0 ( ) V0=u0t () vt () t 0 >iSu0t ()vt () G LCiCiLiGiGt () iLt () iCt () + + iSt () =Gv1L--- v t d0t}I0+ + Cdvdt------ + iS= t 0 >Cdv2dt2-------- Gdvdt------vL--- + +diSdt------- = t 0 >iSiSvScons t tan =vf0 = iSiSI ct 0 + ( ) cos =vfV ct + ( ) cos =