Control Systems Engineering
(Chapter 3. Modeling in the Time Domain)
Prof. Kwang-Chun Ho
Tel: 02-760-4253 Fax:02-760-4435
2
Dept. Electronics and Information Eng.
Introduction
In this lesson, you will learn the following :
How to find a mathematical model, called a
state-space representation, for linear time
invariant(LTI) system
How to convert between transfer function and
state-space models
How to linearize a state-space representation
3
Dept. Electronics and Information Eng.
Introduction
Two approaches are available for the analysis
and design of feedback control systems
The first is known as the classical or frequency-
domain technique
This approach is based on converting a system’s differential
equation to a transfer function
The primary disadvantage of the classical approach is its
limited applicability
It can be applied only linear time-invariant(LTI) systems
But this approach rapidly provides stability and transient
response information
4
Dept. Electronics and Information Eng.
Introduction
Next, the state-space approach (also referred to as
the modern or time-domain approach) is a unified
method for modeling, analyzing and designing a wide
range of systems
We can use the state-space approach both linear and
nonlinear systems
Also it can handle the systems with nonzero initial conditions
5
Dept. Electronics and Information Eng.
Select a particular subset of all possible system
variables
Call the variables in this subset as state variables
For an n
th
-order system, write n simultaneous,
1
st
-order differential equations in terms of the
state variables
Call this system of simultaneous differential equations
as state equations
State-space Representation
6
Dept. Electronics and Information Eng.
Algebraically combine the state variables with
the system’s input and find all other system
variables for
Call this algebraic equation as the output equation
Consider the state equations and the output
equations as a viable representation of the
system
Call this representation of the system as a state-space
representation(state equation + output equation)
State-space Representation
0
tt
7
Dept. Electronics and Information Eng.
RL network
Let us now follow the steps for state-space
representation through an example
Consider RL network shown in figure with an initial
current of i(0)
Select the current as state variable
Write the loop equation
()
() ()
di t
L
Ri t v t
dt

8
Dept. Electronics and Information Eng.
RL network
Take the Laplace transform with including the initial
conditions
Assuming the input, v(t), to be a unit step, u(t), whose Laplace
transform is V(s)=1/s, we solve for I(s) and get
i(t) is a subset of all possible network variables that we can find
if we know its initial condition, i(0), and the input v(t)
[() (0)] () (s)LsIs i RIs V

(/) (/)
1 (0) 1 (0)
()
() /
11 1 (0)
//
1
() 1 (0)
RLt RLt
Li A B Li
Is
s
LsR LsR Ls sRL LsR
i
Rs sRL sRL
it e i e
R














where
/, /
A
LRB LR

9
Dept. Electronics and Information Eng.
RL network
Thus, i(t) is a state variable, and the loop equation is a state
equation
Knowing the state variable, i(t), and the input v(t ), we can find
the value, or state, of any network variable at any time
Thus, the algebraic equations of v
R
(t) and v
L
(t) are the output
equations
Combining the state equation and the output equation is
called the state-space representation
0
tt
() (), () () ()
RL
vt Rit vt vt Rit

() () ()
() ,
() () ()
RL
vt vt vt
it
RR
di t v t Ri t
dt L

(state equation)
(output equation)
10
Dept. Electronics and Information Eng.
RLC network
Let us now extend our observations to a 2
nd
-
order system and find the state-space
representation of this 2
nd
-order system
Since the network is 2
nd
-order, two simultaneous 1
st
-
order differential equation are needed to solve for two
state variables
Select i(t) and q(t)(the charge on the capacitor) as the
two state variables
11
Dept. Electronics and Information Eng.
RLC network
Write the loop equation
Converting the equation in terms of , we get
An n
th
-order differential equation can be converted to n
simultaneous 1
st
-order differential equation of the form
, which is a linear combination of the state variables and
the input,
() 1
() () ()
di t
Ri t i t dt v t
dt C

()
()
dq t
it
dt
2
2
() () 1
() ()
dq t dq t
L
Rqtvt
dt dt C

