You are on page 1of 42

EEE 3153-Control System

Lecture-on State Space Modeling & Analysis

Dr. Tushar Kanti Roy


Associate Professor
Rajshahi University of Engineering & Technology, Rajshahi-6204, Bangladesh
email: tkroy@ete.ruet.ac.bd
URL :https://www.ete.ruet.ac.bd/roykanti03

1
Introduction
• A modern complex system may have many inputs and
many outputs, and these may be interrelated in a
complicated manner.
• To analyze such a system, it is essential to reduce the
complexity of the mathematical expressions, and to
resort to computers for most of the tedious
computations necessary in the analysis.
• To overcome the aforesaid complexities, the state-space
approach is one of the best suited methods to analyze a
system.
State-Space Analysis
State-space analysis is a modern method to analyze control
systems, just like the transfer function approach. However, it has
several advantages over the transfer function approach, which
are given below:
• It is applicable for both linear time invariant and nonlinear
time variant systems.
• It takes the initial value into account.
• It is easy to analyze MIMO systems.
• Controllability and observability can be determined.
State-Space Analysis
The state and output equations can be expressed as follows:
x(t )  Ax(t )  Bu(t )
y(t )  Cx(t )  Du(t )
where 𝑥(𝑡) and 𝑥(𝑡) are state vector and differential state vector,
respectively, 𝑢(𝑡) and 𝑦(𝑡) are input vector and output vector,
respectively, A is the system matrix, B is the input matrix, C is the
output matrix, and D is the feed-forward matrix.

B C

A
Definitions
• State of a system: We define the state of a system at time t0 as the
amount of information that must be provided at time t0, which, together
with the input signal u(t) for t  t0, uniquely determine the output of the
system for all t  t0. (It is a group of variables which summarizes the
history of the system to predict the future values (outputs) )

• State Variable: The state variables of a dynamic system are the smallest
set of variables that determine the state of the dynamic system.
Example: Current flowing through the inductor, voltage across the
capacitor.

• State Vector: If n variables are needed to completely describe the


behavior of the dynamic system then n variables can be considered as n
components of a vector x, such a vector is called state vector.

• State Space: The state space is defined as the n-dimensional space in


which the components of the state vector represents its coordinate axes.
Example-1
Consider the following series RLC circuit in which the input voltage is 𝑣𝑖 (𝑡) and
current flowing through the circuit is i(t).

From the circuit, it can be seen that there are two storage elements. So, the number of state
variables is equal to two and these state variables are the current flowing through the
inductor i(t) and the voltage across the capacitor, 𝑣𝑐 (𝑡). From the circuit, it can also be seen
that the output voltage is equal to the voltage across the capacitor. So,
𝑣𝑜 (𝑡) = 𝑣𝑐 (𝑡)
Now, by applying KVL, we can write
𝑑𝑖(𝑡)
𝑣𝑖 (𝑡) = 𝑅𝑖 𝑡 + 𝐿 + 𝑣𝑐 (𝑡)
𝑑𝑡
which can be rewritten as follows:
𝑑𝑖 𝑡 1
= ,𝑣𝑖 𝑡 − 𝑅𝑖 𝑡 − 𝑣𝑐 (𝑡)-
𝑑𝑡 𝐿
1
The voltage across the capacitor is 𝑣𝑐 (𝑡) = 𝑐 𝑖 𝑡 𝑑𝑡.
Example-1
1
The voltage across the capacitor is 𝑣𝑐 (𝑡) = 𝑐 𝑖 𝑡 𝑑𝑡.
After differentiating above equation, it can be written as
𝑑𝑣𝑐 (𝑡) 1
= 𝑖(𝑡)
𝑑𝑡 𝑐
𝑑𝑖(𝑡)
𝑖(𝑡) 𝑑𝑡
State vector, 𝑋 = and Differential state vector, 𝑋 = .
𝑣𝑐 (𝑡) 𝑑𝑣𝑐 (𝑡)
𝑑𝑡
Therefore,
𝑑𝑖(𝑡)
𝑑𝑡 −𝑅/𝐿 −1/𝐿 𝑖(𝑡) 1/𝐿
𝑋= = + ,𝑣𝑖 (𝑡)-
𝑑𝑣𝑐 (𝑡) 1/𝑐 0 𝑣𝑐 (𝑡) 0
𝑑𝑡
𝑖(𝑡)
𝑦 = ,0 1-
𝑣𝑐 (𝑡)

