Вы находитесь на странице: 1из 8

Lecture 10 - Physical Modeling

1. Introduction
Dynamics is a major issue in control, since both the processes to be controlled and the controllers are dynamical
systems.

K. J. strm
1. Introduction

Dynamics has been described by differential equations


relating inputs to outputs.

2. The Concept of State


3. Linear State Models and Linearization

How much of the past do we need to consider?

4. Physical Modeling

Is there some way to minimize the information about the


past that we need?

5. Homework
Theme: Physical modeling, state models, linearization

Newtons idea!

Static and Dynamic Models


Static models

The Concept of State


The Great Modelers: Tycho Brahe, Kepler and Newton

y = f (u )

The output signal y(t) at time t depends only on the value of


the input at time t.
The output of a dynamic system at time t depends on past
values of the input, for example
Z t
y(t) =
h(t )u( )d
0

To predict the future motion of the planets it is enough to


know their current positions and the velocities.
The state is the least information about a system that is
required for the prediction of its future development.
Philosophical consequences, causality, predestination,
(chaos).
A detailed description of the physics of a system, balances
of mass, momentum and energy.
The state is the least number of variables required to
describe storage of mass, momentum and energy.
Synonyms: state models, internal descriptions, white
boxes.

c K. J. strm August, 2001


&

Cruise Control

A Simple Water Tank

A simple model of a car on a sloping road tells how its position


y depends on the throttle. Let the mass be m and assume that
the propelling force is proportional to the throttle. We find
d2 y
d y d y
m 2 c = F mg sin
dt
dt dt
Two states y and d y/dt.

How do level h and outflow qout depend on the inflow qin?


Assume: Constant density

dV
= qin qout
Massbalance
dt
Z h
V=
A( h) dh
Geometry
0
p
Energybalance
qout = a 2g h

Many ways to choose the state.

An Inverted Pendulum

Analysis and Simplification


Choosing h as a state variable we find

p
dh
1
( qin a 2g h)
=
dt
A( h)
p
qout = a 2g h

Momentum balance
(Newtons Equation)

One function A(h) and one parameter a.


Steady state relation

d2
mg l sin +mul cos = 0
dt2

Two states and d /dt.

qout = qin

q2
h = in 2
2g a

Not influenced by A!
Run ICtools or SysQuake

q
in

p
Normalize with 0 = mgQ/ J , introduce = 0 t and u = u/g
then
d2
sin + u cos = 0
d 2
c K. J. strm August, 2001
&

Pendulum on a Cart
Equations of motion Momentum balances
J p + ml x cos mg l sin = 0
ml cos ml 2 sin + M x = F

Standard Model

A system with finite number of states can be described by


dx
= f ( x , u)
dt
y = g( x, u)

x state

Momentum balance characterized by four variables:


, , x and x
Four states are enough!

u input, control variable


y output, measured variable
The model (a nonlinear ordinary differential equation (ODE)),
tells that the rate of change of the state at time t is uniquely
given by the state at time t, and the input at time t. If the
state is known at time t, old values of x do not give any extra
information.

Standard Model - Equilibrium Solutions

Difficulties with Nonlinear Equations


Solutions may not exist for all t. Example

Given the system


dx
= f ( x , u)
dt
y = g( x, u)

dx
= x2 ,
dt

find constant values x0 and u0 that satisfy the equation. Putting


dx/dt = 0 gives
f ( x0 , u0 ) = 0

x(t) =

1
1t

There may be many solutions. Example


2
t

dx
= 2 x , x(t) = 0

dt
2
( t a)

if t 0,
if t a
if t > a

Compare with the water tank!


Bad modeling!
Not easy do discover!
Numerical solutions require care
c K. J. strm August, 2001
&

Inverted Pendulum

Inverted Pendulum

The model:

The model:

J p mgQ sin = muQ cos


Introduce state variables x1 = and x2 = , then

J p mgQ sin = muQ cos


Introduce state variables x1 = and x2 = , then

dx1
= x2
dt
dx2
mgQ
mQ
=
sin x1 +
u cos x1
dt
Jp
Jp