11 2 2 1
()
() () () ()
i
ii inni
dx t
axt ax t a x t bft
dt

()
f
t
12
Dept. Electronics and Information Eng.
RLC network
Summarizing the two resulting equations, we get
These equations are the state equations
From these two state variables, we can solve for all
other network variables
For example, the voltage across the inductor can be written in
terms of the solved state variables and the input as
This equation is an output equation
The combined state equation and output equation is
called as state-space representation
2
2
()
(),
() () 1 1
() () ()
dq t
it
dt
di t dq t R
qt it vt
dt dt LC L L

1
() () () ()
L
Vt qt Rit vt
C

13
Dept. Electronics and Information Eng.
RLC network
Is there any restriction on the choice of state
variables? YES!
No state variable can be chosen if it can be expressed
as a linear combination of the other state variables
For example, if V
R
(t) is chosen as a state variable, then i(t)
can not be chosen, because V
R
(t) can be written as a linear
combination of i(t), namely
Under these circumstances, we say that the state variables
are linearly independent
State variables must be linearly independent; that is, no state
variable can be written as a linear combination of all the other
state variables
() ()
R
Vt Rit
14
Dept. Electronics and Information Eng.
RLC network
The state and output equations can be written in
vector-matrix form if the system is linear
Thus, the state-space representation of the RLC
network given can be written as
where
,u
y
Du
xAxB Cx
01
0
/
, , , ,
1
1
/
dq dt q
R
di dt i
LC L
L









xxA B
1
(), , 1, ()
L
yVt R D uvt
C




C
(state vector) (system matrix) (input matrix)
(time derivative
of the state vector)
(output vector) (output matrix)
(feedforward
matrix)
15
Dept. Electronics and Information Eng.
RLC network
The first step in representing a system is to
select the state vector, which must be chosen
according the following considerations:
A minimum number of state variables must be
selected as components of the state vector
The components of the state vector (that is, this
minimum number of state variables) must be linearly
independent
How do we know the minimum number of state
variables to select?
Typically, the minimum number required equals to the order
of differential equation describing the system
16
Dept. Electronics and Information Eng.
Applying the State-Space Representation
Example 3.1:
Given the electrical network of figure below, find a
state-space representation if the output is the current
through the resistor
Solution:
Step 1:
Label all of the branch currents in the network.
These include and as shown in the figure
(), ()
LR
itit ()
C
it
17
Dept. Electronics and Information Eng.
Applying the State-Space Representation
Step 2:
Select the state variables by writing the derivative equation for
all energy storage elements, that is, the inductor and capacitor
Thus,
Using these two equations, choose the state variables as the
quantities that are differentiated, namely and
Step 3:
Apply the network theory to obtain and in terms of
the state variables
At Node 1:
Around the outer loop:
Step 4:
Using the equations we wrote in the previous steps, obtain the
following state equations:
()
()
(), ()
C
L
CL
dv t
di t
CitLvt
dt dt

()
C
vt
()
L
it
()
L
vt
()
C
it
()
() () () ()
C
CRL L
vt
it it it it
R
 
() () ()
LC
vt vt vt
18
Dept. Electronics and Information Eng.
Applying the State-Space Representation
Step 5:
Find the output equation. Since the output is ,
The final result for the state–space representation in vector-
matrix form is
()
R
it
1
,()
11 11
,()
C
L
CL C
C
L
CL C
dv
di
CviLvvt
dt R dt
dv
di
vi vvt
dt RC C dt L L
 

1
() ()
Rc
it vt
R
11
0
1
(), 0
1
1
0
CC C
R
LL L
vv v
RC C
vt i
ii i
R
L
L



  




  



  




19
Dept. Electronics and Information Eng.
Converting a Transfer Function to State Space
We will learn how to convert a transfer function
representation to a state-space representation
Let us begin by showing how to represent a general
n
th
-order linear differential equation with constant
coefficients in state-space in the phase variable-form
Phase variable: A set of state variable where each
subsequent state variable is defined to be the derivative of
the previous state variable
We will then show how to apply this representation to
transfer function
General differential equation:
1
1100
1
nn
n
nn
dy d y dy
aaaybu
dt dt dt

