0% found this document useful (0 votes)
18 views

8 State Space Model

The document discusses state space models, including their origins and properties. It provides examples of deriving state space models from mass-spring-damper, RLC circuit, pendulum, and generic nth order differential equation systems. The states are defined as properties that change over time, and state space models are defined by the derivatives of the states.

Uploaded by

Lufrenz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

8 State Space Model

The document discusses state space models, including their origins and properties. It provides examples of deriving state space models from mass-spring-damper, RLC circuit, pendulum, and generic nth order differential equation systems. The states are defined as properties that change over time, and state space models are defined by the derivatives of the states.

Uploaded by

Lufrenz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

State Space Model

T.Kaputu
Introduction
These resources look at a state-space models their origins,
properties and use in control
The first few resources focus on origins.

1. What is state space model?


2. How do I derive a model to represent a given system?
3. Linearized models.
State space models
• State space models are defined in terms of so called system
states.
• States are properties which changes with time such as speed,
temperature, pressure and so forth
• The model is defined in terms of the derivatives of the state. If
you know the derivatives of all the states, then you can
capture the system behaviour.
Mass damper
A simple example of a mass-damper could be a vehicle.
The engine provides a drive force whereas, for example, wind
and road provide friction or drag.

𝐵
Mass 𝑓𝑎 (𝑡) M 𝑓𝑎 (𝑡)
𝐵 𝑀

How do we model such a scenario?


𝑑𝑑
𝑀 + 𝐵𝐵 = 𝑓𝑎 (𝑡)
𝑑𝑑
Defining state derivatives
• The mass-damper can be thought of as having a single state,
that is the velocity.

• A state space mode re-arranges the equation to define the


derivative of the state.
𝑑𝑑 𝑑𝑑 𝐵 1
𝑀 + 𝐵𝐵 = 𝑓 ⇒ =− 𝑣+ 𝑓
𝑑𝑑 𝑑𝑑 𝑀 𝑀
• This derivative is expressed with matrix notation

𝑑𝑑 𝐵 1
= − 𝑣+ 𝑓⇒ 𝑣̇ = 𝐴𝐴 + 𝐵𝐵
𝑑𝑑 𝑀 𝑀 State derivative is linear
in the state and the input
Resistor-Capacitor in series
Consider the following circuit and use Kirchhoff’s voltage law to
derive an appropriate model
𝑹𝟏 𝑑𝑑
𝑣1 = 𝑖𝑖1 = 𝑅1
𝑑𝑑
𝒗𝟏
𝑪 1
𝒗𝟐 𝑣2 = 𝑞
𝐶

𝑞
𝑣𝑖𝑖 = 𝑣1 + 𝑣2 = 𝑅1 𝑞̇ +
𝐶
Defining State derivatives

The resistor-capacitor can be thought of as having a single


state, that is the charge across the capacitor.
A state space model re-arranges the equation to define the
derivative of the state.
𝑑𝑑 1 1 1
𝑅1 + 𝑞 = 𝑣 ⇒ 𝑞̇ = − 𝑞+ 𝑣
𝑑𝑑 𝐶 𝑅1 𝐶 𝑅1

This derivative is expressed with matrix notation


1 1
𝑞̇ = − 𝑞+ 𝑣 ⇒ 𝑞̇ = 𝐴𝐴 + 𝐵𝐵
𝑅𝑅 𝑅𝑅
Summary

𝑑𝑑 1 𝐾
𝑇 + 𝑥 = 𝐾𝐾 ⇒ 𝑥̇ = − 𝑥 + 𝑢
𝑑𝑑 𝑇 𝑇

𝑥̇ = 𝐴𝐴 + 𝐵𝐵 A B
State of a 2nd order ODE

• The first step in forming a state space model is to define the


states.
• There should be enough independent states to capture
the entire system dynamics – for low order systems this
selection is usually obvious.

• However, when presented with a high order differential


equation, the user may have no access (or information) relating
to the definition of the original underlying states, and thus an
arbitrary definition can be used.
Modeling a mass spring damper

𝑀𝑥̈ + 𝐵𝑥̇ + 𝑘𝑘 = 𝑓𝑎 𝑡 ⇒ 𝑀𝑣̇ + 𝐵𝐵 + 𝑘𝑘 = 𝑓𝑎 (𝑡)

We can select the states to be velocity v and displacement x

For a state space model, find the derivatives of


each state and stack into a single vector.
State-space model
Write the derivatives of v and x and stack in a vector
𝑀𝑣̇ = 𝑓𝑎 (𝑡) − 𝐵𝐵 − 𝑘𝑘
1
𝑣̇ = 𝑓𝑎 𝑡 − 𝐵𝐵 − 𝑘𝑘
𝑀