−𝑅/𝐿 −1/𝐿 1/𝐿


where A = , B= , and C = ,0 1-
1/𝑐 0 0
State Space Equations
𝑥1 𝑢1 𝑦1
𝑥2 𝑢2 𝑦2
𝒙 𝑡 = ⋮ 𝒖 𝑡 = ⋮ 𝒚 𝑡 = ⋮
𝑥𝑛 𝑢𝑟 𝑦𝑚
State-Space Model from a Transfer Function
Consider the following two cases:
 Transfer function having constant terms in Numerator and
 Transfer function having polynomial function of ‘s’ in Numerator.

 Transfer function having constant terms in Numerator


Consider the following transfer function of a system
𝑌(𝑠) 𝑏0
=
𝑈(𝑠) 𝑠 𝑛 +𝑎𝑛−1 𝑠 𝑛−1 +⋯+𝑎1 𝑠+𝑎0
Above equation can be rewritten as follows:
,𝑠 𝑛 +𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎1 𝑠 + 𝑎0 -𝑌(𝑠) = 𝑏0 𝑈(𝑠)
Apply inverse Laplace transform on both sides, we can write
𝑑 𝑛 𝑦(𝑡) 𝑑 𝑛−1 𝑦(𝑡) 𝑑𝑦 𝑡
+ 𝑎𝑛−1 + ⋯ + 𝑎1 + 𝑎0 𝑦 𝑡 = 𝑏0 𝑢(𝑡) (A)
𝑑𝑡 𝑛 𝑑𝑡 𝑛−1 𝑑𝑡

Note: 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.
State Space Model from a Transfer Function
Now, let consider the following condition
𝑦 𝑡 = 𝑥1

𝑑𝑦(𝑡)
= 𝑥1 = 𝑥2
𝑑𝑡

𝑑 2 𝑦(𝑡)
= 𝑥2 = 𝑥3
𝑑𝑡 2

𝑑 𝑛−1 𝑦(𝑡)
= 𝑥𝑛−1 = 𝑥𝑛
𝑑𝑡 𝑛−1

𝑑 𝑛 𝑦(𝑡)
= 𝑥𝑛
𝑑𝑡 𝑛
Then from equation (A), it can be written as:
𝑥𝑛 + 𝑎𝑛−1 𝑥𝑛 + ⋯ 𝑎1 𝑥2 + 𝑎0 𝑥1 = 𝑏0 𝑢
It can be rewritten as:
𝑥𝑛 = −𝑎0 𝑥1 − 𝑎1 𝑥2 ⋯ − 𝑎𝑛−1 𝑥𝑛 + 𝑏0 𝑢

The output equation is 𝑦 𝑡 = 𝑦 = 𝑥1


State Space Model from a Transfer Function
Example-2
Find the state-space model of a system which having the following transfer function
𝑌(𝑠) 1
=
𝑈(𝑠) 𝑠 2 + 𝑠 + 1
Solution:
𝑌(𝑠) 1
= 2
𝑈(𝑠) 𝑠 + 𝑠 + 1
Above equation can be rewritten as follows:

𝑠 2 + 𝑠 + 1 𝑌 𝑠 = 𝑈(𝑠)
Apply inverse Laplace transform on both sides
𝑑 2 𝑦(𝑡) 𝑑𝑦(𝑡)
+ + 𝑦 𝑡 = 𝑢(𝑡) (1)
𝑑𝑡 2 𝑑𝑡
Now, let consider the following conditions
𝑦 𝑡 = 𝑥1
𝑑𝑦(𝑡)
= 𝑥1 = 𝑥2
𝑑𝑡
𝑑 2 𝑦(𝑡)
2
= 𝑥2
𝑑𝑡
Then from equation (1), it can be written as: 𝑥2 = −𝑥1 − 𝑥2 + 𝑢
Example-2
The output equation is 𝑦 𝑡 = 𝑦 = 𝑥1