20
Dept. Electronics and Information Eng.
Converting a Transfer Function to State Space
A convenient way to choose state variables is to
choose the output, y(t), and its (n-1) derivatives as the
state variables
This choice is called phase-variables choice.
Choosing the state variables, x
i
, we get
Differentiating both sides yields
The state equations are evaluated as
21
12 3
21
,, ,,
n
n
n
d
y
d
y
d
y
xyx x x
dt dt dt

23
12 3
23
,,,,
n
n
n
dy d y d y d y
xx x x
dt dt dt dt


12 23 1 0112 1 0
,,, ,
nnn nn
xx xx x x x axax axbu




21
Dept. Electronics and Information Eng.
The state–space representation in vector-matrix form
is
Converting a Transfer Function to State Space
1
1
2
2
3
3
1 1
012345 1 0
010000 0 0
001000 0 0
000100 0 0
000000 1 0
n n
nn
n
x
x
x
x
x
x
u
xx
aaaaaa a x b
x


  

  

  

  


  

  

  

  

  

  



1
2
3
100 0
n
x
x
yx
x
22
Dept. Electronics and Information Eng.
In summary, to convert a transfer function into state
equations in phase-variable form, we first convert the
transfer function to a differential equation by cross-
multiplying and taking the inverse Laplace transform,
assuming zero initial conditions
Then, we represent the differential equation in state-
space in phase-variable form
An example illustrates the process
Example 3.2:
Find the state-space representation in phase-variable
form for the transfer function shown in the figure
below
Converting a Transfer Function to State Space
23
Dept. Electronics and Information Eng.
Solution:
Step 1:
Find the associated differential equation
Since , cross-multiplying yields
The corresponding differential equation is found by taking the
inverse Laplace transform, assuming zero initial conditions:
Step 2:
Select the state variables
Choosing the state variables as successive derivatives, we get
Converting a Transfer Function to State Space
32
() 24
() 9 26 24
Cs
Rs s s s

32
92624()24()ss s Cs Rs
9262424cc c c r

 
112
22 3
3
3123
1
24 26 9 24
xc x x
xc x x
xc
x
xxxr
ycx









(State variables) (System equations)
(Output equation)
24
Dept. Electronics and Information Eng.
The state–space representation in vector matrix form is
In this point we can create an equivalent block diagram of the
system to visualize the state variables
We draw three integral blocks as shown in figure below and
label each output as one of the state variables
Converting a Transfer Function to State Space

11 1
22 2
33 3
010 0
0 0 1 0 , 1 0 0
24 26 9 24
xx x
xxryx
xx x
 
 

 
 

 
25
Dept. Electronics and Information Eng.
Converting a Transfer Function with polynomial
in numerator
The numerator and denominator can be handled
separately
Converting a Transfer Function to State Space
26
Dept. Electronics and Information Eng.
Example 3.3: Find the state-space representation of
the transfer function shown in Figure
(Solution)
The state–space representation in vector-matrix form is
Converting a Transfer Function to State Space
27
Dept. Electronics and Information Eng.
For the first box,
For the second box,
Converting a Transfer Function to State Space
32
11111
( ) ( 9 26 24) ( ) ( ) ( ) 9 ( )+26 ( ) 24 ( )
R
s s s s Xs rt xt xt xt xt
 
11 1 2
21 2 3
31
3123
11
22
33
24 26 9
010 0
001 0
24 26 9 1
xxxx
xx x x
xx
x
xxxr
xx
xxr
xx
















2
1321
1
2
3
() ( 7 2) () 7 2
271
Cs s s X s y x x x
x
yx
x







