Exercise CP 2
Exercise CP 2
2.10k=[0.01:0.01:10];nu
mG=[1];denG=[1 20
20];G=tf(numG,denG);for
i=1:length(k);numGc=[k];
denGc=[1];Gc=tf(numGc,
denGc);%closed loop with
input
R(s).sys_cl=feedback(Gc*
G,1,-1);%closed loop with
R(s)=0 and
Td(s).sys_Td=feedback(G,
Gc,1);y1=step(sys_cl);Ys1
(i)=y1(end);y2=step(sys_
Td);Ys2(i)=y2(end);endpl
ot(k,Ys1,k,Ys2,':');
%exercise CP 2.5 %Part
(a)t=[0:0.1:100];J=10.8e
+8; %nominal momento
of inertia
[slug.ft^2]k=10.8e+8;
%controller
parameter.a=1;
%controller
parameter.b=8;
%controller
parameter.numGc=k*[1
a]; %controller
numerator.denGc=[1 b];
%controller
denominator.Gc=tf(numG
c,denGc); %controller
transfer function.
numG=[1]; %System
numerator.denG=J*[1 0
0]; %system
denominator.G=tf(numG,
denG); %System transfer
function.%steps to find
the closed loop (find the
resultant transfer function
in%series then find the
closed loop with negative
feedback.sys1=series(Gc,
G);
sys_cl=feedback(sys1,1,-
1);