𝑥̇ = 𝑣

𝑣̇ −𝐵/𝑀 −𝑘/𝑀 𝑣 1/𝑚


= + 𝑓
𝑥̇ 1 0 𝑥 0
𝒛̇ = 𝑨𝑨 + 𝑩𝑩
𝒛̇ 𝑨 𝒛 𝑩
RLC circuit in series

𝒗𝑳 𝒗𝑹
𝒗𝑪
𝒗(𝒕)

Consider the following circuit and use Kirchhoff’s voltage law to


derive an appropriate model
𝑑𝑑 𝑑𝑑 1
𝑣𝐿 = 𝐿 𝑣𝑅 = 𝑖𝑖 = 𝑅 𝑣𝑐 = 𝑞
𝑑𝑑 𝑑𝑑 𝐶
𝑑𝑑 𝑑𝑑 1
𝑣 𝑡 = 𝑣𝐿 + 𝑣𝑅 + 𝑣𝑐 𝑣 𝑡 =𝐿 +𝑅 + 𝑞
𝑑𝑑 𝑑𝑑 𝐶
𝑠𝑠𝑠𝑠𝑠𝑠 𝑎𝑎𝑎 𝑖 𝑎𝑎𝑎 𝑞
State-space model
Write the derivatives of 𝑖 and 𝑞 and stack in a vector
𝑑𝑑 𝑑𝑑 1
𝑣 𝑡 =𝐿 +𝑅 + 𝑞
𝑑𝑑 𝑑𝑑 𝐶

𝑑𝑑 𝑑𝑑 1 𝑑𝑑 1 𝑑𝑑 1
𝐿 =𝑣 𝑡 −𝑅 + 𝑞 ⇒ = 𝑣 𝑡 −𝑅 + 𝑞
𝑑𝑑 𝑑𝑑 𝐶 𝑑𝑑 𝐿 𝑑𝑑 𝐶

𝑑𝑑
=𝑖
𝑑𝑑
𝑖̇ −𝑅/𝐿 −1/𝐿𝐿 𝑖 1/𝐿
= + 𝑣
𝑞̇ 1 0 𝑞 0

𝒛̇ 𝒛 𝑩
𝑨
Pendulum
• A pendulum of length 𝑙 with end mass 𝑚 is able to swing freely
(assume some friction-constant 𝑘)
• A model can be derived using force balance in the tangential
direction (small angles)

𝑚𝑚𝜃̈ = −𝑚𝑚𝜃 − 𝑘𝑘𝜃̇ 𝜽

• Choose states:

𝜃 𝑎𝑎𝑎 𝜃̇ = 𝑤 𝒎𝒎𝒎𝒎 − 𝒎
Pendulum state spacemodel
State derivatives: 𝑚𝑚𝜃̈ = −𝑚𝑚𝜃 − 𝑘𝑘𝜃̇
• from the equation, we know that
𝜃̈ = 𝑤̇ 𝑎𝑎𝑎 𝜃̇ = 𝑤

hence 𝑚𝑚𝑤̇ = −𝑚𝑚𝜃 − 𝑘𝑘𝑘

1
𝑤̇ = −𝑚𝑚𝜃 − 𝑘𝑘𝑘
𝑚

𝑤̇ −𝑘𝑘/𝑚𝑚 −𝑚𝑚/𝑚𝑚 𝑤 0
̇ = + 𝑓
𝜃 1 0 𝜃 0
State space models from a generic ODE

• The first step in forming a state space model is to define the


states. The model is made up of the equations which define
the state derivatives.
• There should be enough independent states to capture the
entire system dynamics.
• In general the number of states required matches the system
order, that is how many dynamic models are in the system
behaviour
• With an ODE, the order is already known so it remains to
identify suitable states.
Consider a generic 2nd order ODE
• The main technique is to treat every derivative in the ODE
as 1st order derivative, that is the first derivative of some
state, to be defined.

• The definition of the state is then automatic.


𝑑2𝑥 𝑑𝑑 𝑑𝑑 𝑑𝑑1 𝑑 2 𝑥
𝑎 2 +𝑏 + 𝑐𝑐 = 𝑘𝑘 𝑥1 = = 2
𝑑𝑡 𝑑𝑑 𝑑𝑑 𝑑𝑑 𝑑𝑡

This is the derivative of


Already a first
dx/dt. Therefore define
derivative of x
dx/dt as a state, say 𝑥1
State space model for a generic 2nd order ODE

