[go: up one dir, main page]

0% found this document useful (0 votes)
51 views74 pages

State-Space Models for Engineers

Uploaded by

Vaibhavi Parmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views74 pages

State-Space Models for Engineers

Uploaded by

Vaibhavi Parmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

Plan of the Lecture

I Review: control, feedback, etc.


I Today’s topic: state-space models of systems; linearization
Plan of the Lecture

I Review: control, feedback, etc.


I Today’s topic: state-space models of systems; linearization

Goal: a general framework that encompasses all examples of


interest. Once we have mastered this framework, we can
proceed to analysis and then to design.
Plan of the Lecture

I Review: control, feedback, etc.


I Today’s topic: state-space models of systems; linearization

Goal: a general framework that encompasses all examples of


interest. Once we have mastered this framework, we can
proceed to analysis and then to design.

Reading: FPE, Sections 1.1, 1.2, 2.1–2.4, 7.2, 9.2.1.


Chapter 2 has lots of cool examples of system models!!
Notation Reminder

We will be looking at dynamic systems whose evolution in


time is described by di↵erential equations with external
inputs.

We will not write the time variable t explicitly, so we use

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

Newton’s second law (translational motion):


F
|{z} = ma
total force
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force

spring force = kx (Hooke’s law)


friction force = ⇢ẋ (Stokes’ law — linear drag, only an approximation!!)
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force

spring force = kx (Hooke’s law)


friction force = ⇢ẋ (Stokes’ law — linear drag, only an approximation!!)
F = kx ⇢ẋ + u
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force

spring force = kx (Hooke’s law)


friction force = ⇢ẋ (Stokes’ law — linear drag, only an approximation!!)
mẍ = kx ⇢ẋ + u
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force

spring force = kx (Hooke’s law)


friction force = ⇢ẋ (Stokes’ law — linear drag, only an approximation!!)
mẍ = kx ⇢ẋ + u
Move x, ẋ, ẍ to the LHS, u to the RHS:

mẍ + ⇢ẋ + kx = u
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force

spring force = kx (Hooke’s law)


friction force = ⇢ẋ (Stokes’ law — linear drag, only an approximation!!)
mẍ = kx ⇢ẋ + u
Move x, ẋ, ẍ to the LHS, u to the RHS:
⇢ k u
ẍ + ẋ + x =
m m m
Example 1: Mass-Spring System
x

m u

Newton’s second law (translational motion):


F
|{z} = ma = spring force + friction + external force
total force

spring force = kx (Hooke’s law)


friction force = ⇢ẋ (Stokes’ law — linear drag, only an approximation!!)
mẍ = kx ⇢ẋ + u
Move x, ẋ, ẍ to the LHS, u to the RHS:
⇢ 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
Example 1: Mass-Spring System

m u

⇢ k u
ẍ + ẋ + x = 2nd-order linear ODE
m m m

Canonical form: convert to a system of 1st-order ODEs


Example 1: Mass-Spring System

m u

⇢ k u
ẍ + ẋ + x = 2nd-order linear ODE
m m m

Canonical form: convert to a system of 1st-order ODEs

ẋ = v (definition of velocity)
⇢ k 1
v̇ = v x+ u
m m m
Example 1: Mass-Spring System
x

m u

State-space model: express in matrix form

✓ ◆ ✓ ◆✓ ◆ ✓ ◆
ẋ 0 1 x 0
= k ⇢ + 1 u
v̇ m m v m
Example 1: Mass-Spring System
x

m u

State-space model: express in matrix form

✓ ◆ ✓ ◆✓ ◆ ✓ ◆
ẋ 0 1 x 0
= k ⇢ + 1 u
v̇ m m v m

Important: start reviewing your linear algebra now!!


I matrix-vector multiplication; eigenvalues and eigenvectors; etc.
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
General n-Dimensional State-Space Model
0 1 0 1 4
x1 u1
B C B C
state x = @ ... A 2 Rn input u = @ ... A 2 Rm
ratix

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.

When working with state-space models, what are


states and what are inputs?
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.

When working with state-space models, what are


states and what are inputs?
— match against ẋ = Ax + Bu
Example 2: RL Circuit
+ VR
+ +
VS I VL
Example 2: RL Circuit
+ VR
+ +
VS I VL

VS + V R + VL = 0 Kirchho↵’s voltage law


VR = RI Ohm’s law

VL = LI˙ Faraday’s law

VS + RI + LI˙ = 0
Example 2: RL Circuit
+ VR
+ +
VS I VL

VS + V R + VL = 0 Kirchho↵’s voltage law


VR = RI Ohm’s law

VL = LI˙ Faraday’s law

VS + RI + LI˙ = 0

R 1
I˙ = I + VS (1st-order system)
L L
Example 2: RL Circuit
+ VR
+ +
VS I VL

VS + V R + VL = 0 Kirchho↵’s voltage law


VR = RI Ohm’s law

VL = LI˙ Faraday’s law

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 + V R + VL = 0 Kirchho↵’s voltage law


VR = RI Ohm’s law

VL = LI˙ Faraday’s law

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 + V R + VL = 0 Kirchho↵’s voltage law


VR = RI Ohm’s law

VL = LI˙ Faraday’s law

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`

mg` sin ✓ + Te = m`2 ✓¨


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`

mg` sin ✓ + Te = m`2 ✓¨

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

Control systems are generally nonlinear :

ẋ = f (x, u) nonlinear state-space model


0 1 0 1 0 1
x1 u1 f1
B .. C B .. C B .. C
x=@ . A u=@ . A f =@ . A
xn um fn
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