Now, the state-space model can be expressed as follows:

𝑥1 0 1 𝑥1 0
𝑋= = 𝑥 + ,𝑢-
𝑥2 −1 −1 2 1
𝑥1
𝑌= 1 0 𝑥
2
Example-3a: Transfer function having polynomial function of ‘s’ in Numerator
 Find the state-space representation for the following transfer function
𝑌(𝑠) 𝑠+2
=
𝑈(𝑠) 𝑠 3 + 3𝑠 2 + 2𝑠 + 10
Solution: Let consider,
𝑋1 (𝑠) 𝑌(𝑠) 𝑠+2
× = 3
𝑈(𝑠) 𝑋1 (𝑠) 𝑠 + 3𝑠 2 + 2𝑠 + 10
Now consider,
𝑋1 (𝑠) 1
=
𝑈(𝑠) 𝑠 3 + 3𝑠 2 + 2𝑠 + 10
which can be written as follows:
(𝑠 3 +3𝑠 2 + 2𝑠 + 10)𝑋1 𝑠 = 𝑈(𝑠)
Taking inverse Laplace transform, it will yield
𝑋1 𝑡 + 3𝑋1 𝑡 + 2𝑋1 𝑡 + 10𝑋1 𝑡 = 𝑢(𝑡)
Select the state variables as:
𝑋1 𝑡 = 𝑥2 (𝑡) (a)
𝑋1 𝑡 = 𝑥2 𝑡 = 𝑥3 (𝑡) (b)
𝑋1 𝑡 = 𝑥2 𝑡 = 𝑥3 𝑡 = 𝑢 𝑡 − 3𝑥3 𝑡 − 2𝑥2 𝑡 − 10𝑥1 (𝑡) (c)
Example-3a: Transfer function having polynomial function of ‘s’ in Numerator
 Find the state-space representation for the following transfer function
𝑌(𝑠) 𝑠+2
=
𝑈(𝑠) 𝑠 3 + 3𝑠 2 + 2𝑠 + 10
Solution: Let consider,
𝑋1 (𝑠) 𝑌(𝑠) 𝑠+2
× = 3
𝑈(𝑠) 𝑋1 (𝑠) 𝑠 + 3𝑠 2 + 2𝑠 + 10
Now consider,
𝑋1 (𝑠) 1
=
𝑈(𝑠) 𝑠 3 + 3𝑠 2 + 2𝑠 + 10
which can be written as follows:
(𝑠 3 +3𝑠 2 + 2𝑠 + 10)𝑋1 𝑠 = 𝑈(𝑠)
Taking inverse Laplace transform, it will yield
𝑋1 𝑡 + 3𝑋1 𝑡 + 2𝑋1 𝑡 + 10𝑋1 𝑡 = 𝑢(𝑡)
Select the state variables as:
𝑦(𝑡) = 𝑥1 (𝑡) (a)
𝑦(𝑡) = 𝑥2 (𝑡) (b)
𝑦 𝑡 = 𝑥3 (𝑡) (c)
Example-3a: Transfer function having polynomial function of ‘s’ in Numerator
Differentiating of equations (a)-(c), it will yield
𝑥1 𝑡 = 𝑦(𝑡) = 𝑥2 (𝑡) (d)
𝑥2 𝑡 = 𝑦 𝑡 = 𝑥3 (𝑡) (e)
𝑥3 𝑡 = 𝑦 𝑡 = 𝑢 𝑡 − 3𝑥3 𝑡 − 2𝑥2 𝑡 − 10𝑥1 (𝑡) (f)
Again,
𝑌(𝑠)
=𝑠+2
𝑋1 (𝑠)
which can be written as follows:
𝑌(𝑠) = (𝑠 + 2)𝑋1 𝑠
Taking inverse Laplace transform, it will yield
𝑦 𝑡 = 𝑋1 𝑡 + 2𝑋1 𝑡 = 𝑥2 (𝑡) + 2𝑥1 𝑡
The state-space model is
𝑥1 0 1 0 𝑥1 0
𝑥2 = 0 0 1 𝑥2 + 0 ,𝑢(𝑡)-
𝑥3 −10 −2 −3 𝑥3 1
𝑥1
𝑌 = 2 1 0 𝑥2
𝑥3