We now have two equations containing first derivatives and two


states

𝑑𝑑1 𝑑𝑑
𝑎 + 𝑏𝑥1 + 𝑐𝑐 = 𝑘𝑘 𝑥1 =
𝑑𝑑 𝑑𝑑

𝑑 𝑥1 −𝑏/𝑎 −𝑐/𝑎 𝑥1 𝑘
= + 𝑢
𝑑𝑑 𝑥 1 0 𝑥 0
Consider a generic nth order ODE
The main technique is to treat every derivative in the ODE
as 1st order derivative, that is the first derivative of some
state, to be defined.
Already a first
The definition of the states is then automatic derivative of x

𝑑𝑛 𝑥 𝑑 𝑛−1 𝑥 𝑑2𝑥 𝑑𝑑
𝑎𝑛 𝑛 + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎2 2 + 𝑎1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑑

𝑑 𝑛−1 𝑥
This is the derivative of . This is the derivative of
𝑑𝑡 𝑛−1
𝑑 𝑛−1 𝑥 dx/dt. Let dx/dt=𝑥1
let = 𝑥𝑛−1
𝑑𝑡 𝑛−1
Consider a generic nth order ODE
𝑑 𝑛−1 𝑥 𝑑𝑥𝑛−2 𝑑 2 𝑥 𝑑𝑥1 𝑑𝑑
𝑥𝑛−1 = 𝑛−1 = 𝑥2 = 2 = 𝑥1 =
𝑑𝑡 𝑑𝑑 𝑑𝑡 𝑑𝑑 𝑑𝑑

𝑑𝑛 𝑥 𝑑 𝑛−1 𝑥 𝑑2𝑥 𝑑𝑑
𝑎𝑛 𝑛 + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎2 2 + 𝑎1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑑

𝑑𝑥𝑛−1
𝑎𝑛 + 𝑎𝑛−1 𝑥𝑛−1 + ⋯ + 𝑎2 𝑥2 + 𝑎1 𝑥1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑑

Now we have equations defining n 1st order derivative


and n states
State space model
𝑑 𝑛−1 𝑥 𝑑𝑥𝑛−2 𝑑 2 𝑥 𝑑𝑥1 𝑑𝑑
𝑥𝑛−1 = 𝑛−1 = 𝑥2 = 2 = 𝑥1 =
𝑑𝑡 𝑑𝑑 𝑑𝑡 𝑑𝑑 𝑑𝑑
𝑑𝑥𝑛−1
𝑎𝑛 + 𝑎𝑛−1 𝑥𝑛−1 + ⋯ + 𝑎2 𝑥2 + 𝑎1 𝑥1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑑

𝑎𝑛−1 𝑎𝑛−2 𝑎0
− − ⋯ − 𝑘
𝑥𝑛−1 𝑎𝑛 𝑎𝑛 𝑎𝑛 𝑥𝑛−1
𝑑 𝑥𝑛−2 𝑥 𝑎𝑛
= 1 0 ⋯ 0 𝑛−2
+ 0 𝑢
𝑑𝑑 ⋮ 0 1 ⋯ 0 ⋮
𝑥 ⋮ ⋮ ⋱ ⋮ 𝑥 ⋮
0 0 ⋯ 0 0
State space model finding the output

• The previous sections introduced state space models beginning


from 1st principles modelling.
• However, so far the focus has been on replicating the
dynamics, but little thought has been given to how key values
might be extracted.
• This section introduces the concept of the output matrix
Consider a generic nth order ODE
A generic nth order ODE has an equivalent state space model

𝑑𝑛 𝑥 𝑑 𝑛−1 𝑥 𝑑2𝑥 𝑑𝑑
𝑎𝑛 𝑛 + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎2 2 + 𝑎1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑑
𝑎𝑛−1 𝑎𝑛−2 𝑎0
− − ⋯ − 𝑘
𝑥𝑛−1 𝑎𝑛 𝑎𝑛 𝑎𝑛 𝑥𝑛−1
𝑑 𝑥𝑛−2 𝑥 𝑎𝑛
= 1 0 ⋯ 0 𝑛−2
+ 0 𝑢
𝑑𝑑 ⋮ 0 1 ⋯ 0 ⋮
𝑥 ⋮ ⋮ ⋱ ⋮ 𝑥 ⋮
0 0 ⋯ 0 0

How do I find the


values of interest?
Consider a generic nth order ODE
A generic nth order ODE has an equivalent state space model

