When doing circuit analysis with components defined in the complex frequency domain, the ratio of the output voltage Vout(s) ro the input voltage Vin(s) under zero initial conditions is of great interest. This ratio is known as the voltage transfer function denoted Gv(s):
Gv(s)=Vout(s)Vin(s)
Similarly, the ratio of the output current Iout(s) to the input current Iin(s) under zero initial conditions, is called the cuurent transfer function denoted Gi(s):
Gi(s)=Iout(s)Iin(s)
Derive an expression for the transfer function G(s) for the circuit below. In this circuit Rg represents the internal resistance of the applied (voltage) source vs, and RL represents the resistance of the load that consists of RL, L and C.
G(s)=Vout(s)Vs(s)=RL+sL+1/sCRg+RL+sL+1/sC.
Compute the transfer function for the op-amp circuit shown below in terms of the circuit constants R1, R2, R3, C1 and C2. Then replace the complex variable s with jω, and the circuit constants with their numerical values and plot the magnitude |G(s)|=|Vout(s)/Vin(s)| versus radian frequency ω.
G(s)=Vout(s)Vin(s)=−1R1((1/R1+1/R2+1/R3+sC1)(sC2R3)+1/R2).
See attached script: solution7.m.
syms s;
R1 = 200*10^3;
R2 = 40*10^3;
R3 = 50*10^3;
C1 = 25*10^(-9);
C2 = 10*10^(-9);
den = R1*((1/R1+ 1/R2 + 1/R3 + s*C1)*(s*R3*C2) + 1/R2);
simplify(den)
ans = 100*s*((7555786372591433*s)/302231454903657293676544 + 1/20000) + 5
Result is: 100*s*((7555786372591433*s)/302231454903657293676544 + 1/20000) + 5
Simplify coefficients of s in denominator
format long
denG = sym2poly(ans)
denG = 0.000002500000000 0.005000000000000 5.000000000000000
numG = -1;
Plot
For convenience, define coefficients a and b:
a = denG(1);
b = denG(2);
w = 1:10:10000;
G(jω)=−1aω2−jbω+5
Gs = -1./(a*w.^2 - j.*b.*w + denG(3));
semilogx(w, abs(Gs))
xlabel('Radian frequency w (rad/s')
ylabel('|Vout/Vin|')
title('Magnitude Vout/Vin vs. Radian Frequency')
grid
Please use the file tf_matlab.m to explore the Transfer Function features provide by Matlab. Use the publish option to generate a nicely formatted document.
The Simulink transfer function (Transfer Fcn
) block shown above implements a transfer function representing a general
input output function
G(s)=N(s)D(s)
that it is not specific nor restricted to circuit analysis. It can, however be used in modelling and simulation studies.
Recast Example 7 as a MATLAB problem using the LTI Transfer Function block.
For simplicity use parameters R1=R2=R3=1Ω, and C1=C2=1F.
Calculate the step response using the LTI functions.
Verify the result with Simulink.
The Matlab solution: example8.m
From a previous analysis the transfer function is:
G(s)=VoutVin=−1R1[(1/R1+1/R2+1/R3+sC1)(sR3C2)+1/R2]
so substituting the component values we get:
G(s)=VoutVin=−1s2+3s+1
We can find the step response by letting vin(t)=u0(t) so that Vin(s)=1/s then
Vout(s)=−1s2+3s+1.1s
We can solve this by partial fraction expansion and inverse Laplace transform
as is done in the text book with the help of Matlab's residue
function.
Here, however we'll use the LTI block that was introduced in the lecture.
Define the circuit as a transfer function
G = tf([-1],[1 3 1])
G = -1 ------------- s^2 + 3 s + 1 Continuous-time transfer function.
step response is then:
step(G)
Simples!
See example_8.slx
open example_8
Let's go a bit further by finding the frequency response:
bode(G)