CAD Manual (1-8)

.pdf
School
UET Taxila**We aren't endorsed by this school
Course
ELECTRICAL CAG
Subject
Electrical Engineering
Date
Dec 22, 2024
Pages
50
Uploaded by AmbassadorTitanium15965
EE—-: Circuit Analysis & Design (Lab Manual)November 18, 201811Electrical Engineering Department, University of Engineering & Technology Lahore, Pakistan.1
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 1To examine the pulse and steady state response of a seriesRL & RC networkObjectives:In this experiment, a pulse waveform is applied to series RL & RC circuits, to analyze thetransient response of the circuits. The pulse-width relative to the circuits time constantdetermines how it is affected by the RL circuit.Apparatus:OscilloscopeSignal generatorInductorsCapacitorResistorsTheoretical Background (RL Series Circuit)At the instant when step voltage is applied to an RL network, the current increases gradually andtakes some time to reach the final value. The reason current does not builds up instantly to itsfinal value is that as the current increases, the self-inducede.m.f.in inductor opposes the changein current (Lenzs Law). Mathematically,i(t) =VR(1-e-t/τ)(1)Wheret= time elapsed since pulse is applied andτ=L/R= Time constant of the circuit.During the next half cycle of pulse, when the pulse amplitude is zero, the current decreases to zeroexponentially. Mathematically,i(t) =VRe-t/τ(2)2
Background image
Figure 1: A series RL circuitTask1:1. Set the output of the function generator to a square-wave with peak-to-peak amplitude of5V and adjust the frequency that should allow the inductor to charge and discharge fullyi.e.fshould be less than or equal tofmax=110τ. Use dc offset to obtain pulse train rangingfrom 0 to 5 volts from square wave.2. Patch the circuit given in Fig. 1 on the breadboard and apply pulse train to it.3. Display simultaneously voltagevin(t) across the function generator (on CH 1) andvo(t)across the inductorL(on CH 2). Ensure common ground for both channels and the signalgenerator.4. Sketch the two measured waveformsvin(t) andvo(t), calculate and sketch the waveforms,vR(t) andi(t). Label the time, voltage and current scales. Note that the voltage waveformvR(t) across resistorR, also represents the currenti(t) waveform.5. Measure the time constant,τ, using the waveformvo(t). Expand the time scale and measurethe time it takes for the waveform to complete 63% of its total change,i.e.5V. Note themeasured value ofτ.3
Background image
6. Compare values of theoretically expected and experimentally obtained time constantsτ.7. Now calculate and measurei(t) for five different values ofτfor rise of current as well as fallof current.Observations & CalculationsWrite down the values of following parameters:R= ——————,L= ———————————-,T= ———————————- , 10τ=——————————,fmax= —————————–Rise of CurrentCalculate current usingi(t) =VR(1-e-t/τ) and measure current (from oscilloscope)No. of Time ConstantsCalculated Current (amp)Measured Current (amp)τ2τ3τ4τ5τFall/Decay of CurrentCalculate current usingi(t) =VR(e-t/τ) and measure current (from oscilloscope)No. of Time ConstantsCalculated Current (amp)Measured Current (amp)τ2τ3τ4τ5τ4
Background image
Figure 2: Input voltage, output voltage, loop current and resistor voltage of a series RL circuit.5
Background image
Figure 3: A series RC circuitTheoretical Background (RC Series Circuit)A capacitor can be charged by connecting its two terminals to the two terminals of a battery. Ifthe capacitor is then disconnected from the battery it will retain this charge and the potentialacross the capacitor will remain that of the battery. If a resistor is then connected across thecapacitor, charge will flow through the resistor until the potential difference between the twoterminals goes to zero. The potential will decrease with time according to the relation:v(t) =v0e-tτ(3)wherev0represents the voltage at timet= 0, andτrepresents the “time constant” or time that ittakes for the voltage to decrease by a factor of 1/e.If the frequency of the square wavevinis too high (i.e.iff1/RC), thenvoandvRwill nothave enough time to reach their asymptotic values. If the frequency is too low (i.e.iff1/RC),the decay time will be very short relative to the period of the waveform and thus the exponentialdecay will be difficult to observe. As a rough guideline, the period of the square wave should bechosen such that it is approximately equal to 10RC, in order for the responses to be readilyobserved on an oscilloscope.Task2:1. Set the output of the function generator to a square-wave with peak-to-peak amplitude of6
Background image
5V and adjust the frequency that should allow the capacitor to charge and discharge fullyi.e.fshould be less than or equal tofmax=110τ. Use dc offset to obtain pulse train rangingfrom 0 to 5 volts from square wave.2. Patch the circuit given in Fig. 3 on the breadboard and apply pulse train to it.3. Display simultaneously voltagevin(t) across the function generator (on CH 1) andvo(t)across the capacitorC(on CH 2). Sketch the two measured waveformsvin(t) andvo(t),alsocalculate, sketch and label the waveforms,vR(t) andi(t) on the graphs given in Fig. 4.4. Measure the time constant,τ, using the waveformvo(t). Expand the time scale and measurethe time it takes for the waveform to complete 63% of its total change,i.e.5V. Comparevalues of theoretically expected and experimentally obtained time constantsτ. Calculatedτ= ——————————-, Measuredτ= ——————————-Discussion:Q1: What would be effect onvoandvR, if the resistance value is halved in Fig. 1?——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————Q2: What would be effect onvoandvR, if the inductance value is halved in Fig. 1?——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————Q3: What would be effect onvoandvR, if the capacitance value is doubled in Fig. 3?——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————7
Background image
Figure 4: Input voltage, output voltage, loop current and resistor voltage of a series RC circuit.8
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 2Steady state sinusoidal response (RC & RL circuits) andPhasors.Objectives:The response of an electrical network to a sinusoidal inputs is an extremely importantcharacteristic. This lab investigates the amplitude and phase relationships between voltages andcurrents in electrical networks driven by sinusoidal sources. In particular, the concepts of phasorsand impedance are examined.Apparatus:OscilloscopeSignal generatorInductorsCapacitorResistorsTheoretical BackgroundFig. 1 (a) shows a block-diagram representation of the system. The input is a cosine function withamplitudeAand phase angleθ. The output is also a cosine function with amplitudeBand phaseangleϕ. Both the input and output waveforms have radian frequencyω(recall that an importantproperty of linear systems is that the steady state response of a linear system to a sinusoidal inputis a sinusoid with the same frequency as the input sinusoid). The analysis of the circuit of Fig. 1(a) can be simplified by representing the sinusoidal signals as phasors. The phasors provide theamplitude and phase information of the sinusoidal input and output signals. The input-outputrelationship governing the circuit then reduces to a relationship between the output and inputsignal amplitudes and the output and input signal phases/angles. The circuit can thus be9
Background image
Figure 1: Steady state sinusoidal circuit analysis (a) physical circuit (b) phasor representation of circuitinput output relationship.Figure 2: Input output voltage waveformsrepresented in phasor form as an amplitude gain between the output and input signals and aphase difference between the output and input signals, as shown in Fig. 1 (b).Gain of a system at a particular frequency is the ratio of the magnitude of the output voltage tothe magnitude of the input voltage at that frequencyi.e.:Gain=ΔvoutΔvin(1)Where Δvoutand Δvincan be measured from the sinusoidal output and input voltagesrespectively, as shown in Fig. 2. The phase of a system at a particular frequency is a measure ofthe time shift between the output and input voltage at that frequency.Phase=ΔTT×360o(2)Where ΔTandTcan be measured from the sinusoidal input and output voltages as shown in theFig. 310
Background image
Figure 3: Input output voltage waveforms’ phase relationship.Figure 4: Response of series RL & RC circuits to sinusoidal inputs.Sinusoidal response of RC & RL circuits:Circuits containing inductance/capacitance and resistance appear in many electronic circuitsranging from power supplies to filters. In this experiment the response of series RL & RC circuitto sinusoidal inputs is investigated. A difficulty that arises in such circuits is that realinductors/capacitors are not like the ideal inductors/capacitors. A real inductor is formed ofcoiled wire so it possesses resistance as well as inductance. Similarly capacitors have internalshunt resistance as well. Furthermore for some inductors the resistance is dependent on frequencyas well. As a consequence, the resistanceRinserted in series with the Inductor does not representthe total resistance of the circuit. In this lab taskRwill be set to a fairly large value so thatinternal resistance of these components becomes negligibly small as compared to externalRi.e.L&Ccan be assumed ideal.For RL circuit given in Fig. 4,ZL=XL=jωL(Assuming resistance of coil to be zero)(3)ZTotal=R+jωL(4)11
Background image
whereω= 2πf= angular frequency andZTotalcan be expressed in rectangular as well as polarco-ordinates.I=VinZTotal(5)whereVinin phasor notation is 50o.VR=IRandVL=I×ZL(6)For RC circuit given in Fig. 4,ZC=XC=1jωC(Assuming internal resistance of capacitor to be zero)(7)ZTotal=R+XC=R-jωC(8)whereω= 2πf= angular frequency andZTotalcan be expressed in rectangular as well as polarco-ordinates.I=VinZTotal(9)whereVinin phasor notation is 50o.VR=IRandVC=I×ZC(10)Task11. Patch the RL circuit given in Fig. 4 on the breadboard and apply sinusoidal signal from thesignal generator. Adjust the magnitude and frequency of the sinusoidal signal to 5V peakand 1 kHz.2. Display simultaneously voltageVinacross the function generator (on CH 1) andVLacrossthe inductorL(on CH 2). Ensure common ground for both channels and the signalgenerator. Measure magnitude ofVLand its phase with respect toVin, and note in Table 1.3. Interchange the resistor and inductor positions in the circuit. Display simultaneously voltageVinacross the function generator (on CH 1) andVRacross the resistorR(on CH 2). Ensurecommon ground for both channels and the signal generator. Measure magnitude ofVRandits phase with respect toVin, and note in Table 1.4. CalculateZL,ZTotal, using the measured values and note in the Table.5. CalculateZL,ZTotal,I,VRandVLfor a source voltageVinof 5V peak and a frequency of 1kHz and then note down these quantities in Table 1.6. Draw the Phasor diagram of the RL circuit in Fig. 5.12
Background image
Table 1: Parameters of an RL circuitsParametersZL(Ω)ZTotal(Ω)I(amp)VR(V)VL(V)Measured valuesCalculated valuesFigure 5: Phasor diagram of an RL CircuitTask21. Set the sinusoidal input voltage from function generator,Vin, of 5V peak and a frequency of1 kHz.2. Patch the RC circuit given in Fig. 4 on the breadboard and apply sinusoidal signal from thesignal generator.3. Display simultaneously voltageVinacross the function generator (on CH 1) andVCacrossthe capacitorC(on CH 2). Ensure common ground for both channels and the signalgenerator. Measure magnitude ofVCand its phase with respect toVin, and note in Table 2.4. Interchange the resistor and inductor positions in the circuit. Display simultaneously voltageVinacross the function generator (on CH 1) andVRacross the resistorR(on CH 2). Ensurecommon ground for both channels and the signal generator. Measure magnitude ofVRandits phase with respect toVin, and note in Table 2.13
Background image
5. CalculateZC,ZTotal, using measured values and note in the Table.6. CalculateZC,ZTotal,I,VRandVCfor a source voltageVinof 5V peak and a frequency of 1kHz and then note down these quantities in Table 2.7. Draw the Phasor diagram of the RC circuit in Fig. 6.Table 2: Parameters of an RC circuits.ParametersZC(Ω)ZTotal(Ω)I(amp)VR(V)VC(V)Measured valuesCalculated valuesFigure 6: Phasor diagram of an RC Circuit.Conclusion/Summary————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————14
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 3Resonant frequency calculation of series and parallel RLCcircuits.Objectives:The response of a circuit containing both inductors and capacitors in series or in parallel dependson the frequency of the driving voltage or current. This lab will explore one of the more dramaticeffects of the interplay of capacitance and inductance, namely, resonance, when the inductive andcapacitive reactances cancel each other. The objective of this lab is to:Analyze behavior of series and parallel LC circuits at resonance.Understand the resonance frequency, cut-off frequency, bandwidth and quality factor of aresonance circuit.Determine if a circuit is inductive or capacitive and to understand the circuit behavior atresonanceApparatus:OscilloscopeSignal generatorInductorsCapacitorResistors (10kΩ / 20kΩ Use resistor of standard value available in the Lab)Theoretical BackgroundResonant circuits form the basis for filters that have better performance than first order (RL, RC)filters in passing desired signal or rejecting undesired signals that are relatively close in frequency.15
Background image
TheResonance Frequencyis defined as the frequency at which the impedance of the circuit ispurely real, that is, with zero reactance. For the reactance to be zero, impedance of the inductormust equal that of the capacitor. At resonance, the impedance of a branch with LC in series isequal to zero, which is equivalent to a short, and the admittance of a branch with LC in parallel isequal to zero, which is equivalent to an open. As the frequency increases, the magnitude of aninductive reactance increases, while the magnitude of a capacitive reactance decreases. A circuit issaid to be inductive if the total reactance is positive, and a circuit is said to be capacitive if thetotal reactance is negative. Fig. 5 shows a series RLC circuit. Using KVL:Figure 1: A series RLC Circuit.vin=vR+vL+vC(1)In experiment 2, we checked thatvL=IXL=IjωLandvC=IXC=IjωCvin=IR+IjωL+IjωC(2)=IR+IjωL-IjωC=I(R+jωL-jωC)16
Background image
ThusZ=R+jωL-jωC=R+j(ωL-1ωC)(3)When a series RLC circuit is in resonance, it possesses minimum impedanceZ=R. Thusmaximum circuit currentIflows, as it is being limited by the value ofRalone. ThisIis also inphase withVin. Similarly, this current produces large voltage drops acrossLandC. These twodrops being equal and opposite, cancel out each other. Taken together,LandCfrom part of acircuit across which no voltage develops however larger current is flowing. The frequency (ωorf)at which the net reactance of the series circuit is zero is called the resonant frequency (ωRorfR).Its value can be calculated as under:ZL+ZC= 0(4)j(ωRL-1ωRC)= 0(5)(ωRL-1ωRC)= 0(6)ωR2=1LC(7)ωR=1LC(8)fR=12πLC(9)IfLis in henry andCis in farads thenfRis in Hz.Task 1:1. For the circuits inductance and capacitance values calculate the resonant frequency andconnect the circuit as shown in Fig. 1.2. Apply sinusoidal signal from the signal generator of 5V peak to the network and set thefrequency to a value less than resonance frequencyfR. Phasor notation ofVinbecomes 50,therefore calculate phasor form ofXL,XC,Z,I,VLandVCat this frequency and note onTable 1. Calculate the above six quantities atfRand another frequency greater thanfR.Note all of them in the table.3. Now measureVC,VLandVRatfR, one frequency belowfRand one abovefR. Insert allvalues in Table 2. Make sure you measure both the peak magnitude and phase ofVC,VLandVRat these frequencies as done in Experiment 2. Complete Table 2 by calculatingI,XLandXCfrom the above measuredVC,VLandVR.17
Background image
Observations & CalculationsCalculated resonant frequency = —————————Table 1: Calculated values.NoFrequency (Hz)jXC(Ω)jXL(Ω)Z(Ω)I=VinZ(amp)VL=jIXL(V)VC=jIXC(V)Table 2: Measured values.NoFrequency (Hz)jXC(Ω)jXL(Ω)Z(Ω)I(amp)VL(V)VC(V)Resonance in a parallel RLC circuitAs we already know that if the capacitive reactance of a circuit is equal to the inductive reactancethen the circuit is in resonance condition. Fig. 2 shows a parallel RLC circuit whereiR(t),iL(t),andiC(t), are the currents flowing throughR,LandCrespectively. The voltage across all thesethree components is same and is equal tovin.Vin,Iin,IR,IL,ICrepresent phasor representation of input voltage, total input current, resistorcurrent, inductor current and capacitor current respectively.VinandIRare in phase and totalcurrentIcan be calculated asI=IR+IL+IC(10)=VinR+VinXL+VinXC18
Background image
Figure 2: A parallel RLC Circuit.whereXLandXCrepresent inductive and capacitive reactances respectively.I=Vin1R+1jωL+jωC(11)=Vin1R+jωC-1ωL=VinYwhereYis the admittance of the parallel RLC circuit. At resonance condition,ZL=ZC(12)RL=1RCωR2=1LCωR=1LC(rad/sec)fR=12πLC(Hz)Thus at resonance condition, total impedance of the RLC circuit will be equal toR(Refer to (12)for better understanding.Task 2:1. For the RLC Parallel circuit, calculate the resonant frequency and connect the circuit asshown in Fig. 2.2. Connect small resistors (like 1 Ω) in series with inductor and capacitor to measureIcandIL.19
Background image
3. Apply sinusoidal signal from the signal generator of 5V peak to the network and set thefrequency to a value less than resonance frequencyfR. Phasor notation ofVinbecomes 50,therefore calculate phasor form ofXL,XC,Y,I,IR,ILandICat this frequency and note onTable 3. Calculate the above six quantities atfRand another frequency greater thanfR.Note all of them in the table.4. Now measureIL,IcandIRatfR, one frequency belowfRand one abovefR. Insert allvalues in Table 4. Make sure you measure both the peak magnitude and phase ofIat thesefrequencies. Complete Table 2 by calculating the remaining parameters.Observations & CalculationsCalculated resonant frequency = —————————Table 3: Calculated values.Nof(Hz)ZC(Ω)ZL(Ω)YTotal-1)I=VinY(A)IL=VinZL(A)IC=VinZC(A)Table 4: Measured values.Nof(Hz)ZC(Ω)ZL(Ω)YTotal-1)IR(A)IL(A)IC(A)20
Background image
DiscussionQ1: Please discuss the how the total impedance of series RLC circuit varies by varying frequencyof input signal. You can draw a graph ofZversus frequency (0inf).———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————–Q2: Please discuss the how the total impedance of parallel RLC circuit varies by varyingfrequency of input signal. You can draw a graph ofZversus frequency (0inf).——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————–21
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 4Analysis of Circuits Using MATLABObjectives:The objective of this lab is to get familiar with MATLAB and utilize it in context of solving basiccircuits.Basic ConceptDouble click on MATLAB icon and a window will open like the one shown in Fig. 1. The displaycan be slightly different from the one shown in this Fig. due to different versions of MATLAB.Figure 1: MATLAB window.22
Background image
PLOTTING FUNCTIONSMATLAB allows you to create plots of functions easily. We will demonstrate this by the followingexample. Suppose we want to plot the following three functions:v1(t) = 5cos(2t+ 45o)v2(t) = 2exp(-t/2)v3(t) = 10exp(-t/2)cos(2t+ 45o)Further more we want to use red forv1, green forv2and blue forv3. In addition we want to labelthe figure, the horizontal and the vertical axes as well as each on of the the curves. The followingis a sequence of MATLAB commands that will allow us to do this. This is not a unique set ofcommands. Write the following code in m file. Save it and run it.clccleart=0:0.1:10; % t is the time varying from 0 to 10 in steps of 0.1sv1=5*cos(2*t+0.7854);taxis=0.000000001*t;plot(t,taxis,’w’,t,v1,’r’)gridhold on % For holding the previous figure and new plot will be drawn over the previous onev2=2*exp(-t/2);plot (t,v2,’g’)v3=10*exp(-t/2).*cos(2*t+0.7854);plot (t,v3,’b’)title(’Example 1 -- Plot of v1(t), v2(t) and v3(t)’)xlabel (’Time in seconds’)ylabel (’Voltage in volts’)text (6,6,’v1(t)’)text (4.25,-1.25,’v2(t)’)text (1,1.75,’v3(t)’)Please note the following important point:; at the end of a line defines the command but does not immediately execute it.The symbol * is used to multiply two numbers or a number and a function.he combination of symbols .* is used to multiply two functions.23
Background image
The command “hold on” keeps the existing graph and adds the next plot on to it. Thecommand “hold off” undoes the effect of “hold on”.In the command “text”, the first two numbers give the X and Y coordinate of where the testwillo appear in the figure.The command “plot” can plot more than one function simultaneously. In fact, in thisexample we could get away with only one plot command.Comments can be included after the % symbol.In the plot command, one can specify the color of the line as well as the symbol: ‘b’ standsfor blue, ‘g’ for green, ‘r’ for red, ‘y’ for yellow, ‘k’ for black; ‘o’ for circle, ‘x’ for x-mark, ‘+’for plus, etc. For more information type help plot in MATLAB command prompt.Save the plot as a jpg file. Draw it or paste in the space given below.COMPLEX NUMBERSWorking with complex numbers in MATLAB is easy. MATLAB works with the rectangularrepresentation. To enter a complex number, type:a + bj or a + biwith a and b being numerical values in command prompt.example: z = 5 - 3jTo find the magnitude and angle of z, use theabs()andangle()function.z = 5 - 3jMag = abs(z)Angle = angle(z)24
Background image
The angle function gives the angle in radians. To convert to degrees you can use:AngleDeg = angle(z)*180/piExample:V=(5+j9)(7+j)3-j2. Now type in command prompt:>>V = (5+9j)*(7+j)/(3-2j);>>MagnV = abs(V);To find the real and imaginary part of a complex number z, type:>>realZ=real(z);>>ImagZ=imag(z);SOLVING LINEAR EQUATIONS AND MATRICESAssume you have the following two linear equations with unknown I1 and I2:(600 + 1250j)I1 + 100j.I2 = 25100j.I1 + (60-150j).I2 = 0This can be written in matrix form: A.I = B. To solve this in MATLAB one can use the matrixleft division operator asI = A\B. Or one can also use the following command:I = inv(A)*BThe MATLAB code is as follows:>>A=[600+1250j 100j;100j 60-150j];>>B=[25;0];>>I=A\BI =0.0074 - 0.0156i0.0007 - 0.0107i>>MAGN=abs(I)MAGN =0.01730.0107>>ANGLE=angle(I)*180/piANGLE =25
Background image
-64.5230-86.3244Type the above given code in command prompt. When your write a code in command promptresults of previous line are calculated and can also be printed when you move to next line. Oneuses theabs()operator to find the magnitude of the complex number and theangle()operatorto find the angle (in radians). To get the result in degree we have multiplied the angle by 180/pias shown above.FINDING THE ROOTS OF A POLYNOMIALTo find the roots of a polynomial of the formA=amsm+am-1sm-1+am-2sm-2+· · ·+a1s1+a0Define the polynomial as follows:A = [am am-1 am-2 ... a1 a0];The command to for finding the roots isroots(A). As an example consider the following function:A= 4s2+ 12s+ 1Write in command prompt:>> A=[4 12 1];>> roots(A)ans =-2.9142-0.0858This works also for complex roots. As an example consider the function:Write in command prompt:>> A=[5 3 2];>> roots(A)ans =-0.3000 + 0.5568i-0.3000 - 0.5568i26
Background image
FINDING THE POLYNOMIAL WHEN THE ROOTS ARE KNOWNSuppose that you have the following expression F(s) and would like to find the coefficient of thecorresponding polynomial:F(s) = (s-a1)(s-a2)(s-a3)This is defined in MATLAB by a column vector of the roots:roots = [a1; a2; a3 ];One finds than the coefficient of the polynomial, using thepolycommand:poly(roots);As example consider the functionF(s) =s(s+ 50)(s+ 250)(s+ 1000). To find the coefficient ofthe coresonding polynomials, one first define the column vector of the roots:roots=[0; -50; -250; -1000 ];The coefficients are then found from the poly command:coeff = poly(roots)which will give:coeff = 1 1300 312500 12500000 0corresponding to the polynomial,F(s) =s4+ 1300s3+ 312500s2+ 12500000sExerciseWrite down the code for a series RLC circuit having following parameter values.R= 1KΩ, L= 10mH, C= 0.1μF, Vin= 5V. Calculate and plot following waveformsvr(t), vl(t), vc(t) at Three different frequencies 2 kHz, 5 kHz, and 8 kHz.Note:There should be total three graphs, one forVR, second forVLand third forVc. Each plotcontaining three waveforms at three different frequencies (2kHz, 5kHz, and 8 kHz). Plots shouldbe labeled appropriately.———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————27
Background image
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————28
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 5S Domain Analysis of Circuits Using MATLABObjectives:The objective of this lab is to get familiar with MATLAB and utilize it in context of working withLaplace transforms. MATLAB is a powerful numerical analysis tool, which can be utilized to find,for example the inverse Laplace transform, or the solution of equations arising from the analysis ofcircuits with time-varying excitations, etc.Basic ConceptsIn particular, MATLAB has the functionslaplaceandilaplace, which operate on symbolicexpressions to take the Laplace transform and inverse Laplace transform, respectively.F(s) =45s3+ 10s2+ 10s+ 5>> num=[4];% Denominator polynomial, D(s)>> den=[5 10 10 5];% Find the zeros of H(s) by N(s)=0>> roots(num)ans =Empty matrix: 0-by-1% Find the poles of H(s) by D(s)=0>> roots(den)ans =-1.0000-0.5000 + 0.8660i-0.5000 - 0.8660i29
Background image
Matlab output shows that there are no finite zeros; however, there are three poles: 1 and 0.5±j0.866. Thepolyval(p,x)function evaluates a polynomial at some specified value of theindependent variable x.Other MATLAB functions used with polynomials are the following:conv(a,b)multiplies two polynomials a and b.[q,r]=deconv(c,d)divides polynomial c by polynomial d and displays the quotient q andremainder r.polyder(p)produces the coefficients of the derivative of a polynomial p.Example:P= 2x6-8x4+ 4x2+ 10x+ 12Calculate roots of polynomial P, evaluate this polynomial at x = 5, also compute the derivative ofthe given polynomial.MATLAB Code:>> P = [2 0 -8 0 4 10 12];>> PValueAt5 = polyval(P,5)PValueAt5 =26412>> der_p=polyder(p) % Compute the coefficients of the derivative of P>> der_p =12 0 -32 0 8 10Therefore,dPdx= 12x5-32x3+ 8x+ 10Rational PolynomialsRational Polynomials are those which can be expressed in ratio form, that is, asR(x) =Num(x)Den(x)=bnxn+bn-1xn-1+bn-2xn-2+· · ·+b1x1+b0amxm+am-1xm-1+am-2xm-2+· · ·+a1x1+a0where some of the terms in the numerator and/or denominator may be zero. We can find theroots of the numerator and denominator with theroots(p)function as before. Also note, we canwrite MATLAB statements in one line, if we separate them by commas or semicolons. Commaswill display the results whereas semicolons will suppress the display.ExampleR(x) =PNumPDen=x5-3x4+ 5x2+ 7x+ 9x6-4x4+ 2x2+ 5x+ 630
Background image
Express the numerator and denominator in factored form, using theroots(p)function.MATLAB Code:>> num=[1 -3 0 5 7 9]; den=[1 0 -4 0 2 5 6];>> roots_num=roots(num), roots_den=roots(den)roots_num =2.4186+ 1.0712i 2.4186- 1.0712i -1.1633-0.3370+ 0.9961i -0.3370- 0.9961iroots_den =1.6760+0.4922i 1.6760-0.4922i -1.9304-0.2108+0.9870i -0.2108-0.9870i -1.0000As expected, the complex roots occur in complex conjugate pairs. For the numerator, we have thefactored form.PNum= (x-2.4186-j1.0712)(x-2.4186+j1.0712)(x+1.1633)(x+0.3370-j0.9961)(x+0.3370+j0.9961)Similarly for denominator,PDen= (x-1.6760-j0.4922)(x-1.6760+j0.4922)(x+1.9304)(x+0.2108-j0.9870)(x+0.2108j+0.9870)(x+1)We can check this result with MATLABsSymbolic Math Toolboxwhich is a collection of tools(functions) used in solving symbolic expressions. For the present, our interest is in using thecollect(s)function that is used to multiply two or more symbolic expressions to obtain theresult in polynomial form. We must remember that theconv(p,q)function is used with numericexpressions only, that is, polynomial coefficients. Before using a symbolic expression, we mustcreate one or more symbolic variables such as x, y, t, and so on. For our example, we use thefollowing code:MATLAB Code:syms x % Define a symbolic variable and use collect(s) to express numerator in polynomialformcollect((x-2.4186-j*1.0712)*(x-2.4186+j*1.0712)*(x+1.1633)*(x + 0.3370-j*0.9961)*(x + 0.33ans =x^5 - (29999*x^4)/10000 - (71*x^3)/160000 + (5000547421061*x^2)/1000000000000 + (109391796double()orvpa()commands can be used to convert fractional values in decimals in symbolictoolbox.Laplace & Inverse Laplace TransformExample:Letf(t) =sin2t, Calculate its Laplace and inverse Laplace transform using MATLAB.31
Background image
MATLAB Code:>> syms t>> f = sin (2*t)f =sin(2*t)>> F = laplace(f)F =2/(s^2 + 4)For converting F back to time domain from s domain,ilaplace()function can be used>> ilaplace(F)ans =sin(2*t)Pole-zero mapLetf(t) =cos5000tCalculate its Laplace and inverse Laplace transform usin MATLAB and drawits pole-zero diagram.MATLAB Code:>> syms t>> f = cos (5000*t)f =cos(5000*t)>> F = laplace(f)F =s/(s^2 + 25000000)>> sys = tf([1, 0],[1,0,25000000])sys =s------------s^2 + 2.5e07Continuous-time transfer function.>> pzmap(sys) %NOTE:Please check the use oftf()andpzmap()from MATLAB help.32
Background image
ExerciseEnd Problem 9.18 from text book. For the following waveform:f(t) = [500 + 100e-500ttsin(1000t)]u(t).(a) Find the Laplace transform of the waveform. Locate the poles and zeros of F(s).(b) Validate your result using MATLAB and draw pole zero diagram.——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————33
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 6Circuit Analysis With Laplace TransformObjectives:The objective of this lab is to utilize MATLAB in context of working with Laplace transforms.MATLAB is a powerful numerical analysis tool, which can be utilized to find, for example theinverse Laplace transform, or the solution of equations arising from the analysis of circuits withtime-varying excitations, etc.Basic ConceptsCircuit Transformation from Time to Complex FrequencyThe voltage-current relationships for the three elementary circuit devices, resistors, inductors, andcapacitors in the complex frequency domain are as follow.ResistorThe time and complex frequency domains for purely resistive circuits are shown in Fig. 1Figure 1: Resistive circuit in time domain and complex frequency domain.InductorThe time and complex frequency domains for purely inductive circuits is shown in Fig. 234
Background image
Figure 2: Inductive circuit in time domain and complex frequency domain.CapacitorThe time and complex frequency domains for purely capacitive circuits is shown in Fig. 3Figure 3: Capacitive circuit in time domain and complex frequency domainExample 1:ComputeZ(s) andY(s) for the circuit of Fig. 4. All values are in Ω. Verify youranswers with MATLAB.Figure 4: Linear circuit of Example 1It is convenient to represent the given circuit as shown in Fig. 5.SolutionZ1= 13s+8s=13s2+ 8sZ2= 10 + 5s35
Background image
Figure 5: Simplified CircuitZ3= 20 +16s=4(5s+ 4)sZs=Z1+Z2||Z3=Z1+Z2Z3Z2+Z4=13s2+ 8s+(10 + 5s)4(5s+4)s(10 + 5s) +4(5s+4)sZs=65s4+ 490s3+ 528s2+ 400s+ 128s(5s2+ 30s+ 16)Checking With MATLABsyms s; z1 = 13*s + 8/s; z2 = 5*s + 10; z3 = 20 + 16/s; z = z1 + z2 * z3 / (z2+z3)z10 = simplify(z), pretty(z10), Y10 = pretty(1/z10)ExerciseTask1:The switch in Fig. 6 has been in position A for a long time and is moved to position B att= 0.(a) Transform the circuit into the s domain and solve forIL(s) in symbolic form.(b) Repeat part (a) using MATLAB.Hint: Use syms s R1 R2 R3 L C(c) FindiL(t) for R1= R2 = 500 Ω, R3 = 1 kΩ, L = 500 mH, C = 0.2μF, and VA = 15 V.Figure 6: Circuit of Task 136
Background image
Task2:There is no external input in the circuit in Fig. 7.(a) Find the zero-input node voltagesvA(t) andVB(t), and the voltage across the capacitorvC(t)whenvC(0) =-5 V andiL(0) = 0 A.(b) Use MATLAB to calculate and plot your results in (a).Figure 7: Circuit of Task 237
Background image
Task3:The switch in Fig. 8 has been in position A for a long time and is moved to position B att= 0.Use MATLAB to solve forVC(s) andvC(t). Also using MATLAB, plotvC(t) and the exponentialsource on the same axes.Figure 8: Circuit of Task 138
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 7Analysis of first and second order circuits (FrequencyResponse)Objectives:The objective of this lab is to utilize MATLAB to analyze the frequency response of first andsecond order circuits (with real poles).Basic ConceptsStep ResponseThe time domain response of a circuit when a unit step is applied at its input. MATLAB has abuilt-in functionstep()which plots the step response of the system.Impulse ResponseThe time domain response of a circuit when an impulse is applied at its input. MATLAB has abuilt-in functionimpulse()which plots the step response of the system.Bode PlotA bode plot is a graph of the frequency response of the system. The Bode magnitude plot consistsof the magnitude (in dB) vs the frequency (Hz or radian per sec.) in logarithmic scale. The Bodephase plot expresses the phase or the phase shift (in radians or degrees) vs the frequency (Hz orradian per sec.) in logarithmic scale. Bode plots can be evaluated from the transfer function bysubstitutings=jw.FrequenceyResponse=H(jw) =H(s) =Vout(s)Vin(s)(1)39
Background image
Cutoff frequencyThe cutoff frequency is the frequency at which the gain of the circuit is 3dB less than themaximum gain.MATLAB built-in functionsFew recommended builtin functions for this lab are as follows:bode(sys); tf(num,den); bodemag(sys,w); bode(sys,w)logspace(first_exponent,last_exponent ,number_of_values)%logarithmically spaced vectorof specified number of values from 10^{first_exponent} to 10^{last_exponent}solve(equ)%solves the equation by equating it to zero.semilogx(x,y)%plots y vs x with x axis in log scale.semilogy(x,y)%plots y vs x with y axis in log scale.roots(p)%finds the roots of a polynomialimpulse(sys); fprintf(’ \n’); disp(); pzmap()[y,t] = step(sys)%stores step response data in arraysPlease take some time to check the help of above mentioned functions. Please make separatemfiles for each of the following examples and tasks.Example 1:Draw the bode plot of the given transfer functionG(s) =1100ss2+1100s+105num=[0 1100 0]; den=[1 1100 10^5]; sys=tf(num,den);w=logspace(0,5,100); bodemag(sys,w); gridExample 2:The following script shows you how to create a magnitude and a phase Bode plot for the transferfunctionH(s) =ss+1000using 30 points from 5 rad/s to 10,000 rad/s:num = [1 0]; % Numeratorden = [1 1000]; % Denominatorw = logspace(log10(5), 4, 30);[mag, phase] = bode(num, den, w);magdb = 20 * log10(mag);subplot(2,1,1);semilogx(w, magdb);grid;axis([5 10000 -50 0]);40
Background image
title(’Bode Plots for H(s) = s / s + 1000’);xlabel(’Frequency, rad/s’);ylabel(’Magnitude, dB’);subplot(2,1,2);semilogx(w, phase);grid;axis([5 10000 0 100]);xlabel(’Frequency, rad/s’);ylabel(’Phase, deg’);Example 3:Solve the given equation and write the value ofw:atan(w/100) +atan(w/1000)-/2 = 0syms w; x=solve(atan(w/100)+atan(w/1000)-pi/2);combine(x)Exercise:Task1:(a) RC circuit(b) RL circuit(c) RLC circuitFigure 1: Various circuits for Task 1a)Determine the transfer function of the three circuits given in Fig. 1.Transfer function of RC circuit = ——————————————Transfer function of RL circuit = ——————————————Transfer function of RLC circuit = ——————————————b)Plot in Fig. 2, the step response of RC, RL and RLC circuit given in Fig. 1.c)Plot in Fig. 3, the impulse response.of RC, RL and RLC circuits given in Fig. 1.41
Background image
Figure 2: Step response of RC, RL and RLC circuit.Figure 3: Impulse response of RC, RL and RLC circuit.d)Plot the bode plots, of the three circuits, in Fig. 4.e)Determine the cut off frequency and 3dB bandwidths using your answers to part d.fcutoffof RC circuit = ————————- Bandwidth of RC circuit = ————————-fcutoffof RL circuit = ————————- Bandwidth of RL circuit = ————————-fcutoffof RLC circuit = ————————- Bandwidth of RLC circuit = ————————-f)Draw the pole zero diagram of the three circuits in Fig. 5.42
Background image
Figure 4: Bode plot of RC, RL and RLC circuit.Figure 5: Pole zero plot of RC, RL and RLC circuit.Task 2:For the series RLC circuit, given in Task 1, use your Bode plot to estimate the frequencyfor which the phase is zero radians. Also compute the actual frequency where the phase is zero.43
Background image
(*Hint: The phase will be zero when the numerator and denominator phases are equal. You canuse the MATLAB solve function). Use your Bode plot to determine the outputvout(t) when theinputvin(t) = 5cos(200πt+π/6)————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————Task 3:Determine the transfer function and Bode plot for the circuit shown in Fig. 6 using youranswers of Task1 (a,b).(Hint: You can use convolution function).Figure 6: Task 3————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————–44
Background image
Name: ————————————–Registration #: ————————————–EXPERIMENT NO 8To plot the frequency (consisting of magnitude and phase)response of passive filters.Objectives:The objective of this lab is to observe and plot the magnitude & phase response of first andsecond order filters.ApparatusOscilloscopeSignal GeneratorCapacitor (0.1μF, 1 nF or any capacitor of standard value in the Lab)Resistors(10 KΩ /20 KΩ /Use resistor of standard value available in the Lab)Inductor ( 270μH/ similar value available in the Lab)Theoretical BackgroundUsing various combinations of resistors capacitors and inductors, circuits can be built that havethe property of passing or rejecting either low or high frequencies or band of frequencies. Thesefrequency selective networks, which alter the amplitude and phase characteristics of the input acsignal, are called filters. Thus filter is an AC circuit that separates some frequencies from otherfrequencies within a composite signal of various frequencies.Electronic filters can be passive or active. Passive implementations of filters are based oncombinations of resistors, capacitors and inductors. These types are collectively known as passivefilters, because they do not depend upon an external power supply and/or they do not containactive components such as transistors. Active filters are implemented using a combination ofpassive and active (amplifying) components, and require an outside power source.45
Background image
Critical Frequency:The critical frequency is the frequency at which the filter’s output voltage is 70.7 % of themaximum. The filter’s critical frequency is also called the cutoff frequency, break frequency, or -3dB frequency because the output voltage at this frequency is 3 dB less than its maximum value.The term dB (decibel) is a commonly used in filter measurements and is explained below.DecibelsThe basis for the decibel unit stems from the logarithmic response of the human ear to theintensity of sound. The decibel is a logarithmic measurement of the ratio of one power to another.For example for filters this ratio can be expressed as output power from a filter to input powergiven to a filter.decibel= 10log10PoutputPinputAs electric power across a resistor can be expressed asPower=P=V2RAssuming that input and output power are measured in terms of voltages across same resistordecibel= 10log10Voutput2RVinput2R(1)decibel= 20log10VoutputVinput(2)Passive first order filtersLow Pass RC FilterA Low Pass Filter (LPF) allows signals of frequencies lower than cutoff frequency to pass frominput to output while rejecting higher frequencies.Task11. Patch the RC circuit given in Fig. 1 on the breadboard and apply sinusoidal signal from thesignal generator. Adjust the magnitude of the sinusoidal signal to 10 V peak and 100 Hz.2. Display simultaneously voltagevinacross the function generator (on CH 1) andvoutacrossthe capacitorC(on CH 2). Ensure common ground for both channels and the signalgenerator. Measure magnitude ofvoutand its phase with respect tovin, and note in Table 1.46
Background image
Figure 1: Low Pass RC filter3. Vary the frequency of input signal, measure and calculate the gain and phase and note inTable 1.4. Plot the magnitude and phase of RC Low pass filter based on the parameters noted inTable 1.Table 1: Low Pass RC FilterNo.fin(Hz)ωin(rad/s)vin(V)vout(V)Gain =voutvin(dB)Phase (degrees)12345678High Pass RC FilterA high pass filter allows signals with higher frequencies greater than cutofffrequency, to pass from input to output while rejecting lower frequencies.47
Background image
Task21. Patch the RC circuit given in Fig. 1 by interchanging the resistor and capacitor positionsand apply sinusoidal signal from the signal generator. Adjust the magnitude of thesinusoidal signal to 10 V peak and 100 Hz.2. Display simultaneously voltagevinacross the function generator (on CH 1) andvoutacrossthe resistorR(on CH 2). Ensure common ground for both channels and the signalgenerator. Measure magnitude ofvoutand its phase with respect tovin, and note in Table 2.3. Vary the frequency of input signal, measure and calculate the gain & phase, and note inTable 2.4. Plot the magnitude and phase of RC Low pass filter based on the parameters noted inTable 2.Table 2: High Pass RC FilterNo.fin(Hz)ωin(rad/s)vin(V)vout(V)Gain =voutvin(dB)Phase (degrees)12345678High Pass RL FilterTask31. Patch the RL circuit given in Fig. 2 on the breadboard and apply sinusoidal signal from thesignal generator. Adjust the magnitude of the sinusoidal signal to 10 V peak and 100 Hz.48
Background image
Figure 2: High Pass RL filter2. Display simultaneously voltagevinacross the function generator (on CH 1) andvoutacrossthe inductorL(on CH 2). Ensure common ground for both channels and the signalgenerator. Measure magnitude ofvoutand its phase with respect tovin, and note in Table 3.3. Vary the frequency of input signal, measure and calculate the gain and phase and note inTable 3.4. Plot the magnitude and phase of RL Low pass filter based on the parameters noted inTable 3.Low Pass RC FilterTask41. Patch the RL circuit given in Fig. 1 by interchanging the resistor and inductor positions andapply sinusoidal signal from the signal generator. Adjust the magnitude of the sinusoidalsignal to 10 V peak and 100 Hz.2. Display simultaneously voltagevinacross the function generator (on CH 1) andvoutacrossthe resistorR(on CH 2). Ensure common ground for both channels and the signalgenerator. Measure magnitude ofvoutand its phase with respect tovin, and note in Table 4.3. Vary the frequency of input signal, measure and calculate the gain & phase, and note inTable 4.4. Plot the magnitude and phase of RC Low pass filter based on the parameters noted inTable 4.49
Background image
Table 3: High Pass LC FilterNo.fin(Hz)ωin(rad/s)vin(V)vout(V)Gain =voutvin(dB)Phase (degrees)12345678Table 4: Low Pass LC FilterNo.fin(Hz)ωin(rad/s)vin(V)vout(V)Gain =voutvin(dB)Phase (degrees)1234567850
Background image