𝑑𝑛 𝑥 𝑑 𝑛−1 𝑥 𝑑2𝑥 𝑑𝑑
𝑎𝑛 𝑛 + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎2 2 + 𝑎1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑑
𝑎𝑛−1 𝑎𝑛−2 𝑎0
− − ⋯ − 𝑘
𝑥𝑛−1 𝑎𝑛 𝑎𝑛 𝑎𝑛 𝑥𝑛−1
𝑑 𝑥𝑛−2 𝑥 𝑎𝑛
= 1 0 ⋯ 0 𝑛−2
+ 0 𝑢
𝑑𝑑 ⋮ 0 1 ⋯ 0 ⋮
𝑥 ⋮ ⋮ ⋱ ⋮ 𝑥 ⋮
0 0 ⋯ 0 0
Values of interest
• In this case, an obvious value of interest is the state x.
• This is the last value in the ‘state vector z’.
Hence : 𝑥𝑛−1
𝑥𝑛−2
𝑥= 0 0 ⋯ 0 1 = 𝐶𝐶

𝑥
C
z
• If we were interested in the first derivative, this can equally
be determined
𝑥𝑛−1
𝑑𝑑 ⋮
= 𝑥1 = 0 0 ⋯ 1 0 = 𝐶𝐶
𝑑𝑑 𝑥1
𝑥
Values of interest - outputs
If we were interested in the state x and the derivative, we can
give the matrix C two rows and define an output vector
𝑥𝑛−1
𝑥 0 0 ⋯ 0 1 ⋮
𝑦= 𝑥 = = 𝐶𝐶
1 0 0 ⋯ 1 0 𝑥 1
𝑥

Outputs are defined as values of interest (often but not


necessarily specific states) and in general the definition of C
follows accordingly.
Generic form
A more complete state space model takes the following form.

𝑥̇ = 𝐴𝐴 + 𝐵𝐵; 𝑦 = 𝐶𝐶 + 𝐷𝐷

States Inputs Outputs

Although included here for completeness, in many cases the


matrix D=0 because otherwise this implies a system whose
output can change instantaneously.
example
Find the state space model of a mass-spring damper with
outputs of displacement and velocity

𝑑𝑑
𝑑𝑑 = − 𝐵⁄𝑀 − 𝑘 ⁄𝑀 𝑣 1⁄𝑀
+ 𝑓
𝑑𝑑 1 0 𝑥 0
𝑑𝑑

𝑣 1 0 𝑣
The output is = = 𝐶𝐶
𝑥 0 1 𝑥
State Variable to Transfer Function
• If a dynamic system is given is a state variable representation, the
transfer function from any state variable or output variable, to
any input variable can be determined.
• Assume the state initial conditions are zero 𝑥0 = 0
Known :
𝑥̇ (𝑡) = 𝐴𝐴 𝑡 + 𝐵𝐵(𝑡)
𝑦 𝑡 = 𝐶𝐶 𝑡 + 𝐷𝐷(𝑡)
State Variable to Transfer Function
• Taking Laplace transform (with zero initial conditions)
ℒ 𝑥̇ 𝑡 = ℒ 𝐴𝑥 𝑡 + ℒ 𝐵𝐵 𝑡
ℒ𝑦 𝑡 = ℒ 𝐶𝑥 𝑡 + ℒ 𝐷𝐷 𝑡

𝑆𝑆 𝑠 = 𝐴𝐴 𝑠 + 𝐵𝐵(𝑠)
𝑌 𝑠 = 𝐶𝐶 𝑠 + 𝐷𝐷(𝑠)

The state equation can be placed in the form


𝑆𝑆 𝑠 − 𝐴𝐴 𝑠 = 𝐵𝐵(𝑠)

𝑋 𝑠 𝑆𝑆 − 𝐴 = 𝐵𝐵(𝑠)
State Variable to Transfer Function
−1
• Pre – multiplying both sides by 𝑆𝑆 − 𝐴
𝑋 𝑠 = 𝑆𝑆 − 𝐴 −1 𝐵𝐵(𝑠)

• Substituting for 𝑋(𝑠) in the output equation

𝑌 𝑠 = 𝐶𝐶 𝑠 + 𝐷𝐷(𝑠)
−1 𝐵𝐵
𝑌 𝑠 = 𝐶 𝑆𝑆 − 𝐴 𝑠 + 𝐷𝐷(𝑠)
−1 𝐵
𝑌 𝑠 = 𝐶 𝑆𝑆 − 𝐴 +𝐷 𝑈 𝑠

𝑌 𝑠 −1 𝐵
𝐺 𝑠 = = 𝐶 𝑆𝑆 − 𝐴 +𝐷
𝑈 𝑠
31
REMARK