𝒀(𝒔) 𝒔𝟐 +𝟖𝒔+𝟓
Home work: Find A, B, C for =
𝑼(𝒔) 𝒔𝟑 +𝟏𝟎𝒔𝟐 +𝟐𝟎𝒔+𝟑𝟎
Example-3a: Transfer function having polynomial function of ‘s’ in Numerator
Again,
𝑌(𝑠)
=𝑠+2
𝑋1 (𝑠)

which can be written as follows:


𝑌(𝑠) = (𝑠 + 2)𝑋1 𝑠
Taking inverse Laplace transform, it will yield
𝑦 𝑡 = 𝑋1 𝑡 + 2𝑥1 𝑡 = 𝑥2 (𝑡) + 2𝑥1 𝑡

The state-space model is


𝑥1 0 1 0 𝑥1 0
𝑥2 = 0 0 1 𝑥2 + 0 ,𝑢(𝑡)-
𝑥3 −10 −2−3 𝑥3 1
𝑥1
𝑌 = 2 1 0 𝑥2
𝑥3
Example-3b: Transfer function having polynomial function of ‘s’ in Numerator
 Find the state-space representation for the following transfer function
𝑌(𝑠) 10(𝑠 + 1)
=
𝑈(𝑠) 𝑠(𝑠 + 2)(𝑠 + 3)
Solution: Let consider,
10(𝑠 + 1) 𝐴 𝐵 𝐶
= + +
𝑠(𝑠 + 2)(𝑠 + 3) 𝑠 𝑠 + 2 𝑠 + 3
After doing the mathematical manipulation, we got
𝐴 = 5/3, 𝐵 = 5, and 𝐶 =− −20/3

𝑌(𝑠) 5 5 20
Then = + −
𝑈(𝑠) 3𝑠 𝑠+2 3(𝑠+3)
Example-3b
From the figure, we can write
1
𝑈 𝑠 × = 𝑋1 𝑠 , ⇒ 𝑠𝑋1 𝑠 = 𝑈(𝑠)
𝑠
After taking inverse Laplace transform, we can write
𝑥1 (𝑡) = 𝑢(𝑡)
Again,
1
𝑈 𝑠 × = 𝑋2 𝑠 , ⇒ 𝑠 + 2 𝑋2 𝑠 = 𝑈(𝑠)
𝑠+2
𝑥2 𝑡 = −2𝑥2 𝑡 + 𝑢(𝑡)
Similarly,

𝑥3 𝑡 = −3𝑥2 𝑡 + 𝑢(𝑡)
The output equation is
5 20
𝑦 𝑡 = 𝑥1 + 5𝑥2 − 𝑥3
3 3
The state-space model is
𝑥1 0 0 0 𝑥1 1
𝑥2 = 0 −2 0 𝑥2 + 1 ,𝑢(𝑡)-
𝑥3 0 0 −3 𝑥3 1
𝑥1
𝑌 = 5/3 5 −20/3 𝑥2
𝑥3
Example-4
Example-4
Example-4
Relationship between Transfer Functions and State Equations
We know, the state-space model is
𝑥 = 𝐴𝑥 + 𝐵𝑢
𝑦 = 𝐶𝑥 + 𝐷𝑢
By taking Laplace transform, first equation can be written as:
𝑠𝑋 𝑠 = 𝐴𝑋 𝑠 + 𝐵𝑈 𝑠 ⇒ 𝑋 𝑠 = 𝑠𝐼 − 𝐴 −1 𝐵𝑈(𝑠) (1)
Again,
𝑌 𝑠 = 𝐶𝑋 𝑠 + 𝐷𝑈(𝑠) (2)

Using equation (1), equation (2) can be rewritten as:


𝑌 𝑠 = ,𝐶 𝑠𝐼 − 𝐴 −1 𝐵 + 𝐷-𝑈(𝑠)

Then, the transfer function is