28
Dept. Electronics and Information Eng.
(Equivalent block diagram)
Converting a Transfer Function to State Space
29
Dept. Electronics and Information Eng.
Example 3.4:
A missile in flight, as shown in Figure P3.11, is subject
to several forces: thrust, lift, drag, and gravity
The missile flies at an angle of attack, , from its
longitudinal axis, creating lift
For steering, the body angle from vertical, , is
controlled by rotating the engine at the tail
The transfer function relating the body angle, , to the
angular displacement, , of the engine is of the form
Represent the missile steering control in state space
Converting a Transfer Function to State Space
32
3210
()
()
ab
Ks K
s
sKsKsKsK

30
Dept. Electronics and Information Eng.
Converting a Transfer Function to State Space
Thrust is the force which moves an aircraft through the air
Thrust is used to overcome the drag(air resistance) of an airplane,
and to overcome the weight of a rocket
Thrust is generated by the engines of the aircraft
(attack direction)
31
Dept. Electronics and Information Eng.
Solution:
The equivalent cascade transfer function is as shown below
For the first box,
Selecting the phase variables as the state variables:
Writing the state and output equations:
Converting a Transfer Function to State Space
0
21
333 3
()
a
KK
KK
x
xxx t
KKKK

 
1
2
3
x
x
x
x
x
x

12
23
0
12
3123
33 3 3
()
a
xx
xx
KK
KK
x
xxx t
KKKK

3
32
0
21
333
a
K
K
K
KK
sss
KKK

b
a
K
s
K
()sd
()
s
X
()
s
F
32
Dept. Electronics and Information Eng.
For the second box,
In vector-matrix form,
Converting a Transfer Function to State Space
12
()
bb
aa
KK
ytx x xx
KK

11
22
30 3
12
333 3
1
2
3
010 0
001 0(t),
4
10
a
b
a
xx
xx
xK xK
KK
KKK K
x
K
yx
K
x























33
Dept. Electronics and Information Eng.
Given the state and output equations
take the Laplace transform assuming zero initial
conditions:
Solving for yields
where is identity matrix
Substituting the equation into equation
yields
Converting from state space to a Transfer Function
,uy Dux=Ax+B =Cx+
() () (), () () ()
s
ssssss
XAXBU YCXDU
()sX
-1
sss ss s( I A)X( )=BU( ) X( )=( I A) BU( )
I
() () ()
s
ss
YCXDU
-1 -1
-1
s
ssss s
s
ss
s

Y( ) = C( I A) BU( ) + DU( ) = [C( I A) B + D]U( )
Y( )
T( ) = = C( I A) B + D
U( )
1
adj
det
s
s
s
(I-A)
(I-A) =
(I-A)
where
34
Dept. Electronics and Information Eng.
Example 3.5:
Given the system defined by the following equations,
find the transfer function , where is
the input and is the output
Solution:
First find
Converting from state space to a Transfer Function
/
s
ssT( ) = Y( ) U( )
s
U( )
s
Y( )

11 1
22 2
23 3
010 10
0 0 1 0 , 1 0 0
123 0
xx x
xxuyx
xx x
 
 

 
 

 
s(I-A)
00 0 1 0 1 0
()000010 1
00 1 2 3 1 2 3
ss
ss s
ss







IA
35
Dept. Electronics and Information Eng.
Now form
Substituting and into equation, we obtain the
final result transfer function
Converting from state space to a Transfer Function
1
s
(I-A)
2
2
1
32
32 3 1
1(3)
2( 1)
()
s3s2s1
ss s
ss s
sss
s

 








IA
1
,,s
(I-A) BC
D

10
0, 10 0, 0
0
D






BC
Using
36
Dept. Electronics and Information Eng.
Converting from state space to a Transfer Function


1
2
2
32
2
2
32 32
() ( )
32 3 1
1(3)
10
2( 1)
100 0
s3s2s1
0
10( 3 2)
1 10( 3 2)
100 10
s3s2s1 s3s2s1
10
ss D
ss s
ss s
sss
ss
ss
s


 


















 


TCIAB
We have
37
Dept. Electronics and Information Eng.
Laplace Transform Solution of State Equation
Math reference for Inverse Matrix:
Let be an square matrix
Define an matrix by setting
where is the minor formed from A by deleting row j and
column i of A
Adjoint of matrix:
Then,
ij
A
a


