Transform Transfer Function To State Space Representation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Transform Transfer Function to

State Space Representation


Manually
by: Kayun Chantarasathaporn
dr.kayun@gmail.com

1
Basic Case
(Fixed Numerical Numerator)

2
Inverse Laplace used in this task
• Getting from https://youtu.be/kCOVdSxUWzQ

3
Transfer Function
𝐶(𝑠) 2
• =
𝑅(𝑠) 𝑠3 −3𝑠 2 −10𝑠+24 Order = 3

R(s) 2 C(s)
𝑠 3 − 3𝑠 2 − 10𝑠 + 24

• Find state space representation of the above transfer function.

4
How to find state space representation from
transfer function • Let
• 𝑥1 = c = y
𝐶(𝑠) 2
• = • Diff 𝑥1 =>
𝑑𝑥1
=>
𝑑𝑦
𝑅(𝑠) 𝑠3 −3𝑠2 −10𝑠+24 𝑑𝑡 𝑑𝑡
• Rewrite it as 𝑥1ሶ
• Cross multiply both sides of the transfer • Because 𝑥1 = c
function • So 𝑥1ሶ = 𝑐ሶ
(s 3 − 3s 2 − 10s + 24)C(s)=2R(s) --- (1) • 𝑥2 = 𝑥1ሶ = 𝑐ሶ
𝑑𝑥2 𝑑 2 𝑥1 𝑑2𝑦
s 3 C(s) − 3s 2 C(s) − 10sC(s) + 24C(s)=2R(s) --- (2) • Diff 𝑥2 => => =>
𝑑𝑡 𝑑𝑡 2 𝑑𝑡 2
• Rewrite it as 𝑥2ሶ
• Find the corresponding differential equation • Because 𝑥2 = 𝑐ሶ
(using inverse Laplace transform by assuming • So 𝑥2ሶ = 𝑐ሷ
all initial conditions as ZERO) • 𝑥3 = 𝑥2ሶ = 𝑐ሷ
𝑑3𝑦 𝑑2𝑦 𝑑𝑦 𝑑𝑥3 𝑑 2 𝑥2 𝑑 3 𝑥1 𝑑3𝑦
− 3 2 − 10 + 24y = 24r --- (3) • Diff 𝑥3 => 𝑑𝑡
=> 2
𝑑𝑡
=> 3
𝑑𝑡
=> 𝑑𝑡 3
𝑑𝑡 3 𝑑𝑡 𝑑𝑡
• Rewrite it as 𝑥3ሶ
• Write in another format • Because 𝑥3 = 𝑐ሷ
𝑐ഺ − 3𝑐ሷ − 10𝑐ሶ + 24𝑐 = 24𝑟 --- (4) • So 𝑥3ሶ =ഺ
𝑐
5
How to find state space representation from
transfer function (cont.) • Let
• 𝑥1 = c = y
• (3) and (4) are the same. They were just written in 𝑑𝑥1 𝑑𝑦
different format. • Diff 𝑥1 => =>
𝑑𝑡 𝑑𝑡
𝑑3 𝑦 𝑑2 𝑦 𝑑𝑦 • Rewrite it as 𝑥1ሶ
𝑑𝑡 3
− 3 𝑑𝑡 2− 10 𝑑𝑡 + 24y = 24r --- (3)
• Because 𝑥1 = c
𝑐ഺ − 3𝑐ሷ − 10𝑐ሶ + 24𝑐 = 24𝑟 --- (4)
• So 𝑥1ሶ = 𝑐ሶ
• We can rewrite (4) as • 𝑥2 = 𝑥1ሶ = 𝑐ሶ
𝑐ഺ − 3𝑥3 − 10𝑥2 + 24𝑥1 = 24𝑟 --- (5) 𝑑𝑥2 𝑑 2 𝑥1 𝑑2𝑦
From above, we can notice that • Diff 𝑥2 => => =>
𝑑𝑡 𝑑𝑡 2 𝑑𝑡 2
𝑥1 = c = y • Rewrite it as 𝑥2ሶ
𝑑𝑦 • Because 𝑥2 = 𝑐ሶ
𝑥2 = 𝑐ሶ = 𝑑𝑡 • So 𝑥2ሶ = 𝑐ሷ
𝑑2𝑦
𝑥3 = 𝑐ሷ = 𝑑𝑡 2
• 𝑥3 = 𝑥2ሶ = 𝑐ሷ
𝑑𝑥3 𝑑 2 𝑥2 𝑑 3 𝑥1 𝑑3𝑦
• From (5) we can rewrite as • Diff 𝑥3 => 𝑑𝑡
=> 2
𝑑𝑡
=> 3
𝑑𝑡
=> 𝑑𝑡 3
𝑐ഺ = 3𝑥3 + 10𝑥2 − 24𝑥1 + 24𝑟 --- (6) • Rewrite it as 𝑥3ሶ
• Because 𝑥3 = 𝑐ሷ
• So 𝑥3ሶ =ഺ
𝑐
6
How to find state space representation from
transfer function (cont.)
• From previous page, we can notice that
𝑥1 𝑥2 𝑥3 r
𝑥1 = c = y 𝑥ሶ 1 = 𝑥2
𝑑𝑦 𝑥ሶ 1 = 𝑐ሶ
𝑥2 = 𝑐ሶ = 𝑥ሶ 2 = 𝑥3 𝑥1ሶ 0 1 0 0
𝑑𝑡 𝑥ሶ 2 = 𝑐ሷ 𝑥3ሶ = 𝑐ഺ
𝑑2𝑦 𝑥3ሶ = 𝑐ഺ
𝑥3 = 𝑐ሷ = 2 y = 𝑥1
𝑑𝑡
𝑥2ሶ 0 0 1 0
• From (6) we can rewrite as
𝑐ഺ = 3𝑥3 + 10𝑥2 − 24𝑥1 + 24𝑟 --- (6) 𝑥3ሶ -24 10 3 24
or
𝑐ഺ = −24𝑥1 + 10𝑥2 + 3𝑥3 + 24𝑟 --- (7) y 1 0 0