dx1
= x2
dt
dx2
mgQ
mQ
=
sin x1 +
u cos x1
dt
Jp
Jp

Stationary solutions for u = 0 gives sin x1 = 0 and x2 = 0.

Find the stationary solutions!


The Audience is Thinking ...

Two cases:

= x1 = 0 and = x2 = 0 (pendulum up)


= x1 = and = x2 = 0 (pendulum down)

Expansion of Standard Model

Linearization

We have used a very compact notation: dx/dt = f ( x, u),


y = g( x, u). It is important to know what this means. Writing
all components of the vectors we get

Nonlinear systems are difficult.


Purpose of control is to keep variables close to desired
values.

dx1
= f 1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
dt
dx2
= f 2 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
dt
..
.

Approximate by considering small deviations from equilibrium

dxn
= f n ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
dt
y1 = g1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)

Approximation improves with quality of control system

y2 = g2 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)

..
.

This is called linearization


Major simplification
Procedure:
First determine the equilibria
Approximate the equations around the equilibria

yr = g1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
c K. J. strm August, 2001
&

Linearization of Static System

Linearization of Dynamic Systems

A curve is approximated by
its tangent

Consider the system

Start with
dx
= f ( x , u)
dt
y = g( x, u)

10

y = g(u)

A Taylor series expansion


around u = u0 gives

Find the equilibria u = u0 , x = x0 y = y0 by solving

y = g(u0 )+gP (u0 )(uu0 )+. . .

f ( x0 , u0 ) = 0

Notice that there may be several solutions!

The linearized model

y y0 = gP (u0 )(u u0 )

u
When is the approximation
good?
0

0.5

1.5

2.5

3.5

Decide what operating condition you want!

Linearization of Dynamic Systems ...

Linearization of Dynamic Systems ...

dx
= f ( x , u)
dt
y = g( x, u)

d x
dx
=
= f ( x0 + x, u0 + u)
dt
dt
Vf
Vf
 f ( x0 , u0 ) +
( x0 , u0 ) x +
( x0 , u0 ) u
Vx
Vu
y0 + y = g( x0 + x, u0 + u)
Vg
Vg
( x0 , u0 ) x +
( x0 , u0 ) u
 y0 +
Vx
Vu

Approximate around the equilibrium!


x = x0 + x,

u = u0 + u,

y = y0 + y

Hence
Vf
Vf
dx
= f ( x0 + x, u0 + u)  f ( x0 , u0 ) +
( x0 , u0 ) x +
( x0 , u0 ) u
dt
Vx
Vu
Vg
Vg
( x0 , u0 ) x +
( x0 , u0 ) u
y = g( x0 + x, u0 + u)  y0 +
Vx
Vu

c K. J. strm August, 2001


&

Vf
Vf
d x
=
( x0 , u0 ) x +
( x0 , u0 ) u = A x + B u
dt
Vx
Vu
Vg
Vg
y=
( x0 , u0 ) x +
( x0 , u0 ) u = C x + D u
Vx
Vu

Linearization of Dynamic Systems

A Remark on Notations

For small deviations around an equilibrium the system


dx
= f ( x , u)
dt
y = g( x, u)

A=

Component-wise

a12

d x
= A x + B u
dt
y = C x + D u

Vf
( x0 , u0 )
Vx
Vg
C=
( x0 , u0 )
Vx

..
.
an1 =

Vf
( x0 , u0 )
Vu
Vg
D=
( x0 , u0 )
Vu

qout

ann =

