Professional Documents
Culture Documents
BRIAN G GACHARI
1. TRANSIENT RESPONSE
sysOd =
--------------
s^2 + 12 s + 9
>> transient
s = s
Continuous-time transfer function.
sysOd =
9
-------------
s^2 + 6 s + 9
>> transient
s= s
sysOd =
-------------
s^2 + 3 s + 9
>> transient
s = s
Continuous-time transfer function.
sys =
500
--------------------
0.05 s^2 + 0.6 s + 1
Gs2 =
500
----------------------
0.05 s^2 + 0.6 s + 501
Steady_state_error4 =
0.0020
ii) K=1
% K=1
s = tf('s')
sys = 1/(s*(1+0.1*s)*(1+0.5*s))
h = 1 % The system has unity feedback
Gs2 = feedback(sys,h)
step(Gs2)
grid
figure(5)
Steady_state_error4 = dcgain(1/(1+sys))
>> transient
s =
sys =
1
----------------------
0.05 s^3 + 0.6 s^2 + s
h =
Gs2 =
1
--------------------------
0.05 s^3 + 0.6 s^2 + s + 1
Steady_state_error4 = 0
K=4
% K=4
s = tf('s')
sys = 4/(s*(1+0.1*s)*(1+0.5*s))
h = 1 % The system has unity feedback
Gs2 = feedback(sys,h)
step(Gs2)
grid
figure(5)
Steady_state_error4 = dcgain(1/(1+sys))
>> transient
s= s
sys =
----------------------
h= 1
Gs2 =
--------------------------
Steady_state_error4 = 0
K=25
% K=25
s = tf('s')
sys = 25/(s*(1+0.1*s)*(1+0.5*s))
h = 1 % The system has unity feedback
Gs2 = feedback(sys,h)
step(Gs2)
grid
figure(5)
Steady_state_error4 = dcgain(1/(1+sys))
s =
sys =
25
----------------------
Published with MATLAB® R2017a
F17/35020/2013
BRIAN G GACHARI
h =
Gs2 =
25
---------------------------
0.05 s^3 + 0.6 s^2 + s + 25
Steady_state_error4 =
k=100
% K=100
s = tf('s')
sys = 100/(s*(1+0.1*s)*(1+0.5*s))
h = 1 % The system has unity feedback
Gs2 = feedback(sys,h)
step(Gs2)
grid
figure(5)
Steady_state_error4 = dcgain(1/(1+sys))
s =
sys =
100
----------------------
0.05 s^3 + 0.6 s^2 + s
h =
Gs2 =
100
----------------------------
0.05 s^3 + 0.6 s^2 + s + 100
Steady_state_error4 =
iii)
K=0.5
%K = 0.5
s = tf('s') % Declaring variable s will be used in the tranfer functio
oltf = 5/(s*(s^2+4*s+200)) % The open loop tansfer function provided in the qestion
h = 1 % The system has unity feedback
Gs3 = feedback(oltf,h)
step(Gs3)
grid
figure(1)
Steady_state_error4 = dcgain(1/(1+oltf)) %calculates the steady state error of the system
s =
oltf =
5
-------------------
s^3 + 4 s^2 + 200 s
h =
Gs3 =
5
-----------------------
s^3 + 4 s^2 + 200 s + 5
Steady_state_error4 =
K=2
%K = 2
s = tf('s') % Declaring variable s will be used in the tranfer functio
oltf = 20/(s*(s^2+4*s+200)) % The open loop tansfer function provided in the qestion
h = 1 % The system has unity feedback
Gs3 = feedback(oltf,h)
step(Gs3)
grid
figure(1)
Steady_state_error4 = dcgain(1/(1+oltf)) %calculates the steady state error of the system
s =
oltf =
20
-------------------
Published with MATLAB® R2017a
F17/35020/2013
BRIAN G GACHARI
h =
Gs3 =
20
------------------------
s^3 + 4 s^2 + 200 s + 20
Steady_state_error4 =
K = 10
%K = 10
s = tf('s') % Declaring variable s will be used in the tranfer functio
oltf = 100/(s*(s^2+4*s+200)) % The open loop tansfer function provided in the qestion
h = 1 % The system has unity feedback
Gs3 = feedback(oltf,h)
step(Gs3)
grid
figure(1)
Steady_state_error4 = dcgain(1/(1+oltf)) %calculates the steady state error of the system
s =
oltf =
100
-------------------
s^3 + 4 s^2 + 200 s
h =
Gs3 =
100
-------------------------
s^3 + 4 s^2 + 200 s + 100
Steady_state_error4 =
K = 60
%K = 60
s = tf('s') % Declaring variable s will be used in the tranfer functio
oltf = 600/(s*(s^2+4*s+200)) % The open loop tansfer function provided in the qestion
h = 1 % The system has unity feedback
Gs3 = feedback(oltf,h)
step(Gs3)
grid
figure(1)
Steady_state_error4 = dcgain(1/(1+oltf)) %calculates the steady state error of the system
s =
oltf =
600
-------------------
Published with MATLAB® R2017a
F17/35020/2013
BRIAN G GACHARI
h =
Gs3 =
600
-------------------------
s^3 + 4 s^2 + 200 s + 600
Steady_state_error4 =
2. ROOT LOCI
a)
% Root Locus of an Oltf with unity feedback
s = tf('s') % Declaring variable s will be used in the tranfer functio
Gs=((s+9)^2)/((s+1)^3) % The open loop tansfer function provided in the qestion
rlocus(Gs) % This command generates the root locus diagram that is displayed.
grid
figure(1)
s =
Gs =
s^2 + 18 s + 81
---------------------
s^3 + 3 s^2 + 3 s + 1
b)
s = tf('s') % Declaring variable s will be used in the tranfer functio
Gs = 1/(s*(s+4)) % The open loop tansfer function provided in the qestion
rlocus(Gs) % This command generates the root locus diagram that is displayed.
grid
figure(1)
s =
Gs =
1
---------
s^2 + 4 s
3. BODE PLOT
a)
%Bode plot
s = tf('s') % Declaring variable s will be used in the tranfer function
Gs = (30*(s+0.5))/((s^2)*(s+5)*(s+3)) % The open loop tansfer function provided in the qestion
bode(Gs) % This command generates the Bode Plot diagram that is displayed.
grid
figure(1)
s =
Gs =
30 s + 15
--------------------
s^4 + 8 s^3 + 15 s^2
4. NYQUIST PLOT
a) b=2
%Nyquist Plot
s = tf('s') % Declaring variable s will be used in the tranfer function
Gs = (s+2)/(s*(s+1)^2) % The open loop tansfer function provided in the qestion
nyquist(Gs) % This command generates the Nyquist Plot diagram that is displayed.
grid
figure(1)
s =
Published with MATLAB® R2017a
F17/35020/2013
BRIAN G GACHARI
Gs =
s + 2
---------------
s^3 + 2 s^2 + s
b) b = 6
%Nyquist Plot
s = tf('s') % Declaring variable s will be used in the tranfer function
Gs = (s+6)/(s*(s+1)^2) % The open loop tansfer function provided in the qestion
nyquist(Gs) % This command generates the Nyquist Plot diagram that is displayed.
grid
figure(1)
s =
Gs =
s + 6
---------------
s^3 + 2 s^2 + s
c) b = 9
%Nyquist Plot
s = tf('s') % Declaring variable s will be used in the tranfer function
Gs = (s+9)/(s*(s+1)^2) % The open loop tansfer function provided in the qestion
nyquist(Gs) % This command generates the Nyquist Plot diagram that is displayed.
grid
figure(1)
s =
Gs =
s + 9
---------------
s^3 + 2 s^2 + s