Control systems are generally nonlinear :

ẋ = f (x, u) nonlinear state-space model


0 1 0 1 0 1
x1 u1 f1
B .. C B .. C B .. C
x=@ . A u=@ . A f =@ . A
xn um fn

Assume x = 0, u = 0 is an equilibrium point: f (0, 0) = 0


This means that, when the system is at rest and no control is
applied, the system does not move.
system

~
~
↳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 :

ẋ1 = f1 (x, u), ..., ẋn = fn (x, u)


Linearization
Linear approx. around (x, u) = (0, 0) to all components of f :

ẋ1 = f1 (x, u), ..., ẋn = fn (x, u)

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

ẋ1 = f1 (x, u), ..., ẋn = fn (x, u)


expansion)
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
Linearization
Linear approx. around (x, u) = (0, 0) to all components of f :

ẋ1 = f1 (x, u), ..., ẋn = fn (x, u)

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

Important: since we have ignored the higher-order terms, this


linear system is only an approximation that holds only for small
deviations from equilibrium.
Example 3: Pendulum, Revisited
Original nonlinear state-space model:

✓˙1 = f1 (✓1 , ✓2 , Te ) = ✓2 — already linear


g 1
✓˙2 = f2 (✓1 , ✓2 , Te ) = sin ✓1 + Te
` m`2
Example 3: Pendulum, Revisited
Original nonlinear state-space model:

✓˙1 = f1 (✓1 , ✓2 , Te ) = ✓2 — already linear


g 1
✓˙2 = f2 (✓1 , ✓2 , Te ) = sin ✓1 + Te
` m`2
Linear approx. of f2 around equilibrium (✓1 , ✓2 , Te ) = (0, 0, 0):
@f2 g @f2 @f2 1
= cos ✓1 =0 =
@✓1 ` @✓2 @Te m`2
@f2 g @f2 @f2 1
= =0 =
@✓1 ` @✓2 @Te m`2
0 0 0
Example 3: Pendulum, Revisited
Original nonlinear state-space model:

✓˙1 = f1 (✓1 , ✓2 , Te ) = ✓2 — already linear


g 1
✓˙2 = f2 (✓1 , ✓2 , Te ) = sin ✓1 + Te
` m`2
Linear approx. of f2 around equilibrium (✓1 , ✓2 , Te ) = (0, 0, 0):
@f2 g @f2 @f2 1
= cos ✓1 =0 =
@✓1 ` @✓2 @Te m`2
@f2 g @f2 @f2 1
= =0 =
@✓1 ` @✓2 @Te m`2
0 0 0

Linearized state-space model of the pendulum:


✓˙1 = ✓2
g 1
✓˙2 = ✓1 + Te valid for small deviations from equ.
` m`2
General Linearization Procedure
I Start from nonlinear state-space model

ẋ = f (x, u)
General Linearization Procedure
I Start from nonlinear state-space model

ẋ = f (x, u)

I Find equilibrium point (x0 , u0 ) such that f (x0 , u0 ) = 0


General Linearization Procedure
I Start from nonlinear state-space model

ẋ = f (x, u)

I Find equilibrium point (x0 , u0 ) such that f (x0 , u0 ) = 0


Note: di↵erent systems may have di↵erent equilibria,
not necessarily (0, 0), so we need to shift variables:

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

I Start from nonlinear state-space model ker (f) =

Im (f) X
=

ẋ = f (x, u)
of
↳thin
...

-
-

Acc be Y =

I Find equilibrium point (x0 , u0 ) such that f (x0 , u0 ) = 0


Note: di↵erent systems may have di↵erent equilibria,
not necessarily (0, 0), so we need to shift variables:

x = x x0 u = u u0
f (x, u) = f (x + x0 , u + u0 ) = f (x, u)

Note that the transformation is invertible:

x = x + x0 , u = u + u0
General Linearization Procedure
General Linearization Procedure
I Pass to shifted variables x = x x0 , u = u u0

ẋ = ẋ (x0 does not depend on t)


= f (x, u)
= f (x, u)

— equivalent to original system


General Linearization Procedure
I Pass to shifted variables x = x x0 , u = u u0

ẋ = ẋ (x0 does not depend on t)


= f (x, u)
= f (x, u)

— equivalent to original system


I The transformed system is in equilibrium at (0, 0):

f (0, 0) = f (x0 , u0 ) = 0
General Linearization Procedure
I Pass to shifted variables x = x x0 , u = u u0

ẋ = ẋ (x0 does not depend on t)


= f (x, u)
= f (x, u)

— equivalent to original system


I The transformed system is in equilibrium at (0, 0):

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) ⇡ f (x0 )+f 0 (x0 )(x x0 ) — f (x0 ) does not have to be 0


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) ⇡ f (x0 )+f 0 (x0 )(x x0 ) — f (x0 ) does not have to be 0

I The key is that we want to approximate a given


nonlinear system ẋ = f (x, u) by a linear system
ẋ = Ax + Bu (may have to shift coordinates:
x 7! x x0 , u 7! u u0 )
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) ⇡ f (x0 )+f 0 (x0 )(x x0 ) — f (x0 ) does not have to be 0

I The key is that we want to approximate a given


nonlinear system ẋ = f (x, u) by a linear system
ẋ = Ax + Bu (may have to shift coordinates:
x 7! x x0 , u 7! u u0 )
Any linear system must have an equilibrium point at
(x, u) = (0, 0):

f (x, u) = Ax + Bu f (0, 0) = A0 + B0 = 0.

You might also like