V f n( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
V xn

The Inverted Pendulum

p
= qin = q0 = a 2g h0

States x1 = = y and x2 =
dx1
= x2
dt
dx2
mgQ
mQ
sin x1 +
u cos x1
=
dt
J
J

q20
h0 =
2g a2

Assume constant cross section A, introduce h = h0 + h


r

d h
a
2g
1
a 2 g h0
1
=
h + qin =
h + qin
dt
2A h0
A
2Ah0
A
r

2g
a 2 g h0
q0
qout = a
h =
h = h
h0
h0
h0

Time constant
2Ah0
Total water volume [m3 ]
T=
= 2
q0
Flow rate [m3 /s]

Physical interpretation!

V f n( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
V x1

..
.

B=

The Water Tank


p
dh
1
( qin a 2g h)
=
dt
A( h)
p
qout = a 2g h

V f 1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
V x1
V f 1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
=
V x2

a11 =

can be approximated by

A=

Vf
( x0 , u0 )
Vx

write in standard form


dx
= f ( x , u) =
dt

x2

mgQ
mQ
sin x1 +
u cos x1
J
J

Two stationary solutions

= x1 = 0 and = x2 = 0 (pendulum up)


= x1 = and = x2 = 0 (pendulum down)

c K. J. strm August, 2001


&

The Inverted Pendulum ...




f ( x , u) =

x2
mgQ
J

sin x1 +

Linear Dynamical Systems - The State Model

mQ
u cos
J

dx
= Ax + Bu
dt
y = Cx + Du

x1





Vf
Vf
0
1
0
,
= mgQ
= mQ
mQ
0
Vx
Vu
J cos x1 J u sin x1
J cos x1
Evaluate for u = 0, x1 = 0 och x2 = 0 (pendulum up)


 
Vf
Vf
0
1
0
A=
= mgQ
B=
= mQ
0
Vx
Vu
J
J

Variables denote deviations from equilibrium


Think scalar and interpret as vectors
Solution

Evaluate for u = 0, x1 = och x2 = 0 (pendulum down)






0
1
0
Vf
Vf
A=
=
B=
=
mJgQ 0
mJQ
Vx
Vu

Z
x( t) = e x(0) +
At

e A( t s) Bu( s) ds

y( t) = Ce At x(0) + C

e A( t s) Bu( s) ds + Du( t)

All information in the matrices A, B , C and D .

The Matrix Exponential

Calculating with the Matrix Exponential

What is the meaning of eAt?

The matrix exponential is defined as

1
1
eAt = I + At + ( At)2 + . . . + An tn + . . .
2
n!

If A can be diagonalized A = T T 1 , then


1 2 2
t + ... +
2
e 1 t
0
0
e 2 t

=T
.
.
.

e At = T ( I + t +

= Tet T 1

Differentiate!
d At
1
1
( At)n1 + . . . = AeAt
e = A + At + ( At)2 . . . +
dt
2
(n 1)!
Rt
Differentiation of x(t) = eAt x(0) + 0 eA(t ) Bu( )d

1 n n
t + . . .) T 1
n!

...
0
...
0
1
T

...

1
1
1
eAt = I + At + ( At)2 + ( At)3 . . . + ( At)n + . . .
2
3!
n!

gives

e n t

where i are the eigenvalues of the matrix A, i.e. the solutions


to the equation det( I A) = 0
c K. J. strm August, 2001
&

dx
= Ax + Bu
dt

Vector and Matrix Notations

Relation between Input and Output

Very compact and practical notation

dx
= Ax + Bu
dt
y = Cx + Du

Numerical calculations supported by nice software


Learn to formulate and interpret
Essentially the same as for scalar equations

Input-output relation
Z

BUT remember that AB = B A! for matrices

y(t) = Ce x(0) + C
At

eA(ts) Bu(s)ds + Du(t)

Compare with first order systems! Take Laplace transforms


s X ( s) x(0) = AX ( s) + B U ( s)
Y ( s) = C X ( s) + DU ( s)

X ( s) = ( sI A)1 x(0) + ( sI A)1 B U ( s)


Y ( s) = C X ( s) + DU ( s)

The transfer function is G (s) = D + C(sI A)1 B

Summary
Obtaining dynamics from physics
The concept of state
The standard model for nonlinear finite dimensional
systems
dx
= f ( x, u), y = g( x, u)
dt
Linearization and linear time invariant (LTI) systems
The standard model for linear time invariant systems
dx
= Ax + Bu,
dt

y = Cx + Du

Vector and matrix notations, the matrix exponential eAt


Compact notation with computational tools
c K. J. strm August, 2001
&

Вам также может понравиться