aa
202 Chapter 5 / Transient and Steady-State Response Analyses
EXAMPLE 5–7 Consider the system
Using MATLAB, obtain the response curves y(t)when the input uis given by
- u=unit-step input
- u=e–t
Assume that the initial state is x(0)= 0.
A possible MATLAB program to produce the responses of this system to the unit-step input
Cu=1(t)Dand the exponential input Cu=e–tDis shown in MATLAB Program 5–13. The result-
ing response curves are shown in Figures 5–29(a) and (b), respectively.
y =[1 0]B
x 1
x 2
R
B
x# 1
x# 2
R= B
- 1
- 1
0.5
0
RB
x 1
x 2
R + B
0
1
Ru
MATLAB Program 5–13
t = 0:0.1:12;
A = [-1 0.5;-1 0];
B = [0;1];
C = [1 0];
D = [0];
% For the unit-step input u = 1(t), use the command "y = step(A,B,C,D,1,t)".
y = step(A,B,C,D,1,t);
plot(t,y)
grid
title('Unit-Step Response')
xlabel('t Sec')
ylabel('Output')
% For the response to exponential input u = exp(-t), use the command
% "z = lsim(A,B,C,D,u,t)".
u = exp(-t);
z = lsim(A,B,C,D,u,t);
plot(t,u,'-',t,z,'o')
grid
title('Response to Exponential Input u = exp(-t)')
xlabel('t Sec')
ylabel('Exponential Input and System Output')
text(2.3,0.49,'Exponential input')
text(6.4,0.28,'Output')
Openmirrors.com