−1
𝑌 = 𝐶 𝑠𝑠 − 𝐴 𝐵 + 𝐷 𝑈 ⇒ 𝑝𝑝𝑝𝑝𝑝 ≡ 𝑠𝑠 − 𝐴 = 0

𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 ≡ 𝜆Ι − 𝐴 = 0
Example 3
• State space model
𝑥̇ 1 𝑥1
0 1 𝑥1 0 𝑦= 1 0 𝑥 + 0𝑈
𝑥̇ 2 = 𝑥 + [𝑈] 2
−2 −3 2 1
−1
𝐺 𝑠 = 𝐶 𝑆𝑆 − 𝐴 𝐵+𝐷

−1
𝑠 0 0 1 0
= 1 0 − + 0
0 𝑠 −2 −3 1

−1
𝑠 −1 0
= 1 0
2 𝑠+3 1
33
Example 3
• Note: Recall that if we have
𝑎 𝑏 −1 1 𝑑 −𝑏
𝐸= , than 𝐸 =
𝑐 𝑑 det(𝐸) −𝑐 𝑎
hence:
1 𝑠+3 1 0
= 1 0
𝑠 𝑠 + 3 + 2 −2 𝑠 1

1 1
= 2 1 0
𝑠 + 3𝑠 + 2 𝑠

1
𝑠 2 + 3𝑠 + 2 34
MATLAB example
A=[1 3; -2 5]
B=[2 ; -1]
C=[1 1]
D=0
[n,d]=ss2tf(A,B,C,D,1)

n =
0 1.0000 -16.0000

d =
𝑠 − 16
1 -6 11 𝐺= 2
𝑠 − 6𝑠 + 11
MATLAB example
A=[1 3 2; 0 -2 5; 1 -0.3 2]
B=[2 ; -1; 0]
C=[1 0 5]
D=0
[n,d]=ss2tf(A,B,C,D,1)

2𝑠 2 + 8.5𝑠 + 5.1
𝐺= 3
𝑠 − 𝑠 2 − 4.5𝑠 − 16.5
Conversion from a transfer function

• The previous section showed how to form a transfer


function model from a state space model.

• This section looks at the reverse process, that is finding a


state space model from a transfer function model.

• Students are reminded that a state space representation is


not unique. Several alternative state space forms can
represent the same transfer function.
Assumption
For ease of algebra denominator polynomials will be monic.
It is always possible to achieve this by scaling all coefficients as
required.

MONIC means the coefficient of the maximum power is 1


Basic concept
The approach here will begin by deriving the results for a
transfer function with constant numerator

𝑘
𝑋(𝑠) = 𝑛 𝑛−1
𝑈(𝑠)�
𝑠 + 𝑎𝑛−1 𝑠 + ⋯ + 𝑎1 𝑠 + 𝑎0

This clearly analogous to an ODE

𝑑𝑛 𝑥 𝑑 𝑛−1 𝑥 𝑑2𝑥 𝑑𝑑
𝑘𝑘 = 𝑛 + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎2 2 + 𝑎1 + 𝑎0 𝑥
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑑
State space model
Use the n equations to form a state space model with n states.

𝑑𝑥𝑛−2 𝑑𝑥1 𝑑𝑑
𝑥𝑛−1 = ; 𝑥2 = ; 𝑥1 =
𝑑𝑑 𝑑𝑑 𝑑𝑑

𝑑𝑥𝑛−1
𝑎𝑛 + 𝑎𝑛−1 𝑥𝑛−1 + ⋯ + 𝑎2 𝑥2 + 𝑎1 𝑥1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑑

−𝑎𝑛−1 −𝑎𝑛−2 ⋯ −𝑎0 𝑥


𝑥𝑛−1 𝑛−1 𝑘
𝑑 𝑥𝑛−2 1 0 ⋯ 0 𝑥𝑛−2 0
= 0 1 ⋯ 0 + 𝑢
𝑑𝑑 ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮
𝑥 0 0 ⋯ 0 𝑥 0
4th order state space model
Use the n equations to form a state space model with n states.
𝑑𝑥2 𝑑𝑥1 𝑑𝑑
𝑥3 = ; 𝑥2 = ; 𝑥1 =
𝑑𝑑 𝑑𝑑 𝑑𝑑
𝑑𝑥3
+ 𝑎3 𝑥3 + 𝑎2 𝑥2 + 𝑎1 𝑥1 + 𝑎0 𝑥 = 𝑘𝑘
𝑑𝑑
𝑥 0 1 0 0 𝑥 0
𝑑 𝑥1 0 0 1 0 𝑥1 0
𝑥 = 𝑥 + 𝑢
𝑑𝑑 2 0 0 0 1 2 0
𝑥3 −𝑎0 −𝑎1 −𝑎2 −𝑎3 𝑥3 𝑘
The ordering of states is a user choice and this changes the
implied A, B matrices.
REMARKS
The two examples just given, which simply reverse the order the
states are listed, are denoted as