𝒀(𝒔) −𝟏 𝑩
= 𝑪 𝒔𝑰 − 𝑨 +𝑫
𝑼(𝒔)
Example-5
Find the transfer function for the following state-space model:
𝑥1 −1 −1 𝑥1 1
𝑋= = + ,𝑢-
𝑥2 1 0 𝑥2 0
𝑥1
𝑌= 0 1 𝑥
2
−1 −1 1
Here, A = ,B= , C = 0 1 , and D = 0
1 0 0

Therefore, the transfer function formula can written as


𝑌(𝑠)
= 𝐶 𝑠𝐼 − 𝐴 −1 𝐵
𝑈(𝑠)
𝑠 + 1 1 −1 1
= 0 1
−1 𝑠 0

𝑠 −1
𝑌(𝑠) 1 𝑠+1 1 1
= 0 1 = 2
𝑈(𝑠) 𝑠 + 1 𝑠 − 1(−1) 0 𝑠 +𝑠+1
Example-6
Example-6
Example-6
Example-6
State matrix and solution of the LTI state equation
State transition matrix: The state-transition matrix is a matrix whose
product with the state vector x at the time t0 gives x at a time t, where t0
denotes the initial time. It is used to obtain the general solution of linear
dynamical systems.

Because the state-transition matrix satisfies the homogeneous state equation, it


represents the free response of the system. In other words, it governs the
response that is excited by the initial conditions only. As the name implies, the
state-transition matrix ϕ (t) completely defines the transition of the states from
the initial time t = 0 to any time t when the inputs are zero.

For a time-invariant system, the state equation is given by


.
𝑥 𝑡 = 𝐴𝑥 𝑡 + 𝐵𝑢(𝑡)
The solution of this equation can be classified into two groups:
 Homogeneous state equation when 𝑢 𝑡 = 0 and
 Non-homogeneous state equation when 𝑢 𝑡 ≠ 0
Solution of Homogeneous State Equation
For homogeneous case, the state equation can be written as follows:
𝑑𝑥 𝑡
𝑥 𝑡 = 𝑑𝑡 = 𝐴𝑥(𝑡) (1)
If 𝜑 𝑡 is the transition matrix, then it must satisfy the following condition
𝑑𝜑 𝑡
𝑑𝑡
= 𝐴𝜑(𝑡) (2)

Again, if x(0) is the initial value of x(t) and 𝜑(𝑡) is the state transition matrix then definitely
it will satisfy the following equation:
𝑥 𝑡 = 𝜑 𝑡 𝑥(0) (3)

Taking Laplace transform of equation (1), it will yield


𝑠𝑋 𝑠 = 𝐴𝑋 𝑠 + 𝑥(0)
=> 𝑋 𝑠 𝑆𝐼 − 𝐴𝑋 = 𝑥(0)
=> 𝑋 𝑡 = ,𝑆𝐼 − 𝐴-−1 𝑥(0)

Now, taking inverse Laplace transform, it will yield


𝑥 𝑡 = 𝐿−1 𝑆𝐼 − 𝐴 −1 𝑥 0 = 𝑒 𝐴𝑡 𝑥(0) (4)

Comparing equations (3) and (4), the state transition matrix can be expressed as follows:
𝜑 𝑡 = 𝐿−1 * 𝑆𝐼 − 𝐴 +−1 = 𝑒 𝐴𝑡 (5)
Solution of Homogeneous State Equation
From equation (5), it can be seen that the state-transition matrix is dependent only upon
the matrix A and, therefore, is sometimes referred to as the state-transition matrix of A.

Properties of the state transition matrix


1. φ 0 = eA×0 = I
2. φ nt = eA×nt = (eAt )n = ,φ(t)-n

3. φ −t = e−At = (eAt )−1 = (φ(t))−1 (It means that the state-transition process
can be considered as bilateral in time. That is, the transition in time can take place in
either direction.)
4. φ t1 + t 2 = eA(t1 +t2 ) = eAt1 eAt2 = φ t1 φ t 2
Solution of Non-Homogeneous State Equation
Solution of Non-Homogeneous State Equation
Example-8
Example-8
State-space modeling from differential equations
 State-space representation of nth-order system for linear differential equations
