Code covered by the BSD License  

Highlights from
Feedback Control of Dynamic Systems, 4th Ed., G. F. Franklin, J. D. Powell, A. Emami-Naeini

image thumbnail

Feedback Control of Dynamic Systems, 4th Ed., G. F. Franklin, J. D. Powell, A. Emami-Naeini

by

 

25 Apr 2003 (Updated )

.m and .mdl files for Feedback Control of Dynamic Systems

fig3_18.m
%  Figure 3.18      Feedback Control of Dynamic Systems, 4e
%                        Franklin, Powell, Emami
%
%  fig3_18.m      
clf;
einv=1/exp(1);
num=1;
den=[1 1];
t=0:.05:4;
y=impulse(num,den,t);

% define some lines for the plot
tl=[0 1];
yl=[1 0];
t1=[1 1];
y1=[0 einv];
t2=[0 1];
y2=[einv einv];
plot(t,y,'-',tl,yl,'--',t1,y1,':',t2,y2,':')
title('Fig. 3.18(a) First order system response')
xlabel('Time (sec)')
ylabel('h(t)')
grid;
pause;
%%Figure 3.18 (b)
a=1;
num=[a];              % form numerator
den=[1 a];            % form denominator
t=0:0.01:4;           % form time vector
sys=tf(num,den);      % form system
h=impulse(sys,t);     % compute impulse response
plot(t,h);            % plot impulse response
y=step(sys,t);        % compute step response
grid;
hold
plot(t,y);            % plot step response
xlabel('Time (sec)');
ylabel('h(t),y(t)');
title('Fig. 3.18(b) Impulse and step responses');
text(2,0.8,'y');
text(2,0.2,'h');


Contact us