CONTROLLABLE CANONICAL FORMS

A Key Point is that the parameters of the ODE (equivalently


transfer function denominator) Appear explicitly in the A matrix
and thus the conversion is straightforward
Proposal
Given we can find a state space model for a generic ODE

𝑑𝑛 𝑥 𝑑 𝑛−1 𝑥 𝑑2𝑥 𝑑𝑑
𝑘𝑘 = 𝑛 + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎2 2 + 𝑎1 + 𝑎0 𝑥
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑑

A possible state space model for the equivalent transfer


function must be same!

𝑘
𝑋(𝑠) = 𝑛 𝑛−1
𝑈(𝑠)�
𝑠 + 𝑎𝑛−1 𝑠 + ⋯ + 𝑎1 𝑠 + 𝑎0
Example
Find a control canonical form for the following
4
𝑋(𝑠) = 𝑈(𝑠)
𝑠3 + 2𝑠 2 +𝑠+3

𝑑 0 1 0 0 𝑥
𝑧 = 0 0 1 𝑧 + 0 𝑢; 𝑧 = 𝑥̇
𝑑𝑑 𝑥̈
−3 −1 −2 4

𝑥= 1 0 0𝑧
Example
Find the state space model for the following

It should be clear that this amounts to only a change in the


C matrix, that is in which the 2nd state is exported as the
output
𝑠 𝑑𝑑
𝑊 𝑠 = 𝑛 𝑈 𝑠 ; 𝑤=
𝑠 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎1 𝑠 + 𝑎0 𝑑𝑑

𝑋(𝑠)
𝑋1 (𝑠)
𝑊(𝑠) = 0 1 0 ⋯

𝑋𝑛−1 (𝑠)
𝑠
= 𝑛
𝑠 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎1 𝑠 + 𝑎0
Example
Find the state space model for the following

It should be clear that this amounts to only a change in the


C matrix, that is in which the 2nd state is exported as the
output
𝑠𝑟 𝑑𝑟 𝑥
𝑊 𝑠 = 𝑛 𝑈 𝑠 ; 𝑤= 𝑟
𝑠 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎1 𝑠 + 𝑎0 𝑑𝑡

𝑋(𝑠)
𝑋1 (𝑠) 𝑠𝑟
⋮ = 𝑛
𝑊(𝑠) = 0 0 ⋯ 1 ⋯ 0 𝑠 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎1 𝑠 + 𝑎0
𝑋𝑟 (𝑠)

𝑋𝑛−1 (𝑠)
Example
Find the control canonical form for the following
4𝑠
𝑋(𝑠) = 3 𝑈(𝑠) NOTE: Place 4 in the C
2
𝑠 + 2𝑠 + 𝑠 + 3 matrix instead of B

𝑑 0 1 0 0 𝑥
𝑧 = 0 0 1 𝑧 + 0 𝑢; 𝑧 = 𝑥̇
𝑑𝑑 𝑥̈
−3 −1 −2 1

𝑥 = [0 4 0]𝑧 NOTE: Numerator


coefficient is now in the
Cmatrix!
Example
Find a control canonical from for the following

6𝑠 2 + 4𝑠 + 2
𝑌(𝑠) = 4 3 2
𝑈(𝑠)
𝑠 − 𝑠 + 2𝑠 + 𝑠 + 3

0 1 0 0 0
𝑑 0 0 1 0 0
[𝑧] = 𝑧+ 𝑢; 𝑦 = 2 4 6 0𝑧
𝑑𝑑 0 0 0 1 0
−3 −1 −2 1 1

NOTE: The only change is to the C matrix which has all numerator
coefficients!
Example
Find control canonical form for the following

𝑏𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑏1 𝑠 + 𝑏0
𝑌(𝑠) = 𝑛 𝑛−1 2
𝑈(𝑠)
𝑠 + 𝑎𝑛−1 𝑠 + ⋯ + 𝑎2 𝑠 + 𝑎1 𝑠 + 𝑎0

0 1 0 ⋯ 0 0
𝑑 0 0 1 ⋯ 0 0
[𝑧] = 𝑧+ 𝑢
𝑑𝑑 ⋮ ⋮ ⋯ ⋱ ⋮ ⋮
−𝑎0 −𝑎1 −𝑎2 ⋯ −𝑎𝑛−1 1
A B

