Experiment 3 State Variable Models
Experiment 3 State Variable Models
Objectives
1. To learn how to convert the transfer function of a system into state variable
representation and vice versa.
2. To learn how to simulate a system expressed in state variable form.
Procedure
Section-1
A feedback control system is shown below
Y(s)/R(s) =
Write the coefficients of the numerator and denominator polynomials N(s) and D(s)
respectively.
N(s) = [ ]
D(s) = [ ]
Write Matlab commands to determine the closed-loop transfer using the numerator
and denominator polynomials.
>>
>>
>>
where, num and den are the numerator and denominator of the closed-loop transfer
function.
printsys(A, B, C, D);
A= B=
C= D=
Verify that the num1 and den1 are the same as num and den used in the first step of
this section.
num1 =
den1 =
Section-2
R = 3; L = 1; C = 0.5;
A = [0 –1/C; 1/L –R/L];
B = [1/C; 0];
C = [0 R];
D = [0];
x0 = [1 1]; % initial conditions.
t = [0:0.01:5]; % time range is 0 to 5 sec with an increment of 0.01 sec.
u = 0*t ; % zero input.
[y, x] = lsim(A, B, C, D, u, t, x0);
lsim function returns two parameters, output matrix y having one column and state
variable matrix x having two columns. Use size(y) and size(x) to see the number of
rows and columns in y and x.
Note: Number of rows in x and a y matrix is equal to the number of data points in
time vector t.
Use following commands to observe the time response of the system defined in
previous step.
subplot(3, 1, 1); % divide the figure window into 3 rows and 1 column.
plot(t, x(:,1)); % plot the 1st state variable, column 1 of matrix x.
xlabel('time'); ylabel('x1');
subplot(3, 1, 2);
plot(t, x(:,2)); % plot the 2nd state variable, column 1 of matrix x.
xlabel('time'); ylabel('x2');
subplot(3, 1, 3);
plot(t, y); % plot the output y
xlabel('time'); ylabel('output (y)');
Sketch the state variables x1, x2 and the output y. Label all the curves appropriately.
Change the system parameters R, L and C to generate four types of time response as
shown in the following table. Also, show the values of R, L and C and position of
poles for each type of response.
Case-1: Overdamped.
Case-2: Underdamped.
Case-4: Oscillatory.
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………