Lab5 Parallel Resonance
Lab5 Parallel Resonance
NOTE: The simulations that follow are intended to be completed with NL5. It is
assumed that the student has a fundamental understanding of the operation of NL5.
• I1 is an AC current source. Set the type to ‘Sin,’ and the magnitude to 1 mA.
• L1 is an ideal inductor. Set to 0.1 H.
• R1 is an ideal resistor. Set to 20 kΩ.
• C1 is an ideal capacitor. Set to 100 nF.
Add a trace for the input impedance by selecting AC / Data / Traces from the menu.
Click on ‘Function’ in the ‘Add new trace’ section. Add the function V(I1)/I(I1).
Next, we want to measure the output voltage of the parallel circuit. For this example,
take the output voltage as the voltage across the capacitor. Right click on the capacitor
and select Add trace / Voltage. Run the simulation and adjust the data display to show
this voltage.
Next, we want to simulate the input impedance of the parallel resonant circuit with a
varying resistor. Use the same circuit as above, but change the resistor values to 5k,
10k, 20k, 40k, 200k, 400k, and 800k Ω. This type of parametric sweep is accomplished
in NL5 with a script. Go to Tools / Script and click on the Sweep tab. Select List
instead of Loop. Enter R1 as the Name, enter the parametric values in the box, and
select AC sweep. Click on the blue arrow to start the script.
What is the value of the output voltage? Describe the phase characteristics of the
output voltage.
For Homework:
You need to re-solve the parallel resonant circuit with inductor ESR and see its effects
on the magnitude and phase plots in some detail. For example choose the ratio of the L
ESR to the load resistance to be in the ratio range from 0.01 to 1.
NOTE: The simulations that follow are intended to be completed with MATLAB.
It is assumed that the student has a fundamental understanding of the operation
of MATLAB. MATLAB provides tutorials for users that are not experienced with
its functions.
In this lab you will learn how to write a function to varying, calculating and plotting
the input impedance, current and output voltage of the series RLC resonant tank
circuit. Also plot the natural response of the parallel RLC tank circuit. You can
define your own function in MATLAB. A function must start with a line.
Function return-value = function-name (arguments)
So that MATLAB will recognize it as a function. Each function must have its own
file and the file must have the same as the function.
PROCEDURE:
Part 1: Write a function to calculate the total input impedance of parallel RLC
resonant circuit as shown in Figure 1.
Im is a variable current. Set to 0.001 amps
L is a variable inductor. Set to 0.1H.
R is a variable ideal resistor. Set to 20000Ω.
C is a variable ideal capacitor. Set to 100nF.
Page 8 of 25
Page 9 of 25
Figure 1: The input impedance of parallel RLC tank circuit.
Once the above function file is captured, the simulations can be run. First, go to
your directory. Find your function file and then run your file. If there is a red
Page 10 of 25
message on your MATLAB window, then you need to correct your error.
Otherwise, you will see the solution as show in figure 2.
Page 11 of 25
Figure2: The output of input impedance of parallel RLC tank circuit.
Next, plot the output voltage of the parallel resonant RLC tank circuit. Write
another function to calculate the output voltage and plot of parallel RLC tank
circuit as shown in Figure 3. All the initial variables and values are remain the
same.
Page 12 of 25
Figure 3: the function to calculate the total input current of series RLC tank circuit
Once the above function file is captured, the simulations can be run. First, go to
your directory. Find your function file and then run your file. If there is a red
message on your MATLAB window, then you need to correct your error.
Otherwise, you will see the solution as show in figure 4.
Page 13 of 25
Page 14 of 25
Figure 4: the output and plot of the output voltage of parallel RLC tank circuit
Now write a function to varying R of the output voltage in parallel RLC resonant
circuit by adding an array of Resistors (R) value. Again all the initial variables
and values are remain the same.
Im is a variable current. Set to 0.001 amps
L is a variable inductor. Set to 0.1H.
R is a variable ideal resistor. Set to 20000Ω.
C is a variable ideal capacitor. Set to 100nF.
Page 15 of 25
Write a loop function to do the varying resistors value, calculate and plot the
output voltage of parallel RLC resonant circuit. When the function to varying R
of the output voltage of parallel RLC resonant circuit function file is captured, the
simulations can be run. If there is any error message on your MATLAB windows,
then correct your error and then rerun the simulation. Otherwise, you will see the
result as show below
Page 16 of 25
Figure 5: A function to calculate and plot of the output voltage in parallel RLC
resonant circuit with varying Resistor
Page 17 of 25
Figure 6: Output voltage of parallel RLC resonant circuit with varying Resistor
For Homework:
You need to re-solve the parallel resonant circuit with inductor ESR
and see its effects on the magnitude and phase plots in some detail.
For example choose the ratio of the L ESR to the load resistance to
be in the ratio range from 0.01 to 1.
Page 18 of 25
Next write m file to varying R of the natural response of current in parallel RLC
resonant circuit by adding an array of Resistors (R) value. Again all the initial
variables are remain the same but change their values.
Im is a variable current. Set to 1 volts
L is a variable inductor. Set to 39.487 H.
R is a variable ideal resistor. Set to 2000Ω.
C is a variable ideal capacitor. Set to 1µF
Io is a variable ideal of inductor current. Set to 0 amps.
Vo is a variable ideal of capacitor voltage. Set to 0 volts.
Write a loop function to do the varying resistors value, calculate and plot the
natural response of current for parallel RLC resonant circuit. When the m file to
varying R of the natural response of current in parallel RLC resonant circuit file is
captured, the simulations can be run. If there is any error message on your
MATLAB windows, then correct your error and then rerun the simulation.
Otherwise, you will see the result as show below
Page 19 of 25
Page 20 of 25
Figure 11: The m file to calculate and plot the natural response of current in
parallel RLC resonant circuit with varying Resistor
Page 21 of 25
Figure 12: This figure is shown the output of the natural responses of current in
parallel RLC resonant circuit with varying Resistor
Write a loop function to do the varying resistors value, calculate and plot the
natural response of output voltage in a parallel RLC resonant circuit. When the
m file to varying R of the natural response of parallel RLC resonant circuit file is
captured, the simulations can be run. If there is any error message on your
MATLAB windows, then correct your error and then rerun the simulation.
Otherwise, you will see the result as show below
Page 22 of 25
Page 23 of 25
Figure 13: the m file to calculate and plot the natural response of current in a
parallel RLC resonant circuit with varying Resistor
Page 24 of 25
Figure 14: the output of the natural response of capacitor voltage in a parallel
RLC resonant circuit with varying Resistor
Page 25 of 25