You are on page 1of 10

e. Make the bode plot using MATLAB and confirm your results of part (a).

MATLAB Program part.e

% clear everything
close all
clear all
% Example Transfer Function: G(s) = 10/s(s+3)(s+3)

% Numerator
num = [10];
% Denominator
den = [1 6 9 0 ];

% Transefer Function
G = tf(num, den)
W=logspace(-1,2,100);
% plot Frequency Respone
bode(G,W);
margin(G)
[Gm,Pm,Wcg,Wcp]= margin(G)
GmdB = 20*log10(Gm);
[GmdB Pm Wcp Wcg]

ans =

14.6479 53.1301 1.0000 3.0000

Part.E
f. Make bode plot using the value of K found in (b) and confirm the results of (b) and (c).

MATLAB Programs part.f


% clear everything
close all
clear all
% Example Transfer Function: G(s) = 20.784/s(s+3)(s+3)

% Numerator
num = [20.784];
% Denominator
den = [1 6 9 0 ];

% Transefer Function
G = tf(num, den)
W=logspace(-1,2,100);
% plot Frequency Respone
bode(G,W);
margin(G)
ans =

8.2933 30.0027 1.7320 3.0000

Part.F
g. Make bode plot using the value of K found in (d) and confirm that the gain margin is 15 dB.

MATLAB Program part.g

% clear everything
close all
clear all
% Example Transfer Function: G(s) = 9.6/s(s+3)(s+3)

% Numerator
num = [9.6];
% Denominator
den = [1 6 9 0 ];

% Transefer Function
G = tf(num, den)
W=logspace(-1,2,100);
% plot Frequency Respone
bode(G,W);
margin(G)

Part.g

You might also like