Question 6.9: Bode Plot Using the MATLAB Symbolic Toolbox Obtain a magnitu...

Bode Plot Using the MATLAB Symbolic Toolbox
Obtain a magnitude bode plot of the transfer function H(f ) = Vout/Vin for the circuit of Figure 6.43 with frequency ranging from 100 kHz to 10MHz. Manually check the plotted values for high and low frequencies.

6.43
The 'Blue Check Mark' means that either the MATLAB code/script/answer provided in the answer section has been tested by our team of experts; or the answer in general has be fact checked.

Learn more on how do we answer questions.

We assume that the input voltage Vin is 1V. Then, we choose node voltage variables V1, V2, and V3 as shown in the figure. Notice that V3 and Vout are the same voltage and are equal to the desired transfer function. The node equations are obtained by applying KCL at each node.

\frac{\mathrm{V_1}-1}{R_s}+j\omega C_1 \mathrm{V_1} +\frac{\mathrm{V_1}-\mathrm{V_2}}{j\omega L_1}=0

\frac{\mathrm{V_2}-\mathrm{V_1}}{j\omega L_1}+j\omega C_2 \mathrm{V_2} +\frac{\mathrm{V_2}-\mathrm{V_3}}{j\omega L_2}=0

\frac{\mathrm{V_3}-\mathrm{V_2}}{j\omega L_2}+j\omega C_3 \mathrm{V_3} +\frac{\mathrm{V_3}}{R_L}=0

An m- file that produces the desired Bode plot is:

Clear
% Construct the symbolic objects that appear in the circuit:
syms V1 V2 V3
syms w Rs RL C1 C2 C3 L1 L2 real
% Notice that V1, V2 and V3 are complex quantities
% while w, Rs, etc. are real.
% Solve the node voltage equations for V1, V2, and V3:
% Use i rather than j.
[V1 V2 V3] = solve('(V1-1)/Rs + i*w*C1*V1 + (V1-V2)/(i*w*L1) = 0',...
'(V2-V1)/(i*w*L1) + i*w*C2*V2 + (V2-V3)/(i*w*L2) = 0',...
'(V3-V2)/(i*w*L2) + i*w*C3*V3 + V3/RL = 0',...
'V1','V2','V3');
% Enter the component values:
C1 = 1.967e-9; C2 = 6.366e-9; C3 = 1.967e-9;
L1 = 12.88e-6; L2 = 12.88e-6; Rs = 50; RL = 50;
% Substitute the component values into the solution for V3
% and define result as the transfer function H:
H = subs(V3);
% Recall that the transfer function is the same as the
% output voltage V3.
% Next, set up a row matrix of logarithmically equally spaced
% frequencies at 100 points per decade from 10 5 to 10 7 Hz:
f = logspace(5,7,200);
wn = 2*pi*f;
% Substitute the frequency values into the transfer function
% and convert to numeric form by using the double command:
H = double(subs(H,w,wn));
% Convert the transfer function magnitude to dB and plot:
HmagdB = 20*log10(abs(H));
semilogx(f,HmagdB)

The resulting plot is shown in Figure 6.44. The m- file is named Example_6_ 9 and can be found in the MATLAB folder.
To check the plotted transfer function at very low frequencies, we replace the inductances by shorts and the capacitors with opens. Then, the circuit becomes a simple voltage divider and the transfer function is

H(0)=\frac{R_L}{R_s+R_L}=0.5

which is equivalent to -6 dB, agreeing very well with the value plotted at 100 kHz.
At very high frequencies, the capacitors become shorts and the inductors become opens. Then the output voltage tends toward zero, and the transfer function tends toward -∞ dB. This agrees with the trend of the plot at high frequencies

6.44

Related Answered Questions