nn
nn
ij
Bb

1
1
ij
ij ji
bM
A

ji
M
1
BA

1
ij
ij ji
CM

38
Dept. Electronics and Information Eng.
Laplace Transform Solution of State Equation
Given the state and output equations
Taking the Laplace transform of both sides of the state
equations yields
In order to separate , replace with ,
where is an identity matrix, and n is the order of
the system
Combining all of the terms, we get
,uy Dux=Ax+B =Cx+
() (0) () ()
s
sss
Xx=AX+BU
()
s
X
()
s
sX ()
s
sIX
I
nn
()
s
X
(0)ss s
(I A)X()=x BU()
39
Dept. Electronics and Information Eng.
Laplace Transform Solution of State Equation
Solving for by premultiplying both sides of the last
equation by yields
Taking the Laplace transform of the output equation
yields
1
s
(I A)
()
s
X
1
[0 ]
adj
[0 ]
det
ss s
s
s
s
X( ) = ( I - A) x( ) BU( )
(I-A)
=x()BU()
(I-A)
sssY( ) = CX( ) + DU( )
40
Dept. Electronics and Information Eng.
Eigenvalues and Transfer Function Poles
Example 3.6:
Given the system represented in state space by equations
do the following:
(a) Solve the preceding state equation and obtain the output for
the given input
(b) Find the eigenvalues and the system poles
Solution:
(a)

010 0 1
0 0 1 0 , 1 1 0 , (0) 0
24 26 9 1 2
uyxx xx







2
2
1
32
926 9 1
24 ( 9)
10
24 26 24
()0 1()
s 9s 26s 24
24 26 9
ss s
s
ss
s
s
ss
sss
s
IA IA










()ut
41
Dept. Electronics and Information Eng.
Eigenvalues and Transfer Function Poles
Remember the equation
where
Then, we get
The output is
1
[0 ]ss sX( ) = ( I - A) x( ) BU( )
1/ssU( )

1
212
3
()
110 () () ()
()
Xs
sss XsXsXs
Xs
Y( ) = CX( ) + DU( )






42
Dept. Electronics and Information Eng.
Taking the inverse Laplace transform, we have
(b)
The root of gives us both the poles of system and
the eigenvalues which are -2, -3, -4.
Eigenvalues and Transfer Function Poles
where a pole at -1 canceled a zero at -1

32
12 16 5 6.5 19 11.5
1234 2 3 4
sss
s
ss ss s s s
Y( ) =



23 4
( ) 6.5 19 11.5
tt t
y
tee e


det( ) 0sIA
43
Dept. Electronics and Information Eng.
Control System Design
Example 3.7: Modeling a cruise control system
If the inertia of wheels is neglected, and it is assumed
that friction (which is proportional to the car’s speed)
is what is opposing the motion of the car
Then the problem is reduced to the simple mass and
damper system shown below
Using Newton’s law, the modeling equations for the
system becomes
44
Dept. Electronics and Information Eng.
Control System Design
where is the force from engine. For this example, let’s
assume that
Design requirement
When the engine gives a 500 Newton force, the car should
reach a maximum velocity of 10 m/s in less than 5 seconds
Transfer function
Taking the Laplace transform of modeling equations gives
Since the output is velocity, let’s substitute in terms of
()
() () (), () (), () ()
dv t
ut bvt mat m bvt ut
y
tvt
dt

u
1000k
g
, 50 N/ m, 500 Nmb u

() () (s), () ()msV s bV s U Y s V s

()Vs
()Ys
() () (s)msY s bY s U
Transfer function
(s) 1
()
Y
Us ms b
45
Dept. Electronics and Information Eng.
Control System Design
State Space
Rewriting the 1
st
-order modeling equation as the state-space
model gives
The state-space representation is
Open-loop response
Now let’s see how the open-loop system response to a step
input
1
,
dv b
vu
y
v
dt m m