7
How to find state space representation from
transfer function (cont.)
𝑥1 𝑥2 𝑥3 r 𝑥1ሶ 0 1 0 𝑥1 0
• 𝑥2ሶ = 0 0 1 𝑥2 + 0 r
𝑥1ሶ 0 1 0 0 𝑥3ሶ −24 10 3 𝑥3 24

𝑥2ሶ 0 0 1 0
𝑥1
𝑥3ሶ -24 10 3 24
• y= 1 0 0 𝑥2
y 1 0 0 𝑥3

8
How to find state space representation from
transfer function (cont.)
𝑥1ሶ 0 1 0 𝑥1 0
• 𝑥2ሶ = 0 0 1 𝑥2 + 0 r Xሶ = AX + BU
𝑥3ሶ −24 10 3 𝑥3 24
𝑥1 0
• y= 1 0 0 𝑥2 𝑦 = CX + DU
𝑥3
A: system matrix 0 1 0 0
X: state vector
B: input matrix
• Xሶ = 0 0 1 X+ 0 r
U: input vector −24 10 3 24
y: output vector
C: output matrix
D: feed-forward matrix • y= 1 0 0X
9
Intermediate Case
(Polynomial Equation Numerator)

10
Transfer Function
𝐶(𝑠) 5𝑠+10
• =
𝑅(𝑠) 𝑠4 +2𝑠 3 +𝑠2 +5𝑠+10 Order = 4

R(s) 5𝑠 + 10 C(s)
𝑠 4 + 2𝑠 3 + 𝑠 2 + 5𝑠 + 10

• Find state space representation of the above transfer function.

11
How to find state space representation from
transfer function (Polynomial Numerator)
• Separate the system to 2 cascaded blocks

R(s) C(s)
5𝑠 + 10
𝑠 4 + 2𝑠 3 + 𝑠 2 + 5𝑠 + 10

state variable F
R(s) 1
F(s) C(s)
5s+10
𝑠 4 + 2𝑠 3 + 𝑠 2 + 5𝑠 + 10

