State-Space Models for Engineers
State-Space Models for Engineers
x instead of x(t)
dx
ẋ instead of x0 (t) or
dt
d2 x
ẍ instead of x00 (t) or 2
dt
etc.
Ach
i
=
Example 1: Mass-Spring System
x
m u
Example 1: Mass-Spring System
x
m u
m u
m u
m u
m u
m u
mẍ + ⇢ẋ + kx = u
Example 1: Mass-Spring System
x
m u
m u
m u
⇢ k u
ẍ + ẋ + x = 2nd-order linear ODE
m m m
Example 1: Mass-Spring System
m u
⇢ k u
ẍ + ẋ + x = 2nd-order linear ODE
m m m
m u
⇢ k u
ẍ + ẋ + x = 2nd-order linear ODE
m m m
ẋ = v (definition of velocity)
⇢ k 1
v̇ = v x+ u
m m m
Example 1: Mass-Spring System
x
m u
✓ ◆ ✓ ◆✓ ◆ ✓ ◆
ẋ 0 1 x 0
= k ⇢ + 1 u
v̇ m m v m
Example 1: Mass-Spring System
x
m u
✓ ◆ ✓ ◆✓ ◆ ✓ ◆
ẋ 0 1 x 0
= k ⇢ + 1 u
v̇ m m v m
Gestater O-ip
xn um
matrix
0 1 0 10 1
0 10 1
ẋ1 A x1 B u1
.
@ .. A = @ .
A @ .. A + @ A @ ... A
n⇥n n⇥m
ẋn matrix xn matrix um
-atsegn
of egn
General n-Dimensional State-Space Model
0 1 0 1
x1 u1
B C B C
state x = @ ... A 2 Rn input u = @ ... A 2 Rm
xn um
0 1 0 10 1 0 10 1
ẋ1 A x1 B u1
.
@ .. A = @ .
A @ .. A + @ A @ ... A
n⇥n n⇥m
ẋn matrix xn matrix um
Dr
ẋ = Ax + Bu
Partial Measurements
0 1 0 1
x1 u1
B C B C
state x = @ ... A 2 Rn input u = @ ... A 2 Rm
xn um
Partial Measurements
0 1 0 1
x1 u1
B C B C
state x = @ ... A 2 Rn input u = @ ... A 2 Rm
xn um
0 1
y1
B .. C
output y = @ . A 2 Rp y = Cx C– p ⇥ n matrix
yp
Partial Measurements
0 1 0 1
x1 u1
B C B C
state x = @ ... A 2 Rn input u = @ ... A 2 Rm
xn um
0 1
y1
B .. C
output y = @ . A 2 Rp y = Cx C– p ⇥ n matrix
yp
ẋ = Ax + Bu
y = Cx
Partial Measurements
0 1 0 1
x1 u1
B C B C
state x = @ ... A 2 Rn input u = @ ... A 2 Rm
xn um
0 1
y1
B .. C
output y = @ . A 2 Rp y = Cx C– p ⇥ n matrix
yp
ẋ = Ax + Bu
y = Cx
Example: if we only care about (or can only measure) x1 , then
0 1
x1
B x2 C
B C
y = x1 = 1 0 . . . 0 B . C
@ .. A
xn
State-Space Models: Bottom Line
ẋ = Ax + Bu
y = Cx
State-Space Models: Bottom Line
ẋ = Ax + Bu
y = Cx
State-space models are useful and convenient for
writing down system models for di↵erent types
of systems, in a unified manner.
State-Space Models: Bottom Line
ẋ = Ax + Bu
y = Cx
State-space models are useful and convenient for
writing down system models for di↵erent types
of systems, in a unified manner.
ẋ = Ax + Bu
y = Cx
State-space models are useful and convenient for
writing down system models for di↵erent types
of systems, in a unified manner.
VS + RI + LI˙ = 0
Example 2: RL Circuit
+ VR
+ +
VS I VL
VS + RI + LI˙ = 0
R 1
I˙ = I + VS (1st-order system)
L L
Example 2: RL Circuit
+ VR
+ +
VS I VL
VS + RI + LI˙ = 0
R 1
I˙ = I + VS (1st-order system)
L L
I – state, VS – input
Example 2: RL Circuit
+ VR
+ +
VS I VL
VS + RI + LI˙ = 0
R 1
I˙ = I + VS (1st-order system)
L L
I – state, VS – input
Q: How should we change the circuit in order to implement a
2nd-order system?
Example 2: RL Circuit
+ VR
+ +
VS I VL
VS + RI + LI˙ = 0
R 1
I˙ = I + VS (1st-order system)
L L
I – state, VS – input
Q: How should we change the circuit in order to implement a
2nd-order system? A: Add a capacitor.
spring-Mass-Damper
///////
I ke for
41a -
-
#11 F
.
x Ma Mc
F
:
kx
=
- -
I
tait Jude Gener
Cinci .
sE
e
*
WR
I
from kUL
I
t
iR
0 +
! fidt
=
+
L 02
-
C
-
-
-
I = da
-
-
At
R+Ld
I7
Y
=
V Hee
F
=
<>
MES L >
- (9 Ri 14
=
0 +
+
k >
Y
~ :
*
↳L-c circuit : -
Hoy
-
Delive Force to Current Analogy ·
· C
Example 3: Pendulum
✓ `
✓
Te
external
mg sin ✓ torque
mg
Example 3: Pendulum
Newton’s 2nd law (rotational motion):
✓ `
✓
Te
external
mg sin ✓ torque
mg
Example 3: Pendulum
Newton’s 2nd law (rotational motion):
✓ `
✓ T = |{z}
|{z} J ↵
|{z}
Te total moment angular
external torque of inertia acceleration
mg sin ✓ torque
mg
Example 3: Pendulum
Newton’s 2nd law (rotational motion):
✓ `
✓ T = |{z}
|{z} J ↵
|{z}
Te total moment angular
external torque of inertia acceleration
mg sin ✓ torque
= pendulum torque + external torque
mg
Example 3: Pendulum
Newton’s 2nd law (rotational motion):
✓ `
✓ T = |{z}
|{z} J ↵
|{z}
Te total moment angular
external torque of inertia acceleration
mg sin ✓ torque
= pendulum torque + external torque
mg
pendulum torque = mg sin ✓ · |{z}
`
| {z }
force lever arm
Example 3: Pendulum
Newton’s 2nd law (rotational motion):
✓ `
✓ T = |{z}
|{z} J ↵
|{z}
Te total moment angular
external torque of inertia acceleration
mg sin ✓ torque
= pendulum torque + external torque
mg
pendulum torque = mg sin ✓ · |{z}
`
| {z }
force lever arm
2
moment of inertia J = m`
Example 3: Pendulum
Newton’s 2nd law (rotational motion):
✓ `
✓ T = |{z}
|{z} J ↵
|{z}
Te total moment angular
external torque of inertia acceleration
mg sin ✓ torque
= pendulum torque + external torque
mg
pendulum torque = mg sin ✓ · |{z}
`
| {z }
force lever arm
2
moment of inertia J = m`
g 1
✓¨ = sin ✓ + Te (nonlinear equation)
` m`2
Example 3: Pendulum
g 1
✓¨ = sin ✓ + Te (nonlinear equation)
` m`2
Example 3: Pendulum
g 1
✓¨ = sin ✓ + Te (nonlinear equation)
` m`2
For small ✓, use the approximation sin ✓ ⇡ ✓
Example 3: Pendulum
g 1
✓¨ = sin ✓ + Te (nonlinear equation)
` m`2
For small ✓, use the approximation sin ✓ ⇡ ✓
3 g 1
sinHqL ✓¨ = ✓+ Te
2 ` m`2
q 1
-3 -2 -1 1 2 3
-1
-2
-3
Example 3: Pendulum
g 1
✓¨ = sin ✓ + Te (nonlinear equation)
` m`2
For small ✓, use the approximation sin ✓ ⇡ ✓
3 g 1
sinHqL ✓¨ = ✓+ Te
2 ` m`2
q 1
State-space form: ✓1 = ✓, ✓2 = ✓˙
-3 -2 -1 1 2 3
-1 g 1 g 1
✓˙2 = ✓+ Te = ✓1 + Te
-2 ` m`2 ` m`2
-3
Example 3: Pendulum · =
-sina . 12Te
g 1
✓¨ = sin ✓ + Te (nonlinear equation)
` m`2
For small ✓, use the approximation sin ✓ ⇡ ✓
3 g 1
sinHqL ✓¨ = ✓+ Te
2 ` m`2
q 1
State-space form: ✓1 = ✓, ✓2 = ✓˙
-3 -2 -1 1 2 3
-1 g 1 g 1
✓˙2 = ✓+ Te = ✓1 + Te
-2 ` m`2 ` m`2
-3
✓ ◆ ✓ ◆✓ ◆ ✓ ◆
✓˙1 0 1 ✓1 0
= g + Te
✓˙2 ` 0 ✓ 2
1
m` 2
Linearization
Taylor series expansion:
1
f (x) = f (x0 ) + f 0 (x0 )(x x0 ) + f 00 (x0 )(x x0 )2 + . . .
! 2
⇡ f (x0 ) + f 0 (x0 )(x x0 ) linear approximation around x = x0
Linearization
Taylor series expansion:
1
f (x) = f (x0 ) + f 0 (x0 )(x x0 ) + f 00 (x0 )(x x0 )2 + . . .
2
⇡ f (x0 ) + f 0 (x0 )(x x0 ) linear approximation around x = x0
~
~
↳4
·
Y
- >
- ->
Ax+BU x
·
X
↑ I -
=
->
2x 34+ -- Culin
+
2 x
+
,
CX ,
=
y
-
-
Linearization
Linear approx. around (x, u) = (0, 0) to all components of f :
For each i = 1, . . . , n,
@fi @fi
fi (x, u) = fi (0, 0) + (0, 0)x1 + . . . + (0, 0)xn
| {z } @x1 @xn
=0
@fi @fi
+ (0, 0)u1 + . . . + (0, 0)um
@u1 @um
Linearization /Jacobian Linearization (Using Tay
Linear approx. around (x, u) = (0, 0) to all components of f : s
For each i = 1, . . . , n,
@fi @fi
fi (x, u) = fi (0, 0) + (0, 0)x1 + . . . + (0, 0)xn
| {z } @x1 @xn
=0
@fi @fi
+ (0, 0)u1 + . . . + (0, 0)um
@u1 @um
Linearized state-space model:
@fi @fi
ẋ = Ax + Bu, where Aij =
@xj
, Bik =
@uk
x=0 x=0
u=0 u=0
ẋ = f (x, u)
General Linearization Procedure
I Start from nonlinear state-space model
ẋ = f (x, u)
ẋ = f (x, u)
x = x x0 u = u u0
f (x, u) = f (x + x0 , u + u0 ) = f (x, u)
Linear Transformation
3
General Linearization Procedure f : U ->
Y
Im (f) X
=
ẋ = f (x, u)
of
↳thin
...
-
-
Acc be Y =
x = x x0 u = u u0
f (x, u) = f (x + x0 , u + u0 ) = f (x, u)
x = x + x0 , u = u + u0
General Linearization Procedure
General Linearization Procedure
I Pass to shifted variables x = x x0 , u = u u0
f (0, 0) = f (x0 , u0 ) = 0
General Linearization Procedure
I Pass to shifted variables x = x x0 , u = u u0
f (0, 0) = f (x0 , u0 ) = 0
I Now linearize:
@fi @fi
ẋ = Ax + Bu, where Aij =
@xj
, Bik =
@uk
x=x0 x=x0
u=u0 u=u0
General Linearization Procedure
I Why do we require that f (x0 , u0 ) = 0 in equilibrium?
General Linearization Procedure
I Why do we require that f (x0 , u0 ) = 0 in equilibrium?
I This requires some thought. Indeed, we may talk about
a linear approximation of any smooth function f at
any point x0 :
f (x, u) = Ax + Bu f (0, 0) = A0 + B0 = 0.