,u
y
Du
xAxB Cx
 
1
, , , , 1 , 0
dv b
vD
dt m m
xxA BC




46
Dept. Electronics and Information Eng.
Matlab script for transfer function:
Matlab script for state-space:
m = 1000;
b = 50;
u = 500;
num = [1];
den = [m b];
step(u*num,den);
Control System Design
m = 1000;
b = 50;
u = 500;
A = [-b/m];
B = [1/m];
C = [1];
D = 0;
step(A,u*B,C,D);
0 20 40 60 80 100 120 140 160 180
0
1
2
3
4
5
6
7
8
9
10
Step Response
Time (seconds)
47
Dept. Electronics and Information Eng.
Control System Design
From the plot, we can see that the vehicle takes more
than 100 seconds to reach the steady-state speed of
10 m/s
This does not satisfy our criterion of less than 5 seconds
To solve this problem, a unity feedback controller will be able
to improve the system performance
The transfer function in process is the transfer function derived above
The controller will be designed to satisfy the design criterion
To design the controller, may using such methods as PID, Root-Locus,
Frequency Response, or State-Space
Input
Output
(s) 1
()
Y
Us ms b
48
Dept. Electronics and Information Eng.
Control System Design
Closed-loop response using PID controller
Consider the following feedback system
The closed-loop transfer function is:
The output of a PID controller, equal to the control input to the plant,
in the time-domain is as follows:
This error signal (e(t)) will be sent to the PID controller, and the
controller computes
This control signal (u(t)) is sent to the plant, and the new output (y (t)) is
obtained
(Proportional-Integral-Derivative)
(s) ( ) ( )
() 1 () ()
YCsPs
R
sCsPs
Will be discussed in details
at “Chapter 5. Reduction of
Multiple Subsystems” !!
()
() ()()
pi d
de t
Ket K etdut tK
dt

49
Dept. Electronics and Information Eng.
The new output (y(t)) is then fed back and compared to the reference to
find the new error signal (e(t))
The controller takes this new error signal and computes its derivative
and its integral again, at infinitum
The transfer function of a PID controller is found by taking the
Laplace transform
MATLAB's pid controller function:
Characteristics of P, I, and D Controllers:
Control System Design
()
()
i
pd
K
Us
K
Ks
Es s

= Proportional gain, = Integral gain, = Derivative gain
p
K
i
K
d
K
C = pid(Kp,Ki,Kd);
50
Dept. Electronics and Information Eng.
Proportional Control:
From the table shown above, we see that the proportional controller( )
reduces the rise time, increases the overshoot, and reduces the steady-
state error
The closed-loop transfer function of the above system with a
proportional controller is
Control System Design
p
K
m = 1000;
b = 50;
r = 10;
Kp = 1500;
num = [Kp];
den = [m b+Kp];
step(r*num,den);

(s) ( ) ( )
() 1 () ()
1
p
p
p
p
K
K
ms b
YCsPs
K
Rs CsPs
ms b K
ms b








Be used to make the
reference signal 10m/sec
Still exist the steady-state error!
51
Dept. Electronics and Information Eng.
Proportional and Integral Control:
The closed-loop transfer function of the above system with proportional
and integral controllers is
Control System Design
m = 1000;
b = 50;
r = 10;
Kp = 1500;
Ki = 70;
num = [Kp Ki];
den = [m b+Kp Ki];
step(r*num,den);

2
1
(s) ( ) ( )
1
() 1 () ()
1
i
p
pi
i
pi
p
K
K
Ks K
YCsPs
smsb
K
Rs CsPs
ms b K s K
K
smsb















0123456
0
1
2
3
4
5
6
7
8
9
10
Step Response
Time (seconds)
As you can see, this step response
meets the design criteria!
52
Dept. Electronics and Information Eng.
Meiling CHEN
Homework Assignment #3
53
Dept. Electronics and Information Eng.
Meiling CHEN
Homework Assignment #3
54
Dept. Electronics and Information Eng.
Homework Assignment #3