Consider the following nth-order system:
𝑦 𝑛 + 𝑎1 𝑦 𝑛−1 + ⋯ + 𝑎𝑛−1 𝑦 + 𝑎𝑛 𝑦 = 𝑢 𝑡
where 𝑦(𝑡) is the output , 𝑢 𝑡 is the input of the system. Since the system is nth-order, then
it has n-integrators (state variables). Now, let us define n-state variable as follows:
𝑥1 = 𝑦
𝑥2 = 𝑦

𝑥𝑛 = 𝑦 𝑛−1
The output equation is 𝑦 𝑡 = 𝑥1 , then it can be written as
𝑥1 = 𝑥2
𝑥2 = 𝑥3

𝑥𝑛−1 = 𝑥𝑛
𝑥𝑛 = −𝑎𝑛 𝑥1 − ⋯ − 𝑎1 𝑥𝑛 + 𝑢
Above equations can be expressed as follows:
Example-2
• Consider the mechanical system shown in figure. We assume that
the system is linear. The external force u(t) is the input to the
system, and the displacement y(t) of the mass is the output. The
displacement y(t) is measured from the equilibrium position in the
absence of the external force. This system is a single-input, single-
output system.

• From the diagram, the system equation is

𝑚𝑦(𝑡) + 𝑏𝑦(𝑡) + 𝑘𝑦(𝑡) = 𝑢(𝑡)

• This system is a second order. This means that


the system involves two integrators. Let us
define state variables 𝑥1 (𝑡) and 𝑥2 (𝑡) as

𝑥1 𝑡 = 𝑦(𝑡)
𝑥2 𝑡 = 𝑦(𝑡)
Example-2

𝑥1 𝑡 = 𝑦(𝑡) 𝑥2 𝑡 = 𝑦(𝑡) 𝑚𝑦(𝑡) + 𝑏𝑦(𝑡) + 𝑘𝑦(𝑡) = 𝑢(𝑡)

• Then we obtain
𝑥1 𝑡 = 𝑥2 (𝑡)
𝑏 𝑘 1
𝑥2 𝑡 = − 𝑦 𝑡 − 𝑦 𝑡 + 𝑢 (𝑡)
𝑚 𝑚 𝑚
• Or
𝑥1 𝑡 = 𝑥2 (𝑡)
𝑏 𝑘 1
𝑥2 𝑡 = − 𝑥2 𝑡 − 𝑥1 𝑡 + 𝑢 (𝑡)
𝑚 𝑚 𝑚
• The output equation is
𝑦 𝑡 = 𝑥1 𝑡
Example-2
𝑏 𝑘 1
𝑥1 𝑡 = 𝑥2 (𝑡) 𝑥2 𝑡 = − 𝑥2 𝑡 − 𝑥1 𝑡 + 𝑢 (𝑡) 𝑦 𝑡 = 𝑥1 𝑡
𝑚 𝑚 𝑚

• In a vector-matrix form,

 x1 (t )   0 1   x (t )   0 
 x (t )   k b   1    1 u (t )
   x2 (t )  
 2   m m m

 x1 (t ) 
y (t )  1 0 
 2
x (t ) 
Example-3
• State space representation of an armature Controlled DC Motor.
Ra La
B 
ia
ea eb T J

• ea is armature voltage (i.e. input) and  is output.

dia
ea  Ra ia  La  eb
dt
T  J  B
Example-3
T  K t ia eb  K b

J  B-K t ia  0
dia
La  Ra ia  K b  ea
dt
• Choosing 𝜃, 𝜃 𝑎𝑛𝑑 𝑖𝑎 as state variables
0
1 0
𝐵 𝐾𝑡 0
𝑑 𝜃 0 − 𝜃
0
𝜃 = 𝐽 𝐽 𝜃 + 1 𝑒𝑎
𝑑𝑡 𝑖 𝐾𝑏 𝑅𝑎 𝑖𝑎
𝑎
0 − − 𝐿𝑎
𝐿𝑎 𝐿𝑎
• Since 𝜃 is output of the system therefore output equation is given as

𝜃
𝑦 𝑡 = 1 0 0 𝜃
𝑖𝑎

You might also like