Denominator Numerator
12
How to find state space representation from transfer
function (Polynomial Numerator) • Let
• 𝑥 =f
• Getting state equation 1
• Diff 𝑥1 =>
𝑑𝑥1
<=
𝑑𝑓
𝑑𝑡 𝑑𝑡
𝐹(𝑠) 1 • Rewrite it as 𝑥1ሶ
• =
𝑅(𝑠) 𝑠 4 +2𝑠 3 +𝑠 2 +5𝑠+10 • 𝑥2 =𝑥1ሶ
• Cross multiply both sides of the transfer function • Diff 𝑥2 =>
𝑑𝑥2
𝑑𝑡
<=
𝑑2 𝑓
𝑑𝑡 2
(𝑠 4 +2𝑠 3 + 𝑠 2 + 5𝑠 + 10) 𝐹(s)=R(s) --- (1) • Rewrite it as 𝑥2ሶ
𝑠 4 𝐹(s) + 2𝑠 3 𝐹(s) + 𝑠 2 𝐹(s) + 5𝑠𝐹(s) + 10𝐹(s) =R(s) --- (2) • Because 𝑥2 = 𝑥1ሶ
• So 𝑥2ሶ = 𝑥1ሷ
• Find the corresponding differential equation (using • 𝑥3 = 𝑥2ሶ = 𝑥1ሷ
inverse Laplace transform by assuming all initial 𝑑𝑥 𝑑3 𝑓
conditions as ZERO) • Diff 𝑥3 => 3
𝑑𝑡
<= 3
𝑑𝑡
𝑑4 𝑓 𝑑3 𝑓 𝑑2 𝑓 𝑑𝑓 • Rewrite it as 𝑥3ሶ
+ 2 3 + +5 + 10f = r --- (3)
𝑑𝑡 4 𝑑𝑡 𝑑𝑡 2 𝑑𝑡 • Because 𝑥3 = 𝑥2ሶ = 𝑥1ሷ
• Write in another format • So 𝑥3ሶ =𝑥2ሷ = 𝑥ഺ1
𝑥1ሶ 4 + 2𝑥ഺ1 + 𝑥1ሷ + 5𝑥1ሶ + 10𝑥1 = 𝑟 --- (4) • 𝑥4 = 𝑥3ሶ =𝑥2ሷ = 𝑥ഺ1
𝑑4 𝑓
𝑥1ሶ 4 = −2𝑥ഺ1 − 𝑥1ሷ − 5𝑥1ሶ − 10𝑥1 + 𝑟 --- (5) • Diff 𝑥4 =>
𝑑𝑥4
<=
𝑑𝑡 𝑑𝑡 4
𝑥1ሶ 4 = −2𝑥4 − 𝑥3 − 5𝑥2 − 10𝑥1 + 𝑟 --- (6) • Rewrite it as 𝑥4ሶ
𝑥4ሶ = −2𝑥4 − 𝑥3 − 5𝑥2 − 10𝑥1 + 𝑟 --- (7) • Because 𝑥4 = 𝑥3ሶ =𝑥2ሷ = 𝑥ഺ1
• So 𝑥4ሶ =𝑥3ሷ = 𝑥ഺ2 = 𝑥131ሶ 4
How to find state space representation from transfer
function (Polynomial Numerator) (cont.)
• From previous page, we can notice that • Getting state equation
𝐹𝑟𝑜𝑚 𝑥1 …
𝑥2 =𝑥1ሶ 𝑥1 𝑥2 𝑥3 𝑥4 r
𝑥3 = 𝑥2ሶ = 𝑥1ሷ
𝑥4 = 𝑥3ሶ =𝑥2ሷ = 𝑥ഺ1 𝑥1ሶ 0 1 0 0 0
f = 𝑥1
• From (7) which is 𝑥2ሶ 0 0 1 0 0
𝑥4ሶ = −2𝑥4 − 𝑥3 − 5𝑥2 − 10𝑥1 + 𝑟 --- (7)
𝑥3ሶ 0 0 0 1 0
we can rewrite as
𝑥4ሶ = −10𝑥1 − 5𝑥2 − 𝑥3 − 2𝑥4 + 𝑟 --- (7) 𝑥4ሶ -10 -5 -1 -2 1

14
How to find state space representation from transfer function
(Polynomial Numerator)
• Getting output equation
𝐶(𝑠) 5𝑠+10
• =
𝐹(𝑠) 1
• Cross multiply both sides of the transfer function
(5𝑠 + 10) 𝐹 (s) = C(s) --- (1) • Let
5𝑠𝐹(s) + 10𝐹 (s) = C(s) --- (2) • 𝑥1 = f
𝑑𝑥1 𝑑𝑓
• Find the corresponding differential equation (using inverse • Diff 𝑥1 => <=
Laplace transform by assuming all initial conditions as ZERO) 𝑑𝑡 𝑑𝑡
𝑑𝑓 • Rewrite it as 𝑥1ሶ
5 + 10f = c --- (3)
𝑑𝑡
• 𝑥2 =𝑥1ሶ
• Let substitute 'c' with 'y' as it is often use in state space
𝑑𝑓
5 𝑑𝑡 + 10f = y --- (4)
• Write in another format
5𝑥1ሶ + 10𝑥1 = 𝑦 --- (5) 𝑦 10 5 0 0
𝑦 = 5𝑥1ሶ + 10𝑥1 --- (6)
𝑦 = 5𝑥2 + 10𝑥1 --- (7)
𝑦 = 10𝑥1 + 5𝑥2 + 0𝑥3 + 0𝑥4 --- (8)
15
How to find state space representation from transfer
function (Polynomial Numerator) (cont.)
• Getting state equation
𝑥1 𝑥2 𝑥3 𝑥4 r
𝑥1ሶ 0 1 0 0 𝑥1 0
𝑥1ሶ 0 1 0 0 0 𝑥2ሶ 0 0 1 0 𝑥2 0
• = 𝑥3 + r
𝑥3ሶ 0 0 0 1 0
𝑥2ሶ 0 0 1 0 0 𝑥4ሶ −10 −5 −1 −2 𝑥4 1

𝑥3ሶ 0 0 0 1 0 • Getting output equation


𝑥1
𝑥4ሶ -10 -5 -1 -2 1 𝑥2
• y = 10 5 0 0 𝑥
3
𝑦 10 5 0 0 𝑥4

16
How to find state space representation from
transfer function (Polynomial Numerator) (cont.)

17
Source: https://youtu.be/zcIFm7IbEmY
How to find state space representation from
transfer function (Polynomial Numerator) (cont.)
• Getting state equation ('u' in this case is 'r')

𝑥1ሶ 0 1 0 0 𝑥1 0
𝑥2ሶ 0 0 1 0 𝑥2 0
= 𝑥3 + r
𝑥3ሶ 0 0 0 1 0
𝑥4ሶ −10 −5 −1 −2 𝑥4 1

• Getting output equation


𝑥1
𝑥2
y = 10 5 0 0 𝑥
3
𝑥4

18
Transform Transfer Function to
State Space Representation
Manually
by: Kayun Chantarasathaporn
dr.kayun@gmail.com

19

You might also like