NOTE: States can be in reverse


𝑦 = [𝑏0 𝑏1 ⋯ 𝑏𝑛−1 ]𝑧 order with obvious impact on
matrix definition
C
Diagonal canonical form
• The previous section showed how to form a state space model
from a transfer function using the control canonical form
• Where a system has only real and distinct poles, one
alternative is the diagonal canonical form

• Being diagonal, this has some advantages although the states


have less meaning and partial fractions are required.
Partial fractions
Assuming real and distinct poles, a partial fraction expansion
takes the following form.

𝑏𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑏1 𝑠 + 𝑏0
𝐺= 𝑛
𝑠 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎2 𝑠 2 + 𝑎1 𝑠 + 𝑎0

𝑏𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑏1 𝑠 + 𝑏0
𝐺=
𝑠 + 𝑝1 )(𝑠 + 𝑝2 ) ⋯ (𝑠 + 𝑝𝑛

𝑅1 𝑅2 𝑅𝑛
𝐺= + + ⋯+
𝑠 + 𝑝1 𝑠 + 𝑝2 𝑠 + 𝑝𝑛
State-space from partial fraction
Define a separate, independent state for each partial fraction term.
𝑅1 𝑅2 𝑅𝑛
𝐺= + + ⋯+
𝑠 + 𝑝1 𝑠 + 𝑝2 𝑠 + 𝑝𝑛

𝑑𝑥1 𝑑𝑥2
= −𝑝1 𝑥1 + 𝑢; = −𝑝2 𝑥2 + 𝑢; ⋯
𝑑𝑑 𝑑𝑑

NOTE: Ignore the residue for now and reintroduce in the


output equation!

𝑦 = 𝑅1 𝑥1 + 𝑅2 𝑥2 + ⋯
Example state space model
𝑅1 𝑅2 𝑅𝑛
By inspection 𝐺= + + ⋯+
𝑠 + 𝑝1 𝑠 + 𝑝2 𝑠 + 𝑝𝑛

𝑥1 −𝑝1 0 ⋯ 0 𝑥1 1
𝑑 𝑥2 0 −𝑝2 ⋯ 0 𝑥2 1
⋮ = ⋮ + 𝑢
𝑑𝑑 ⋮ ⋮ ⋱ ⋮ 1
𝑥𝑛 0 0 ⋯ −𝑝𝑛 𝑥𝑛 1

𝑦 = [𝑅1 𝑅2 ⋯ 𝑅𝑛 ]𝑧
Example
Find a state space model for the following.
3𝑠 + 1 3𝑠 + 1
𝐺= 3 𝐺=
𝑠 + 6𝑠 2 + 11𝑠 + 6 𝑠 + 1)(𝑠 + 2)(𝑠 + 3

−1 5 −4
𝐺= + +
𝑠+1 𝑠+2 𝑠+3

𝑥1 −1 0 0 1
𝑑
𝑥2 = 0 −2 0 1 𝑢; 𝑦 = [−1 5 −4]𝑧
𝑑𝑑 𝑥
3 0 0 −3 1
Repeated roots
Where a partial fraction has repeated roosts a slightly modified,
so called Jordan form, is required.

It is easier to illustrate this first with some simple examples.

𝑅2 𝑅1
𝐺= 2
+
𝑠+𝑎 𝑠+𝑎

𝑅3 𝑅2 𝑅1
𝐻= 3
+ 2
+
𝑠+𝑎 𝑠+𝑎 𝑠+𝑎
State space for repeated poles

A suitable A and B matrix to create the required forms is simply


stated here

𝑑 𝑥1 −𝑎 1 0
= 𝑢; 𝑦 = 𝑅1 𝑅2 𝑧
𝑑𝑑 𝑥2 0 −𝑎 1

𝑠+𝑎 1 0 1
−1 𝑠+𝑎 2
𝑠𝑠 − 𝐴 −1 𝐵 =
𝑠+𝑎 −1
𝐵 = 0 𝑠+𝑎 1 =
0 𝑠+𝑎 𝑠+𝑎 2 1
𝑠+𝑎

−1 𝐵
𝑅1 𝑅2
𝐶 𝑠𝑠 − 𝐴 = 2
+
𝑠+𝑎 𝑠+𝑎
State space form for repeated poles
𝑥1 −𝑎 1 0 𝑥1 0
𝑑
𝑥2 = 0 −𝑎 1 𝑥2 + 0 𝑢; 𝑦 = [𝑅1 𝑅2 𝑅3 ]𝑧
𝑑𝑑 𝑥
3 0 0 −𝑎 𝑥3 1

−1
−𝑎 1 0
𝑠𝑠 − 𝐴 −1 𝐵 = 0 −𝑎 1 𝐵
0 0 −𝑎 1
𝑠+𝑎 3
2
𝑠+𝑎 𝑠+𝑎 1 0 1
0 𝑠+𝑎 2 𝑠+𝑎 0 =
𝑠+𝑎 2
0 0 𝑠+𝑎 2 1 1
= 3
𝑠+𝑎 𝑠+𝑎
State space form for repeated poles

−1 𝐵
𝑅1 𝑅2 𝑅3
𝐶 𝑠𝑠 − 𝐴 = 3
+ 2
+
𝑠+𝑎 𝑠+𝑎 𝑠+𝑎
Example
Find a diagonal / Jordan canonical form for the following

4𝑠 + 2
𝑋(𝑠) = 3 2
𝑈(𝑠)
𝑠 + 4𝑠 + 5𝑠 + 2

6 −2 −6
𝐺(𝑠) = 2
+ +
𝑠+1 𝑠+1 𝑠+2

𝑑 −1 1 0 0
𝑧 = 0 −1 0 𝑧 + 1 𝑢; 𝑥 = [6 −2 −6]𝑧
𝑑𝑑
0 0 −2 1
Example
Given the following system in the figure below.
(a) Draw the free body diagram and apply D'Alembert's law to write
a modeling equation for the system.
(b) Find the state – variable model for the system
(c) For the system found in (b) , write the state-variable model in
the standard form, i.e state space form 𝒙̇ 𝒕 = 𝑨𝑨 𝒕 + 𝑩𝑩(𝒕)
𝒚 𝒕 = 𝑪𝑪 𝒕 + 𝑫𝑫(𝒕)

60
Example 2

𝐵 𝑥̇ 2 − 𝑥̇ 1 + 𝑘2 𝑥2 − 𝑥1 − 𝑀1 𝑥̈ 1 − 𝑘1 𝑥1 = 0 (1)

𝑓𝑎 𝑡 − 𝑀2 𝑥̈ 2 − 𝐵 𝑥̇ 2 − 𝑥̇ 1 − 𝑘2 𝑥2 − 𝑥1 = 0 (2)
• Rearranging, we have

𝑀1 𝑣̇ 1 + 𝑘1 + 𝑘2 𝑥1 + 𝐵𝑣1 − 𝑘2 𝑥2 − 𝐵𝑣2 = 0 (3)

𝑀2 𝑣̇ 2 − 𝑘2 𝑥1 − 𝐵𝑣1 + 𝑘2 + 𝑘3 𝑥2 + 𝐵𝑣2 = 𝑓𝑎 (𝑡) (4)


61
Example 2
From equation (3) and (4)
By solving these equations for 𝑣̇ 1 and 𝑣̇ 2 , we can write the following
four state variable equations:
𝑥̇ 1 = 𝑣1

1
𝑣̇ 1 = − 𝑘1 + 𝑘2 𝑥1 − 𝐵𝑣1 + 𝑘2 𝑥2 + 𝐵𝑣2
𝑀
𝑥̇ 2 = 𝑣2

1
𝑣̇ 2 = [𝑘2 𝑥1 + 𝐵𝑣1 − 𝑘2 + 𝑘3 𝑥2 − 𝐵𝑣2 + 𝑓𝑎 (𝑡)]
𝑀
62
Example 2
𝑥̇ 1 = 0𝑥1 + 0𝑥2 + 1𝑣1 + 0𝑣2 + 0𝑢1

1
𝑣̇ 1 = (𝑘1 + 𝑘2 )𝑥1 + 𝑘𝑘2 + −𝐵𝐵1 + 𝐵𝐵2 + 0𝑢1
𝑀1

𝑥̇ 2 = 0𝑥1 + 0𝑥2 + 0𝑣1 + 1𝑣2 + 0𝑢2

1
𝑣̇ 2 = 𝑘2 𝑥1 − 𝑘2 + 𝑘3 𝑥2 +𝐵𝐵1 −𝐵𝐵2 +1𝑢2
𝑀2

63
Example 2
0 0 1 0
𝑥̇ 1 1 𝑥1
(𝑘1 + 𝑘2 ) 𝑘2 −𝐵 𝐵 𝑥2 0
𝑣̇ 1 𝑀1
𝑥̇ 2
=
0 0 0 1 𝑣1 + 0
1
0
𝑣̇ 2 𝑣2
𝑘2 1
𝑀2 − 𝑘2 + 𝑘3 𝐵 −𝐵

64
65

You might also like