You are on page 1of 8

State-Space Design - Tutorial and

Exercise

Contents
1 State Space

2 System Characteristics from State-Space Representation

3 Solution of the Linear Time Invariant State Equations


3.1 State-Transition Matrix . . . . . . . . . . . . . . . . . . . . . . .

4
4

4 Control System Design in State-Space


4.1 Controllability . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Pole-Placement Design Using Full-State Feedback . . . . . . . . .

5
5
6

5 Exercise 1

6 Exercise 2

7 Exercise 3

State Space

The state of a system as any set of quantities which must be specified at a given
time in order to completely determine the behavior of the system. The quantities
constituting the state are called the state variables, and the hypothetical space
spanned by the state variables is called the state-space.
We can write the state-equations of a general linear system of order n, with
m inputs and p outputs, in the following matrix form:
x(t)

= Ax(t) + Bu(t),

(1)

and the general output equation is


y(t) = Cx(t) + Du(t),

(2)

where x(t) = [x1 (t); x2 (t); ; xn (t)]T is the state vector consisting of n state
variables as its elements, x(t) = [x 1 (t); x 2 (t); ; x n (t)]T is the time derivative
1

of the state vector, u(t) = [u1 (t); u2 (t); ; ur (t)]T is the input vector consisting
of r inputs as its elements, y(t) = [y1 (t); y2 (t); ; yp (t)]T is the output vector
consisting of p outputs as its elements, and A, B, C, D are the coefficient
matrices.
Consider the electrical network shown in Fig. 1 consisting of three resistances, R1 , R2 , and R3 , a capacitor, C, and an inductor, L, connected to a
voltage source, e(t), and a switch, S. When the switch, S, is closed at time





Figure 1: Electrical network

t = 0, the current passing through the resistance R1 is i1 (t), and that passing
through the inductor, L, is i2 (t). The input to the system is the applied voltage,
e(t), and the output is the current, i2 (t). The two governing equations of the
network are
e(t) = R1 i1 (t) + R3 [i1 (t) i2 (t)],
(3)
Z t
1
i2 ( )d.
(4)
0 = R2 i2 (t) + R3 [i2 (t) i1 (t)] + Li 2 (t) +
C 0
Differentiating Eq. (4) and eliminating i1 (t) , we can write
Li2 (t)+[(R1 R3 +R1 R2 +R2 R3 )/(R1 +R3 )]i 2 (t)+(1/C)i2 (t) = [R3 /(R1 +R3 )]e(t).

(5)
We find that the system is linear and of second order, with y(t) = i2 (t), u(t) =
e(t), an put a0 = 1/C, a1 = (R1 R3 + R1 R2 + R2 R3 )/(R1 + R3 ), b0 = 0, and
b1 = R3 /(R1 + R3 ).
For a linear, time-invariant state-space form, the state variables must be
selected in such a way that the time derivative of the input, e(t),

vanishes from
the state and output equations. One possible choice of state variables which
accomplishes this is the following:
x1 (t) = i2 (t),

(6)

x2 (t) = i 2 (t) R3 e(t)/[L(R1 + R3 )].

(7)

Then the first state-equation is obtained by substituting Eq. (6) into Eq. (7),
and expressed as
x 1 (t) = x2 (t) + R3 e(t)/[L(R1 + R3 )].
2

(8)

