Professional Documents
Culture Documents
ME307
Fundamentals of Control Engineering
控制工程基础
Lecture 06: State-Space Modeling
Fall 2020
U Kei Cheang
Fall Semester 5 6 7 8 9 10 11 • Early Oct: Discipline Education • Oct 10th: Make-up classes for • Oct: SUSTech Master Programs
Month Week 4 Thursday Application
Week 4
• Late Oct: Meeting on Student • Sep-Oct: SUSTech PhD Programs
Fall Semester 12 13 14 15 16 17 18 Admission Application
Week 5 • Oct 10th: Make-up classes for Week
October 4 Thursday
Fall Semester 19 20 21 22 23 24 25
Week 6
Fall Semester 26 27 28 29 30 31 1
Week 7
Fall Semester 2 3 4 5 6 7 8 • Nov 6th-7th: Meeting on Research •Nov 2nd-13th: Mid-term Exam • Nov 13th: SUSTech Sports Meeting
Midterm • Nov 13th: The 6th SUSTech •Nov 13th: SUSTech Sports Meeting (no classes)
Week 8 Mid
Autumn Sports Meeting (no classes) • Nov-Dec: Second Interview of PhD
Fall Semester 9 10 11 12 13 14 15 Programs Admission
Week 9 Mid
November
Fall Semester 16 17 18 19 20 21 22
Week 10
Fall Semester 23 24 25 26 27 28 29
Week 11
Fall Semester 30 1 2 3 4 5 6 • Dec 21st: Academic Degree • Dec 12th: CET-4 & CET-6 Exam • Dec 12th: CET-4 & CET-6 Exam
Evaluation Committee Meeting • Dec 21st-Jan 6th: Spring Semester • Late Dec: Unified National Graduate
Week 12
• Dec 20th: SUSTech Anniversary Course Selection Entrance Examination
Fall Semester 7 8 9 10 11 12 13 Ceremony • Dec 28th-Jan 8th:Final Exam for UG • Dec 28th-Jan 8th: Final Exam for PG
Week 13 • Dec 31st: New Year Party Students (no classes) Students (no classes)
Fall Semester 14 15 16 17 18 19 20
December
Week 14
Fall Semester 21 22 23 24 25 26 27
Week 15 Optional
Fall Semester 28 29 30 31 1 2 3
Week 16 Finals
Fall Semester 4 5 6 7 8 9 10 • Jan 11th-Feb 19th: Advising Week • Nov 2020-Mar 2021: Collaborative
and Course Confirmation for Spring PhD Programs Application
Week 17 Finals
Semester • Dec 2020-Jan 2021: SUSTech PhD
Spring Semester 11 12 13 14 15 16 17 • Jan 23th-31st: Military Training for Application
Week 1 2020 UG Students • Dec 2020-Feb 2021: SUSTech PhD
2021
Application (International Students)
January Spring Semester 18 19 20 21 22 23 24
Week 2
Military Training 25 26 27 28 29 30 31
Week
*(Pending for release by the General Office of the State Council)
2
Recap from last week
Discussed linearity and linearization
Linear Nonlinear
3
Recap from last week
Introduced state-space modeling
System Analysis
State-space model consists of the states equation and the output equation.
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑦 = 𝐂𝐱 + 𝐷𝑢
input output
State
B C
A
4
State-Space Modeling
Example: Represent the translational mechanical system in state space, where x3(t) is the output
M1: 𝑠 2 + 𝑠 + 1 𝑋1 𝑠 + 0𝑠 2 − 𝑠 + 0 𝑋2 𝑠 + 0𝑠 2 + 0𝑠 + 0 𝑋3 𝑠 = 𝐹(𝑠)
M2: 0𝑠 2 − 𝑠 + 0 𝑋1 𝑠 + 𝑠 2 + 𝑠 + 1 𝑋2 𝑠 + 0𝑠 2 + 0𝑠 − 1 𝑋3 𝑠 = 0
M3: 0𝑠 2 + 0𝑠 + 0 𝑋1 𝑠 + 0𝑠 2 + 0𝑠 − 1 𝑋2 𝑠 + 𝑠 2 + 𝑠 + 1 𝑋3 𝑠 = 0
Reverse Laplace
𝑠 2 + 𝑠 + 1 𝑋1 𝑠 − 𝑠𝑋2 𝑠 = 𝐹 𝑠 → 𝑥ሷ 1 = −𝑥ሶ 1 − 𝑥1 + 𝑥ሶ 2 + 𝑓
−𝑠𝑋1 𝑠 + 𝑠 2 + 𝑠 + 1 𝑋2 𝑠 − 𝑋3 𝑠 = 0 → 𝑥ሷ 2 = 𝑥ሶ 1 − 𝑥ሶ 2 − 𝑥2 + 𝑥3
−𝑋2 𝑠 + 𝑠 2 + 𝑠 + 1 𝑋3 𝑠 = 0 → 𝑥ሷ 3 = −𝑥ሶ 3 − 𝑥3 + 𝑥2
5
State-Space Modeling
2) Select the state variables. From the equations, you can see that 𝑥1 , 𝑥1ሶ , 𝑥1ሷ , 𝑥2 , 𝑥2ሶ , 𝑥2ሷ , 𝑥3 , 𝑥3ሶ , 𝑥3ሷ need to be
represented in the state-space model. Follow this rule, convert dependent variable and its derivatives into state
variables EXCEPT for the highest derivatives.
𝑥1 → 𝑥1 = 𝑥1
𝑥1ሶ → 𝑥2 = 𝑥1ሶ
𝑥2 → 𝑥3 = 𝑥2
𝑥2ሶ → 𝑥4 = 𝑥2ሶ
𝑥3 → 𝑥5 = 𝑥3
𝑥3ሶ → 𝑥6 = 𝑥3ሶ
3) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the variables.
𝑥1 = 𝑥1 → 𝑥1ሶ = 𝑥1ሶ = 𝑥2
𝑥3 = 𝑥2 → 𝑥3ሶ = 𝑥2ሶ = 𝑥4
𝑥5 = 𝑥3 → 𝑥5ሶ = 𝑥3ሶ = 𝑥6
6
State-Space Modeling
4) Substitute the states and the dynamics into the differential equations. If there is a conflict, use the states
𝑥1 = 𝑥1 → 𝑥1ሶ = 𝑥1ሶ = 𝑥2
𝑥2 = 𝑥1ሶ → 𝑥2ሶ = 𝑥1ሷ
𝑥3 = 𝑥2 → 𝑥3ሶ = 𝑥2ሶ = 𝑥4
𝑥4 = 𝑥2ሶ → 𝑥4ሶ = 𝑥2ሷ
𝑥5 = 𝑥3 → 𝑥5ሶ = 𝑥3ሶ = 𝑥6
𝑥6 = 𝑥3ሶ → 𝑥6ሶ = 𝑥3ሷ
𝑥ሷ 1 = −𝑥ሶ 1 − 𝑥1 + 𝑥ሶ 2 + 𝑓 → 𝑥2ሶ = −𝑥2 − 𝑥1 + 𝑥4 + 𝑓
𝑥ሷ 2 = 𝑥ሶ 1 − 𝑥ሶ 2 − 𝑥2 + 𝑥3 → 𝑥4ሶ = 𝑥2 − 𝑥4 − 𝑥3 + 𝑥5
𝑥ሷ 3 = −𝑥ሶ 3 − 𝑥3 + 𝑥2 → 𝑥6ሶ = −𝑥6 − 𝑥5 + 𝑥3
5) Define the dynamics as a function of the states
𝑥1ሶ = 𝑥2
𝑥2ሶ = −𝑥2 − 𝑥1 + 𝑥4 + 𝑓
𝑥3ሶ = 𝑥4
𝑥4ሶ = 𝑥2 − 𝑥4 − 𝑥3 + 𝑥5
𝑥5ሶ = 𝑥6
𝑥6ሶ = −𝑥6 − 𝑥5 + 𝑥3
There 6 equations are the states equations. So what we’ve done is take the 3 original 2nd order differential equations
and change them into 6 first order differential equations
7
State-Space Modeling
6) Expand out the dynamics to include all of the states (optional step)
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑥1ሶ 0 1 0 0 0 0 𝑥1 0
𝑥2ሶ −1 −1 0 1 0 0 𝑥2 1
𝑥3ሶ 0 0 0 1 0 0 𝑥3 0
= 𝑥4 + 0 𝑓(𝑡)
𝑥4ሶ 0 1 −1 −1 1 0
𝑥5ሶ 0 0 0 0 0 0 𝑥5 0
𝑥6ሶ 0 0 1 0 −1 −1 𝑥6 0
8
State-Space Modeling
8) Finally express the state-space model for the output x3(t)
Output is represented by y
𝑦 = 𝐂𝐱 + 𝐃𝑢
where y can relate to the states as such
𝑦 = 𝑥3 (𝑡) = 𝑥5
Expand this out
𝑦 = 0𝑥1 + 0𝑥2 + 0𝑥3 + 0𝑥4 + 𝑥5 + 0𝑥6 + 0𝑓(𝑡)
Express as matrix
𝑥1
𝑥2
𝑥3
𝑦= 0 0 0 0 1 0 𝑥 + 0 𝑓(𝑡)
4
𝑥5
𝑥6
If you want to use x4 as the output, the model can be written as
𝑥1
𝑥2
𝑥3
𝑦= 0 0 0 1 0 0 𝑥
4
𝑥5
𝑥6
9
State-Space Modeling
Example: Represent the rotational mechanical system in state space, where θ1(t) is the output.
𝑥1ሶ 0 1 0 0 𝑥1 0 𝑥1
𝑥2ሶ −0.18 0 0.18 0 𝑥2 1 𝑥2
a) 𝑥3ሶ
= 𝑥3 + 0 0.006𝑇 𝑦 = 3.33 0 0 0 𝑥
0 0 0 1 3
𝑥4ሶ 1 0 −1 −1 𝑥4 0 𝑥4
𝑥1ሶ 0 1 0 0 𝑥1 0 𝑥1
𝑥2ሶ −1 0 1 0 𝑥2 0 𝑥2
b) = 𝑥3 + 1 0.003𝑇 𝑦 = 0 3.33 0 0 𝑥
𝑥3ሶ 0 0 0 1 3
𝑥4ሶ 0.18 0 −0.18 −1 𝑥4 0 𝑥4
𝑥1ሶ 0 1 0 0 𝑥1 1 𝑥1
𝑥2ሶ −0.18 0 1 0 𝑥2 0 𝑥2
c) = 𝑥3 + 0 0.001𝑇 𝑦 = 0 0 3.33 0 𝑥
𝑥3ሶ 0 0 0 1 3
𝑥4ሶ 0.18 0 −1 −1 𝑥4 0 𝑥4
𝑥1ሶ 0 1 0 0 𝑥1 0 𝑥1
𝑥2ሶ −1 0 1 0 𝑥2 0 𝑥2
d) = 𝑥3 + 0 0.009𝑇 𝑦 = 0 0 0 3.33 𝑥
𝑥3ሶ 0 0 0 0.18 3
𝑥4ሶ 1 0 −1 −0.18 𝑥4 1 𝑥4
10
State-Space Modeling
Example: Represent the rotational mechanical system in state space, where θ1(t) is the output.
𝜃2 𝑁1 100
= → 𝜃1 = 𝜃2 → 𝜃1 = 3.33𝜃2
𝜃1 𝑁2 30
2 2
𝑁1 100 100 100
𝐽𝑒 = 𝐽1 = 50 = 555.56 𝑇𝑒 = 𝑇 =𝑇 = 3.33𝑇
𝑁2 30 30 30
11
State-Space Modeling
Example: Represent the rotational mechanical system in state space, where θ1(t) is the output.
rearrange
12
State-Space Modeling
Take the inverse Laplace transform
2) Select the state variables. From the equations, you can see that 𝜃2 , 𝜃2ሶ , 𝜃2ሷ , 𝜃3 , 𝜃3ሶ , 𝜃3ሷ need to be represented in the
state-space model. Follow this rule, convert dependent variable and its derivatives into state variables EXCEPT for
the highest derivatives. In this case 𝜃2 , 𝜃2ሶ , 𝜃3 needs to be converted to state variables. We will also include 𝜃2ሶ
because we know that we need to use 𝜃2ሶ to get to 𝜃2ሷ eventually.
𝜃2 → 𝑥1 = 𝜃2
𝜃2ሶ → 𝑥2 = 𝜃2ሶ
𝜃3 → 𝑥3 = 𝜃3
𝜃3ሶ → 𝑥4 = 𝜃3ሶ
3) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the variables.
𝑥1 = 𝜃2 → 𝑥1ሶ = 𝜃2ሶ
𝑥3 = 𝜃3 → 𝑥3ሶ = 𝜃3ሶ
13
State-Space Modeling
4) Substitute the states and the dynamics into the differential equations. If there is a conflict, use the states
𝑥1 = 𝜃2 → 𝑥1ሶ = 𝜃2ሶ
𝑥3 = 𝜃3 → 𝑥3ሶ = 𝜃3ሶ
These 4 equations are the states equations. So what we’ve done is take the 2 original 2nd order differential equations
and change them into 4 first order differential equations
14
State-Space Modeling
6) Expand out the dynamics to include all of the states (optional step)
𝑥2ሶ = −0.18𝑥1 + 0.18𝑥3 + 0.006𝑇 → 𝑥2ሶ = −0.18𝑥1 + 0𝑥2 + 0.18𝑥3 + 0𝑥4 + 0.006𝑇
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑥1ሶ 0 1 0 0 𝑥1 0
𝑥2ሶ −0.18 0 0.18 0 𝑥2 1
= 𝑥3 + 0.006𝑇
𝑥3ሶ 0 0 0 1 0
𝑥4ሶ 1 0 −1 −1 𝑥4 0
15
State-Space Modeling
8) Finally express the state-space model for the output θ1(t)
Output is represented by y
𝑦 = 𝐂𝐱 + 𝐃𝑢
𝑁2
𝑦 = θ1(t) = 𝜃2 3.33𝜃2 = 𝑥1
𝑁1
Express as matrix
𝑥1
𝑥2
𝑦 = 3.33 0 0 0 𝑥
3
𝑥4
16
State-Space Modeling
8) Finally express the state-space model for the output θ1(t)
Output is represented by y
𝑦 = 𝐂𝐱 + 𝐃𝑢
𝑁2
𝑦 = θ1(t) = 𝜃2 = 3.33𝜃2 = 3.33𝑥1
𝑁1
Express as matrix
𝑥1
𝑥2
𝑦 = 3.33 0 0 0 𝑥
3
𝑥4
17
Modeling
Differential
Equation
Transfer State-
Function Space
18
State-Space to Transfer Function
We’ve discussed both transfer functions and state-space models. Now we can find out how to go
from one to the other. First, from state-space to transfer function.
System Analysis
B x
u(t) M
K
20
State-Space to Transfer Function
2) Arrange A, B, C, and D matrix into the transfer function form
𝑌 𝑠 −1
𝐺 𝑠 = = 𝐂 𝑠𝐈 − 𝐀 𝐁+𝐃
𝑈 𝑠
−1
1 0 0 1 0
𝐺 𝑠 = 1 0 𝑠 − + 0
0 1 −𝑘/𝑚 −𝑏/𝑚 1/𝑚
−1
𝑠 0 0 1 0
𝐺 𝑠 = 1 0 − + 0
0 𝑠 −𝑘/𝑚 −𝑏/𝑚 1/𝑚
−1
𝑠 −1 0
𝐺 𝑠 = 1 0 𝑘/𝑚 𝑠 + 𝑏/𝑚 1/𝑚
1 𝑠 + 𝑏/𝑚 1 0
𝐺 𝑠 = 1 0
𝑠 𝑠 + 𝑏/𝑚 + 𝑘/𝑚 −𝑘/𝑚 𝑠 1/𝑚
http://www.mathwarehouse.com/algebra/matrix/inverse-of-a-matrix.php#answer
21
State-Space to Transfer Function
4) Simplify and rearrange to the transfer function form
1 𝑠 + 𝑏/𝑚 1 0
𝐺 𝑠 = 1 0
𝑠 𝑠 + 𝑏/𝑚 + 𝑘/𝑚 −𝑘/𝑚 𝑠 1/𝑚
1 1/𝑚
𝐺 𝑠 = 1 0
𝑏 𝑘 𝑠/𝑚
𝑠2 + 𝑠 +
𝑚 𝑚
1 1/𝑚
𝐺 𝑠 = 1 0
2 𝑏 𝑘 𝑠/𝑚
𝑠 + 𝑠+
𝑚 𝑚
1 1
𝐺 𝑠 = 0
𝑏 𝑘 𝑚
𝑠2 + 𝑠 +
𝑚 𝑚
1
𝐺 𝑠 =
𝑚𝑠 2 + 𝑏𝑠 + 𝑘
22
State-Space to Transfer Function
Recall from the first lecture, the same system was used…
Let’s find the transfer function for the spring-damper-mass system.
1) First get the equation of motion using previous method:
Force equal to mass times acceleration:
𝐹 𝑡 = 𝑚𝑎 = 𝑚𝑥(𝑡)
ሷ
Identify individual forces of the total force.
The applied force
𝐹𝑎𝑝𝑝𝑙𝑖𝑒𝑑 𝑡 = 𝑓(𝑡)
The spring force with k
𝐹𝑠𝑝𝑟𝑖𝑛𝑔 (𝑡) = −𝑘𝑥 𝑡
The damping force, which is commonly considered as friction
𝐹𝑑𝑎𝑚𝑝𝑖𝑛𝑔 𝑡 = −𝑏𝑣 𝑡 = −𝑏𝑥ሶ 𝑡
Force balance can then be written as
𝐹𝑎𝑝𝑝𝑙𝑖𝑒𝑑 (𝑡) + 𝐹𝑠𝑝𝑟𝑖𝑛𝑔 𝑡 + 𝐹𝑑𝑎𝑚𝑝𝑖𝑛𝑔 (𝑡) = 𝐹(𝑡)
Replace the terms
𝑓(𝑡) − 𝑘𝑥 𝑡 − 𝑏𝑥ሶ 𝑡 = 𝑚𝑥(𝑡)
ሷ
23
State-Space to Transfer Function
2) Derived a transfer function which describes the relationship between output and input.
𝑜𝑢𝑡𝑝𝑢𝑡 𝑉𝑜 𝑠
𝐺𝑝 𝑠 = =
𝑖𝑛𝑝𝑢𝑡 𝑉𝑖 (𝑠)
𝐹 𝑠 − 𝑘𝑋 𝑠 − 𝑏𝑠𝑋 𝑠 = 𝑚𝑠 2 𝑋(𝑠)
Rearrange
24
State-Space to Transfer Function
Example: Find the transfer function, T(s) = Y(s)/U(s), where U(s) is the input and Y(s) is the output.
0 1 0 10
𝐱ሶ = 0 0 1 𝐱+ 0 𝑢
−1 −2 −3 0
𝑦= 1 0 0𝐱
0 1 0 10
𝐀= 0 0 1 𝐁= 0
−1 −2 −3 0
𝐂= 1 0 0 𝐃=0
25
State-Space to Transfer Function
0 1 0 10
𝐀= 0 0 1 𝐁= 0 𝐂= 1 0 0 𝐃=0
−1 −2 −3 0
𝑌 𝑠 −1
𝐺 𝑠 = = 𝐂 𝑠𝐈 − 𝐀 𝐁+𝐃
𝑈 𝑠
−1
𝑠 0 0 0 1 0 10
𝐺 𝑠 = 1 0 0 0 𝑠 0 − 0 0 1 0 +0
0 0 𝑠 −1 −2 −3 0
−1
𝑠 −1 0 10
𝐺 𝑠 = 1 0 0 0 𝑠 −1 0 +0
1 2 𝑠+3 0
26
State-Space to Transfer Function
−1
𝑠 −1 0 10
𝐺 𝑠 = 1 0 0 0 𝑠 −1 0 +0
1 2 𝑠+3 0
1 𝑠 2 + 3𝑠 + 2 𝑠+1 1 10
𝐺 𝑠 = 1 0 0 3 −1 𝑠 𝑠+3 𝑠 0
𝑠 + 3𝑠 2 + 2𝑠 + 1
−𝑠 − 2𝑠 + 1 𝑠2 0
1 10
𝐺 𝑠 = 3 𝑠 2 + 3𝑠 + 2 𝑠+1 1 0
𝑠 + 3𝑠 2 + 2𝑠 + 1
0
1
𝐺 𝑠 = 3 2
10(𝑠 2 + 3𝑠 + 2)
𝑠 + 3𝑠 + 2𝑠 + 1
10(𝑠 2 + 3𝑠 + 2)
𝐺 𝑠 = 3
𝑠 + 3𝑠 2 + 2𝑠 + 1
27
State-Space to Transfer Function
Convert the state and output equations to a transfer function.
−4 −1.5 2
𝐱ሶ = 𝐱+ 𝑢(𝑡)
4 0 0
𝑦 = 1.5 0.625 𝐱
5 minutes!
𝑠+5
a) 𝐺 𝑠 =
𝑠 2 + 4𝑠 + 6
3𝑠 + 5
b) 𝐺 𝑠 =
𝑠 2 + 4𝑠 + 6
𝑠+1
c) 𝐺 𝑠 =
𝑠 2 + 2𝑠 + 3
3𝑠 + 1
d) 𝐺 𝑠 =
𝑠 2 + 4𝑠 + 6
28
State-Space to Transfer Function
Convert the state and output equations to a transfer function.
−4 −1.5 2
𝐱ሶ = 𝐱+ 𝑢(𝑡)
4 0 0
𝑦 = 1.5 0.625 𝐱
−4 −1.5 2
𝐀= 𝐁=
4 0 0
29
State-Space to Transfer Function
−4 −1.5 2
𝐀= 𝐁= 𝐂 = 1.5 0.625 𝐃=0
4 0 0
𝑌 𝑠 −1
𝐺 𝑠 = = 𝐂 𝑠𝐈 − 𝐀 𝐁+𝐃
𝑈 𝑠
−1
𝑠 0 −4 −1.5 2
𝐺 𝑆 = 1.5 0.625 − +0
0 𝑠 4 0 0
−1
𝑠+4 1.5 2
𝐺 𝑆 = 1.5 0.625 +0
−4 𝑠 0
1 𝑠 −1.5 2
𝐺 𝑆 = 1.5 0.625 2 +0
𝑠 + 4𝑠 + 6 4 𝑠+4 0
30
State-Space to Transfer Function
4) Simplify and rearrange to the transfer function form
1 𝑠 −1.5 2
𝐺 𝑆 = 1.5 0.625 2 +0
𝑠 + 4𝑠 + 6 4 𝑠+4 0
3𝑠 + 5
𝐺 𝑠 =
𝑠 2 + 4𝑠 + 6
31
Transfer Function to State-Space
Now that you know how to go from state-space to transfer function, let’s go from transfer function
back to state-space.
System Analysis
𝑋 𝑠 1
= 2 → 𝑎𝑠 2 𝑋 𝑠 + 𝑏𝑠𝑋 𝑠 + 𝑐𝑋 𝑠 = 𝐹(𝑠)
𝐹(𝑠) 𝑎𝑠 + 𝑏𝑠 + 𝑐
(2) Define the states variable and find the state equation and output equation.
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑦 = 𝐂𝐱 + 𝐃𝑢
32
Transfer Function to State-Space
Example: Find the state-space representation for the transfer function. Output is x1.
𝐶 𝑠 24
= 3
𝑅 𝑠 𝑠 + 9𝑠 2 + 26𝑠 + 24
𝑠 3 + 9𝑠 2 + 26𝑠 + 24 𝐶 𝑠 = 24𝑅 𝑠
33
Transfer Function to State-Space
𝑐ഺ + 9𝑐ሷ + 26𝑐ሶ + 24𝑐 = 24𝑟
𝑐 → 𝑥1 = 𝑐
𝑐ሶ → 𝑥2 = 𝑐ሶ
𝑐ሷ → 𝑥3 = 𝑐ሷ
3) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the variables.
𝑥1 = 𝑐 → 𝑥1ሶ = 𝑐ሶ
𝑥2 = 𝑐ሶ → 𝑥2ሶ = 𝑐ሷ
𝑥3 = 𝑐ሷ → 𝑥3ሶ = 𝑐ഺ
4) Substitute the states and the dynamics into the differential equations. If there is a conflict, use the states
34
Transfer Function to State-Space
5) Define the dynamics as a function of the states
𝑥1ሶ = 𝑐ሶ → 𝑥1ሶ = 𝑥2
𝑥2ሶ = 𝑐ሷ → 𝑥2ሶ = 𝑥3
𝑥3ሶ + 9𝑥3 + 26𝑥2 + 24𝑥1 = 24𝑟 → 𝑥3ሶ = −24𝑥1 − 26𝑥2 − 9𝑥3 + 24𝑟
These 3 equations are the states equations. So what we’ve done is take the original 3rd order differential equations
and change them into 3 first order differential equations
6) Expand out the dynamics to include all of the states (optional step)
𝑥3ሶ + 9𝑥3 + 26𝑥2 + 24𝑥1 = 24𝑟 → 𝑥3ሶ = −24𝑥1 − 26𝑥2 − 9𝑥3 + 24𝑟
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑥1ሶ 0 1 0 𝑥1 0
𝑥2ሶ = 0 0 1 𝑥2 + 0 𝑟
𝑥3ሶ −24 −26 𝑥
−9 3 24
35
Transfer Function to State-Space
8) Finally express the state-space model for the output x1
Output is represented by y
𝑦 = 𝐂𝐱 + 𝐃𝑢
𝑦 = 𝑐 = 𝑥1
Express as matrix
𝑥1
𝑦 = 1 0 0 𝑥2
𝑥3
36
Transfer Function to State-Space
Example: Find the state-space representation for the transfer function. Output is x1.
This problem differs since the numerator has a polynomial instead of just a constant.
37
Transfer Function to State-Space
Example: Find the state-space representation for the transfer function. Output is x1.
This problem differs since the numerator has a polynomial instead of just a constant.
1) Separate system into 2 blocks. First block has denominator and second block has numerator.
2) Find the state equations for the block containing the denominator (first block)
𝑥1ሶ 0 1 0 𝑥1 0
𝑥2ሶ = 0 0 1 𝑥2 + 0 𝑟
𝑥3ሶ −24 −26 𝑥
−9 3 1
38
Transfer Function to State-Space
h(t)
https://en.wikibooks.org/wiki/Control_Systems/Block_Diagrams
39
Transfer Function to State-Space
3) Introduce the effect of the block with the numerator
𝐶 𝑠 𝑠 2 + 7𝑠 + 2
=
𝑋1 𝑠 1
Cross-multiplying yields
𝐶 𝑠 = 𝑠 2 + 7𝑠 + 2 𝑋1 𝑠
𝑐 = 𝑥ሷ + 7𝑥ሶ + 2𝑥
40
Transfer Function to State-Space
𝑐 = 𝑥ሷ + 7𝑥ሶ + 2𝑥
𝑥 → 𝑥1 = 𝑥
𝑥ሶ → 𝑥2 = 𝑥ሶ
𝑥ሷ → 𝑥3 = 𝑥ሷ
3.3) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the variables.
𝑥1 = 𝑥 → 𝑥1ሶ = 𝑥ሶ
𝑥2 = 𝑥ሶ → 𝑥2ሶ = 𝑥ሷ
𝑥3 = 𝑥ሷ → 𝑥3ሶ = 𝑥ഺ
3.4) Substitute the states and the dynamics into the differential equations. If there is a conflict, use the states
41
Transfer Function to State-Space
3.5) Define the output
Note that the process is different here, because c is actually the output. So we do not define the dynamics here,
rather we are defining the output.
𝑦 = 𝑐 𝑡 = 2𝑥1 + 7𝑥2 + 𝑥3
𝑦 = 𝐂𝐱 + 𝐃𝑢
𝑥1
𝑦 = 2 7 1 𝑥2
𝑥3
42
Transfer Function to State-Space
Example: Find the state equations and output equation for the transfer function G(s).
𝑋 𝑠 2𝑠 + 1
𝐺 𝑠 = = 2
𝑅 𝑠 𝑠 + 7𝑠 + 9
5 minutes
𝑥1ሶ −9 1 𝑥1 0 𝑥1ሶ −9 −7 𝑥1 0
a) = + 𝑟 b) = + 𝑟
𝑥2ሶ 0 −7 𝑥2 1 𝑥2ሶ 1 0 𝑥2 1
𝑥1 𝑥1
𝑦= 1 2 𝑥 𝑦= 1 2 𝑥
2 2
𝑥1ሶ 0 1 𝑥1 0 𝑥1ሶ 0 −9 𝑥1 0
c) = + 𝑟 d) = + 𝑟
𝑥2ሶ −9 −7 𝑥2 1 𝑥2ሶ −7 1 𝑥2 1
𝑥1 𝑥1
𝑦= 1 2 𝑥 𝑦= 1 2 𝑥
2 2
43
Transfer Function to State-Space
Example: Find the state equations and output equation for the transfer function G(s).
𝑋 𝑠 2𝑠 + 1
𝐺 𝑠 = = 2
𝑅 𝑠 𝑠 + 7𝑠 + 9
This problem differs since the numerator has a polynomial in s instead of just a constant term
1) Separate system into 2 blocks. First block has denominator and second block has numerator.
1
2𝑠 + 1
𝑠 2 + 7𝑠 + 9
2) Find the state equations for the block containing the denominator (first block)
𝑠 2 + 7𝑠 + 9 𝑋 𝑠 = 𝑅 𝑠 → 𝑠 2 𝑋 𝑠 + 7𝑠𝑋 𝑠 + 9𝑋 𝑠 = 𝑅 𝑠
𝑥ሷ + 7𝑥ሶ + 9𝑥 = 𝑟
44
Transfer Function to State-Space
𝑥ሷ + 7𝑥ሶ + 9𝑥 = 𝑟
𝑥 → 𝑥1 = 𝑥
𝑥ሶ → 𝑥2 = 𝑥ሶ
2.3) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the variables.
𝑥1 = 𝑥 → 𝑥1ሶ = 𝑥ሶ = 𝑥2
𝑥2 = 𝑥ሶ → 𝑥2ሶ = 𝑥ሷ
2.4) Substitute the states and the dynamics into the differential equations. If there is a conflict, use the states
𝑥1ሶ = 𝑥2 → 𝑥1ሶ = 𝑥2
These 2 equations are the states equations. So what we’ve done is take the original 2nd order differential equations
and change them into 2 first order differential equations
45
Transfer Function to State-Space
2.6) Expand out the dynamics to include all of the states (optional step)
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑥1ሶ 0 1 𝑥1 0
= 𝑥 + 𝑟
𝑥2ሶ −9 −7 2 1
46
Transfer Function to State-Space
3) Introduce the effect of the block with the numerator
1
2𝑠 + 1
𝑠 2 + 7𝑠 + 9
𝐶 𝑠 2𝑠 + 1
=
𝑋1 𝑠 1
Cross-multiplying yields
𝐶 𝑠 = 2𝑠 + 1 𝑋1 𝑠
𝑐 = 2𝑥ሶ + 𝑥
47
Transfer Function to State-Space
𝑐 = 2𝑥ሶ + 𝑥
3.4) Substitute the states into the differential equations. The states were already
defined in step (2)
𝑐 = 2𝑥ሶ + 𝑥 → 𝑐 = 2𝑥2 + 𝑥1
𝑦 = 𝑐 𝑡 = 𝑥1 + 2𝑥2
𝑦 = 𝐂𝐱 + 𝐃𝑢
𝑥1
𝑦= 1 2 𝑥
2
48
State-Space Linearization
Example: First represent the simple pendulum in state space: Mg is the weight, T is an applied torque
in the u direction, and L is the length of the pendulum. Assume the mass is evenly distributed, with
the center of mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
49
State-Space Linearization
1) First find the equation of motion using the sum of torques
𝑀𝑔𝐿
𝐽𝜃ሷ + sin 𝜃 = 𝑇
2
2) Find state-space model
𝜃 → 𝑥1 = 𝜃
𝜃ሶ → 𝑥2 = 𝜃ሶ
2.3) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the variables.
𝑥1 = 𝜃 → 𝑥1ሶ = 𝜃ሶ = 𝑥2
𝑥2 = 𝜃ሶ → 𝑥2ሶ = 𝜃ሷ
2.4) Substitute the states and the dynamics into the differential equations. If there is a conflict, use the states
𝑀𝑔𝐿 𝑀𝑔𝐿
𝐽𝜃ሷ + sin 𝜃 = 𝑇 → 𝐽𝑥2ሶ + sin 𝑥1 = 𝑇
2 2
𝑥1ሶ = 𝑥2 → 𝑥1ሶ = 𝑥2
𝑀𝑔𝐿 𝑀𝑔𝐿 𝑇
𝐽𝑥2ሶ + sin 𝑥1 = 𝑇 → 𝑥2ሶ = − sin 𝑥1 −
2 2𝐽 𝐽
50
State-Space Linearization
𝑀𝑔𝐿 𝑇
𝑥1ሶ = 𝑥2 , 𝑥2ሶ = − sin 𝑥1 −
2𝐽 𝐽
As I mentioned equilibrium point 𝑥1,0 and 𝑥2,0 (remember x0) should be zero when the system is not moving
𝑥1,0 = 𝑥2,0 = 0
Substitute
𝛿𝑥ሶ 1 = 𝛿𝑥2
𝑀𝑔𝐿 𝑇
𝛿𝑥ሶ 2 = − sin 𝛿𝑥1 −
2𝐽 𝐽
51
State-Space Linearization
3.3) Linearize nonlinear terms using 𝑓 𝑥 ≈ 𝑓 𝑥0 + 𝑚𝑎 𝛿𝑥
𝑓 𝑥 = sin 𝛿𝑥1
𝑓 𝑥0 = sin 0 = 0
small angle
𝑑𝑓 𝑥0 𝑑𝑓 sin 𝛿𝑥1 approximation
= 𝑚𝑎 = ቤ = cos 0 = 1
𝑑𝑥 𝑑𝛿𝑥1 𝛿𝑥 1 =0
sin 𝑥1 ≈ 𝛿𝑥1
𝛿𝑥ሶ 1 = 𝛿𝑥2
𝑀𝑔𝐿 𝑇
𝛿𝑥ሶ 2 = − 𝛿𝑥1 −
2𝐽 𝐽
𝑥ሶ = 𝐴𝑥 + 𝐵𝑢
0 1
𝛿𝑥ሶ 1 𝑀𝑔𝐿 𝛿𝑥1 0
= 0 𝛿𝑥2 + 𝑇
𝛿𝑥ሶ 2 1/𝐽
2𝐽
52
State-Space Linearization
Example: Represent the translational mechanical system state space about the equilibrium
displacement. The spring is nonlinear, where the relationship between the spring force, fs(t), and the
spring displacement, xs(t), is fs(t) = 2𝑥𝑠2 (t). The system is in equilibrium when the spring force is
equal to 10 N. The applied force is f(t) = 10 + δf(t). Assume the output to be the displacement of the
mass, x(t).
5 minutes!
53
State-Space Linearization
Example: Represent the translational mechanical system state space about the equilibrium
displacement. The spring is nonlinear, where the relationship between the spring force, fs(t), and the
spring displacement, xs(t), is fs(t) = 2𝑥𝑠2 (t). The system is in equilibrium when the spring force is
equal to 10 N. The applied force is f(t) = 10 + δf(t). Assume the output to be the displacement of the
mass, x(t).
𝑓𝑠,0 𝑡 = 2𝑥02 = 10
𝑥0 = 5
54
State-Space Linearization
Example: Represent the translational mechanical system state space about the equilibrium
displacement. Equilibrium point is x0 = 5. The applied force is f(t) = 10 + δf(t). Assume the output
to be the displacement of the mass, x(t).
𝑥ሷ + 2𝑥 2 = 10 + 𝛿𝑓(𝑡)
𝑥 = 5 + 𝛿𝑥1
Substitute
ሷ
5 + 𝛿𝑥1 + 2( 5 + 𝛿𝑥1 )2 = 10 + 𝛿𝑓(𝑡)
2
ሷ 𝑑 5 + 𝛿𝑥 𝑑2 𝛿𝑥
5 + 𝛿𝑥1 = 2
= 2
= 𝛿𝑥ሷ 1
𝑑𝑡 𝑑𝑡
55
State-Space Linearization
2.2) Linearize nonlinear terms using 𝑓 𝑥 ≈ 𝑓 𝑥0 + 𝑚𝑎 𝛿𝑥
𝑓 𝑥 = ( 5 + 𝛿𝑥1 )2
2
𝑓 𝑥0 = 5 = 5
𝑑𝑓 𝑥 𝑑(𝑥 2 )
ቤ = 𝑚𝑎 = อ = 2𝑥0 ቚ =2 5
𝑑𝑥 𝑥 𝑑𝑥 5
0 𝑥0
( 5 + 𝛿𝑥1 ) ≈ 5 + 2 5𝛿𝑥
56
State-Space Linearization
3) Find state-space
𝛿𝑥 → 𝑥1 = 𝛿𝑥
𝛿𝑥ሶ → 𝑥2 = 𝛿𝑥ሶ
3.2) Use original equations to define the dynamics of the system. Just “dot” of the states to obtain the
variables.
𝑥1 = 𝛿𝑥 → 𝑥1ሶ = 𝛿𝑥ሶ = 𝑥2
3.3) Substitute the states and the dynamics into the differential equations. If there is a conflict, use
the states
𝐱ሶ = 𝐀𝐱 + 𝐁𝑢
𝑥1ሶ 0 1 𝑥1 0
= + 𝛿𝑓(𝑡)
𝑥2ሶ −4 5 0 𝑥2 1
58
State-Space Linearization
Example: Consider the mechanical system. If the spring is nonlinear, and the force, Fs, required to
stretch the spring is Fs = 2𝑥12 , represent the system in state space linearized about x1 = 1 if the output
is x2.
5 minutes!
59
State-Space Linearization
Example: Consider the mechanical system. If the spring is nonlinear, and the force, Fs, required to
stretch the spring is Fs = 2𝑥12 , represent the system in state space linearized about x1 = 1 if the output
is x2.
60
State-Space
➢ This is the end of state-space modeling.
➢ Next topics after the holiday are Poles and Time Response.
61
Homework
Read
✓1.1, 1.3, 1.4
✓2.1, 2.2, 2.3, 2.5, 2.6, 2.7, 2.10, 2.11
✓3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7
62
Homework
C3P4. Represent the system in state space where the output is x3(t).
63
Homework
C3P11. For each system, write the state equations and the output equation.
64
Homework
C3P13. Represent the following transfer function in state space. Give your answer in
vector-matrix form.
𝑠 2 + 3𝑠 + 8
𝑇 𝑠 =
𝑠 + 1 𝑠 2 + 5𝑠 + 5
65
Homework
C3P14. Find the transfer function G(s) = Y(s)/R(s) for each of the following systems
represented in state space:
66
Homework
C3P20. Consider the mechanical system. If the spring is nonlinear, and the force, Fs,
required to stretch the spring is Fs = 2𝑥12 , represent the system in state space linearized
about x1 = 1 if the output is x2.
67
68