MATLAB: Finding the Transfer Function of resonance system

MATLAB and Simulink Student Suitetransfer function

How can I obtain a transfer function of uout(t) and uin(t) ? Is there any way to find it using MATLAB/Simulink ?
Any help would be appreciated. Thanks!

Best Answer

If you have the Symboli cMath Toolbox, the analysis of that circuit is straightforward:
syms R1 Ramp L C vi vo f t A
iR1 = (vi - vo)/R1;
iL = vo/s*L;
iC = vo*s*C;
iRa = vo/Ramp;
Node1 = iR1 == (iL + iC + iRa);
vo = solve(Node1, vo);
H = simplify(collect(vo/vi, s), 'steps',10)
Hsub = vpa(subs(H, {R1, L, C}, {60E+3, 2E-3, 5.3E-12}), 6) % Transfer Function
H =
(Ramp*s)/(C*R1*Ramp*s^2 + (R1 + Ramp)*s + L*R1*Ramp)
Hsub =
(Ramp*s)/(3.18e-7*Ramp*s^2 + (Ramp + 60000.0)*s + 120.0*Ramp)
Without knowing what ‘Ramp’ is, a plot is impossible.
Note that:
Vin = A*cos(2*pi*f*t);
so to solve for the output voltage given the input voltage, you have to take the Laplace transform of ‘Vin’ and substitute it in the ‘Node1’ equation:
Node1 = iR1 == (iL + iC + iRa);
Vins = laplace(A*cos(2*pi*f*t)); % Laplace Transform Of ‘Vin’
Node1 = subs(Node1, {R1, L, C, vi}, {60E+3, 2E-3, 5.3E-12, Vins}); % Substitute Component Values & ‘Vin’
Vout = solve(Node1, vo);
Vout = vpa(collect(Vout.vo, s), 6) % Vout
Vout =
(3.86856e25*A*Ramp*s^2)/(s*(1.52725e27*Ramp*f^2 + 9.16348e31*f^2) + 1.8327e29*Ramp*f^2 + 1.2302e19*Ramp*s^4 + s^2*(4.85665e20*Ramp*f^2 + 4.64228e27*Ramp) + s^3*(3.86856e25*Ramp + 2.32114e30))
Related Question