Substitution of Eqs. (6) and (7) into Eq. (5) yields the second state-equation,
given by
x 2 (t) = [(R1 R3 +R1 R2 +R2 R3 )/[L(R1 +R3 )][x2 (t)+R3 e(t)/L(R1 +R3 )]x1 (t)/(LC).
(9)
The output equation is given by using Eq. (3) as follows:
y1 (t)

= i1 (t) i2 (t)
= [e(t) + R3 x1 (t)]/(R1 + R3 ) x1 (t)
= R1 x1 (t)/(R1 + R3 ) + e(t)/(R1 + R3 ).

(10)

In the matrix notation, Eqs. (8)-(10) are expressed as







x 1 (t)
0
1
x1 (t)
=
x 2 (t)
1/(LC) [(R1 R3 + R1 R2 + R2 R3 )/[L(R1 + R3 )] x2 (t)
+


R3 /[L(R1 + R3 )]
e(t).
R3 [(R1 R3 + R1 R2 + R2 R3 )/[L(R1 + R3 )]2
(11)


y1 (t) = R1 /(R1 + R3 )



 x1 (t)
0
+ 1/(R1 + R3 )e(t).
x2 (t)

(12)

Comparing with Eqs. (1) and (2), we can find the constant coefficient matrices,
A, B, C, D, of the system, with the input vector, u(t) = e(t), and the output
vector, y(t) = y( t).

System Characteristics from State-Space Representation

Recall that the transfer matrix is obtained by taking the Laplace transform
of the governing differential equations, for zero initial conditions. Taking the
Laplace transform of both sides of the matrix state-equation, Eq. (1), assuming
zero initial conditions (i.e. x(0) = 0) yields the following result:
sX(s) = AX(s) + BU(s),

(13)

where X(s) = L[x(t)], U(s) = L[u(t)]. Rearranging Eq. (13), we can write
(sI A)X(s) = BU(s),

(14)

X(s) = (sI A)1 BU(s).

(15)

Similarly, taking the Laplace transform of the output equation, Eq. (2), with
Y(s) = L[y(t)], yields
Y(s) = CX(s) + DU(s).
(16)
Substituting Eq. (15) into Eq. (16) we get
Y(s) = C(sI A)1 BU(s) + DU(s) = [C(sI A)1 B + D]U(s).
3

(17)

From Eq. (17), it is clear that the transfer matrix, G(s), defined by Y(s) =
G(s)U(s) is the following:
G(s) = C(sI A)1 B + D.

(18)

Equation (18) tells us that the transfer matrix is a sum of the rational matrix
(i.e. a matrix whose elements are ratios of polynomials in s), C(sIA)1 B, and
the matrix D. Thus, D represents a direct connection between the input, U(s),
and the output, Y(s), and is called the direct transmission matrix. Systems
having D = 0 are called strictly proper.

Solution of the Linear Time Invariant State


Equations

Before we can begin designing a control system based on the state-space approach, we must be able to solve the state-equations. To see how the stateequations are solved, let us consider the following single first order differential
equation:
x(t)

= ax(t) + bu(t),
(19)
where x(t) is the state variable, u(t) is the input, and a and b are the constant
coefficients. Equation (19) represents a first order system. Let us try to solve
this equation for t > t0 with the initial condition, x(t0 ) = x0 .
To find the response of a general system of order n, we should have a solution
for each of the n state-equations in a form similar to Eq. (20).
x(t) = e

a(tt0 )

x0 +

ea(t bu( )d ; t t0 .

(20)

t0

However, since the state-equations are usually coupled, their solutions cannot be obtained individually, but simultaneously as a vector solution, x(t), to
the following matrix state-equation:
x(t)

= Ax(t) + Bu(t).
We can write the solution state-vector as follows:
Z t
A(tt0 )
eA(t ) Bu( )d ; t t0 .
x(t) = e
x(t0 ) +

(21)

(22)

t0

3.1

State-Transition Matrix

If we can calculate the state-transition matrix, eA(tt0 ) when the state-dynamics


matrix, A, and the times, t0 and t t0 , are specified, our task of solving the
linear state equations will simply consist of plugging eA(tt0 ) into Eq. (22) and
getting the solution x(t), provided we know the initial state-vector, x(t0 ), and
the input vector, u(t), for t t0 .
4

To solve the general state-equations, Eq. (21), let us first consider the case
when the input vector, u(t), is always zero. Then Eq. (21) becomes a homogeneous matrix state-equation given by
x(t)

= Ax(t),

(23)

x(t) = eA(tt0 ) x(t0 ).

(24)

giving
A general method of calculating the state transition matrix is the Laplace transform method, in which the Laplace transform is taken of the homogeneous stateequation, Eq. (23) subject to the initial condition, x(0) = x0 as follows:
sX(s) x(0) = Ax(s),

(25)

where X(s) = L[x(t)].


Collecting the terms involving X(s) to the left-hand side of Eq. (25), then
taking the inverse Laplace transform and we get the state-vector, x(t), as
x(t) = L1 [(sI A)1 ]x0 .

(26)

Comparing Eq. (27) with Eq. (24), we obtain the following expression for the
state transition matrix:
eAt = L1 [(sI A)1 ].

(27)

Control System Design in State-Space

A control system engineer designs a control system to meet the desired objectives. We need a control system because we do not like the way a plant behaves,
and by designing a control system we try to modify the behavior of the plant
to suit our needs. Design refers to the process of changing a control systems
parameters to meet the specified stability, performance, and robustness objectives. The design parameters can be the unknown constants in a controllers
transfer function, or its state-space representation.

4.1

Controllability

Controllability can be defined as the property of a system when it is possible to


take the system from any initial state, x(t0 ), to any final state, x(t), in a finite
time, (tf t0 ), by means of the input vector, u(t), t0 < t < tf .
A linear, time-invariant system described by the matrix state-equation, x(t)

=
Ax(t) + Bu(t) is controllable if and only if the controllability test matrix
P = [B; AB; A2 B; ; An1 B]

(28)

is of rank n, the order of the system. The rank of a matrix, P, is defined as the
dimension of the largest non-zero determinant formed out of the matrix.
5

4.2

Pole-Placement Design Using Full-State Feedback

It may be required to change a plants characteristics by using a closed-loop


control system, in which a controller is designed to place the closed-loop poles at
desired locations. Such a design technique is called the pole-placement approach.
Consequently, the control-law of reduces to
u(t) = Kx(t)

(29)

and the schematic diagram of the regulator is shown in Fig. 2. We then get the

2:

Figure
Schematic diagram of a full-state feedback regulator (i.e. control
system with a zero desired state-vector).
closed-loop state and output equations of the regulator as follows:
x(t)

= (A BK)x(t)

(30)

y(t) = (C DK)x(t)

(31)

Equations. (30) and (31) indicate that the regulator is a homogeneous system,
described by the closed-loop state coefficient matrices ACL = A BK, BCL =
0, CCL = C DK, and DCL = 0. The closed-loop poles are the eigenvalues
of ACL . Hence, by selecting the controller gain matrix, K, we can place the
closed-loop poles at desired locations. Note the eigenvalues are the solutions
of |I A| = 0.

Exercise 1

Consider the electrical network derived, Fig. 1, and let R1 = 10, R2 = 25,
R3 = 10, L = 1H, C = 106 F.
1. Show that the state-space representation is




0
1
0.5
A=
;
B
=
; C = [0.5 0]; D = 0.05.
106 30
15

(32)

2. Calculate the transfer function for this system. Verify using the following
Matlab code.
A=[0 1;-1e6 -30]; B=[0.5; -15]; C=[-0.5 0] ; D=0.05;
6

sys1=ss(A,B,C,D);
tfun=tf(sys1)
giving the transfer function:
0.05s2 + 1.25s + 5 104
s2 + 30s + 106
3. Repeat the test using (i) B=[-15; 0.5], (ii) C=[0 -0.5]. Explain for
each case the cause of difference in the transfer function from the original
setting.
4. Run Matlab simulation using command step(sys1); grid on; for the
original and settings (i) and (ii). Observe the system responses, in both
transient and steady state, and discuss the cause of difference.

Exercise 2
1. Consider the single-input, single-output feedback control system with controller transfer function, H(s), and plant transfer function, G(s). the



Figure
3: A single-input, single-output feedback control system.


controller, H(s), and plant, G(s), are as follows:


H(s) =

K(s 2)
3
; G(s) =
(s + 1)
s2

(33)

Show that the closed-loop transfer function is


G(s)H(s)
3K
Y (s)
=
=
Yd (s)
1 + G(s)H(s)
s + 3K + 1
2. Assume that the state space matrices are given by


 

2 3K 9
3K
A=
; B=
; C= 1
K
1
K


0 ; D=0

(34)

(35)

Use T F = C(sI A)1 B to verity the same transfer function can be


obtained by the given system matrices.


3. Form the controllability matrix P = B AB .
4. Determine and comment the controllability of the close-loop system.
7

Exercise 3

Design a full-state feedback regulator for the following plant, as shown in Fig.
2, such that the closed-loop poles are s = 0.5 j using u(t) = Kx(t):


 
1 0
1
A=
; B=
(36)
0 2
1
1. Show the poles of the system are s = 1 and s = 2. Comment on the
system stability.
2. Show that the closed-loop state-dynamics matrix, ACL = A BK, is


1 K1 K2
ACL =
(37)
K1
K2 2
3. Derive an expression for the eigenvalues of ACL and determine the system
stability.
4. Show that if K1 = K2 = 13/12, then the poles can be placed to the desired
location.
5. Use the Matlab command to simulate the response or the original system
to a unit step input:
A=[1 0; 0 -2]; B=[1; -1]; C=[1 0]; D=0;
[num,den]=ss2tf(A,B,C,D);
step(num,den,10); grid on;
6. Repeat the simulation using the gain K obtained from pole-placement
design.
K=[1 1]*13/12; Aeq=A-B*K;
[num,den]=ss2tf(Aeq,B,C,D);
step(num,den,10); grid on;
7. Comment on the effect of pole-placement design on the system stability.
Perform Exercises 1-3. Put you answers in the Answer Sheet and submit
to Moodle on/before Week 14, Sat, 23:59pm.

You might also like