0% found this document useful (0 votes)
10 views

Lecture 5

Uploaded by

Veljko
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)
10 views

Lecture 5

Uploaded by

Veljko
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/ 8

Lecture 5 - Physical Modeling 1.

Introduction

K. J. Åström • Dynamics is a major issue in control, since both the pro-


cesses to be controlled and the controllers are dynamical
1. Introduction systems.
2. The Concept of State • Dynamics has been described by differential equations
3. Linear State Models and Linearization relating inputs to outputs.

4. Physical Modeling • How much of the past do we need to consider?

5. Homework • Is there some way to minimize the information about the


past that we need?
Theme: Physical modeling, state models, linearization • Newton’s idea!

Static and Dynamic Models The Concept of State


Static models • The Great Modelers: Tycho Brahe, Kepler and Newton
y = f (u) • To predict the future motion of the planets it is enough to
know their current positions and the velocities.
The output signal y(t) at time t depends only on the value of • The state is the least information about a system that is
the input at time t. required for the prediction of its future development.
The output of a dynamic system at time t depends on past • Philosophical consequences, causality, predestination,
values of the input, for example (chaos).
 t • A detailed description of the physics of a system, balances
y ( t) = h( t − τ )u(τ ) dτ of mass, momentum and energy.
0
• 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. Åström September, 2000 1
Cruise Control A Simple Water Tank
A simple model of a car on a sloping road tells how its position How do level h and outflow q out depend on the inflow q in?
y depends on the throttle. Let the mass be m and assume that
Assume: Constant density
the propelling force is proportional to the throttle. We find

d2 y d y  d y 
m − c   = F − mg sin θ
dt2 dt dt dV
= qin − qout Massbalance
dt
Two states y and d y/dt.  h
V= A( h) dh Geometry
0

qout = a 2g h Energybalance

Many ways to choose the state.

Analysis and Simplification An Inverted Pendulum


Choosing h as a state variable we find y

dh 1  Momentum balance
= ( qin − a 2g h)
dt A( h) (Newton’s Equation)

qout = a 2g h
d2θ
J − mg l sin θ + mul cos θ = 0
dt2 θ
One function A(h) and one parameter a. L

Steady state relation h


Two states θ and dθ /dt.
qout = qin x

q2in 
h= Normalize with ω 0 = mg / J , introduce τ = ω 0 t and ū = u/g
2g a 2
q then
Not influenced by A! in
d2θ
Run ICtools or SysQuake − sin θ + u cos θ = 0
dτ 2

c K. J. Åström September, 2000 2
Pendulum on a Cart Standard Model
Equations of motion Momen- x A system with finite number of states can be described by
tum balances
dx
J pθ¨ + ml x cos θ − mg l sin θ = 0 O = f ( x, u)
dt
mlθ¨ cos θ − mlθ˙ 2 sin θ + M ẍ = F y = g( x, u)

Momentum balance character- • x state


ized by four variables: • u input, control variable
θ , θ˙ , x and ẋ
• y output, measured variable
Four states are enough!
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


Given the system • Solutions may not exist for all t. Example
dx dx 1
= f ( x, u) = x2 , x ( t) =
dt dt 1− t
y = g( x, u)
• There may be many solutions. Example
find constant values x 0 and u0 that satisfy the equation. Putting 2
dx/dt = 0 gives 
 t if t ≥ 0,
dx √ 
= x, x ( t) = 0 if t ≤ a
f ( x0 , u0 ) = 0 dt 


( t − a)2 if t > a

Compare with the water tank!


Bad modeling!
Not easy do discover!
• Numerical solutions require care

c K. J. Åström September, 2000 3
Inverted Pendulum Inverted Pendulum
The model: The model:

J pθ¨ − mg sin θ = mu cos θ J pθ¨ − mg sin θ = mu cos θ

Introduce state variables x 1 = θ and x2 = θ˙ , then Introduce state variables x 1 = θ and x2 = θ˙ , then
dx1 dx1
= x2 = x2
dt dt
dx2 mg m dx2 mg m
= sin x1 + u cos x1 = sin x1 + u cos x1
dt Jp Jp dt Jp Jp

Find the stationary solution! Stationary solutions for u = 0 gives sin x 1 = 0 and x2 = 0.
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), • Nonlinear systems are difficult.
y = g( x, u). It is important to know what this means. Writing • Purpose of control is to keep variables close to desired
all components of the vectors we get values.
dx1
= f 1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
• Approximate by considering small deviations from equilib-
dt rium
dx2
= f 2 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p) • This is called linearization
dt
..
. • Major simplification
dxn • Approximation improves with quality of control system
= f n ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
dt
• Procedure:
y1 = g1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
y2 = g2 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p) First determine the equilibria
.. Approximate the equations around the equilibria
.
yr = g1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)

c K. J. Åström September, 2000 4
Linearization of Static System Linearization of Dynamic Systems
Consider the system A curve is approximated by Start with
its tangent
dx
y = g(u) = f ( x, u)
10

dt
y = g( x, u)
A Taylor series expansion 5

around u = u 0 gives
Find the equilibria u = u 0 , x = x0 y = y0 by solving

y

y = g(u0 ) + g (u0 )(u − u0 ) + . . . 0

f ( x0 , u0 ) = 0

The linearized model


−5
0
u
0.5 1 1.5 2 2.5 3 3.5 4 Notice that there may be several solutions!
When is the approximation Decide what operating condition you want!
y − y0 = g  (u0 )(u − u0 ) good?

Linearization of Dynamic Systems ... Linearization of Dynamic Systems ...

dx dδ x dx
= f ( x, u) = = f ( x0 + δ x, u0 + δ u)
dt dt dt
y = g( x, u) f f
 f ( x0 , u0 ) + ( x0 , u0 )δ x + ( x0 , u0 )δ u
x u
Approximate around the equilibrium! y0 + δ y = g( x0 + δ x, u0 + δ u)
g g
x = x0 + δ x, u = u0 + δ u, y = y0 + δ y  y0 + ( x0 , u0 )δ x + ( x0 , u0 )δ u
x u

Hence
dδ x f f
dx f f = ( x0 , u0 )δ x + ( x0 , u0 )δ u = Aδ x + B δ u
= f ( x0 + δ x, u0 + δ u)  f ( x0 , u0 ) + ( x0 , u0 )δ x + ( x0 , u0 )δ u dt x u
dt x u g g
g g δy= ( x0 , u0 )δ x + ( x0 , u0 )δ u = Cδ x + Dδ u
y = g( x0 + δ x, u0 + δ u)  y0 + ( x0 , u0 )δ x + ( x0 , u0 )δ u x u
x u


c K. J. Åström September, 2000 5
Linearization of Dynamic Systems A Remark on Notations
For small deviations around an equilibrium the system f
A= ( x0 , u0 )
dx x
= f ( x, u)
dt
Component-wise
y = g( x, u)
 f 1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
can be approximated by a11 =
 x1
 f 1 ( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
dδ x a12 =
= Aδ x + B δ u  x2
dt
..
δ y = Cδ x + Dδ u .
 f n( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
an1 =
 x1
f f
A= ( x0 , u0 ) B= ( x0 , u0 ) ..
x u .
g g  f n( x1 , x2 , . . . , xn , u1 , u2 , . . . , u p)
C= ( x0 , u0 ) D= ( x0 , u0 ) ann =
x u  xn

The Water Tank The Inverted Pendulum


  States x1 = θ = y and x2 = θ˙
dh 1
= ( qin − a 2g h) qout = qin = q0 = a 2g h0
dt A( h) dx1
 = x2
q20 dt
qout = a 2g h h0 =
2g a 2 dx2 mg m
= sin x1 + u cos x1
dt J J
Assume constant cross section A, introduce h = h 0 + δ h
 √
write in standard form
dδ h a 2g 1 a 2g h 0 1
=− δ h + δ qin = − δ h + δ qin dx x2
dt 2A h0 A 2Ah0 A = f ( x, u) =
 √ mg m
2g a 2g h 0 q0 dt sin x1 + u cos x1
δ qout = a δh = δh = δh J J
h0 h0 h0
Two stationary solutions
Time constant
θ = x1 = 0 and θ˙ = x2 = 0 (pendulum up)
2Ah0 Total water volume [m ] 3
T= = 2 θ = x1 = π and θ˙ = x2 = 0 (pendulum down)
q0 Flow rate [m3 /s]

Physical interpretation! 
c K. J. Åström September, 2000 6
The Inverted Pendulum ... Linear Dynamical Systems - The State Model

x2 dx
f ( x, u) = mg = Ax + Bu
J sin x1 + m
J u cos x1 dt
y = Cx + Du

f 0 1 f 0
• Variables denote deviations from equilibrium
= mg , =
x cos x1 − m
u sin x1 0 u m
cos x1
• Think scalar and interpret as vectors
J J J

Evaluate for u = 0, x 1 = 0 och x2 = 0 (pendulum up)


Solution
f 0 1 f 0  t
A= = B= =
x mg
0 u m x( t) = e At x(0) + e A( t− s) Bu( s) ds
J J 0
 t
Evaluate for u = 0, x 1 = π och x2 = 0 (pendulum down) y( t) = Ce At x(0) + C e A( t− s) Bu( s) ds + Du( t)
0
f 0 1 f 0
A= = B= = All information in the matrices A, B , C and D .
x − mJg 0 u − mJ

The Matrix Exponential Calculating with the Matrix Exponential


What is the meaning of e At? The matrix exponential is defined as
1 1 1 1 1
e At = I + At + ( At)2 + . . . + An tn + . . . e At = I + At + ( At)2 + ( At)3 . . . + ( At)n + . . .
2 n! 2 3! n!

If A can be diagonalized A = T Λ T −1 , then Differentiate!


d At 1 1
e At = T ( I + Λ t +
1 2 2
Λ t + ... +
1 n n
Λ t + . . . ) T −1 e = A + At + ( At)2 . . . + ( At)n−1 + . . . = Ae At
2 n! dt 2 ( n − 1)!

eλ 1 t 0 ... 0 t
 0
 λ
e 2t ... 0 
 −1 Differentiation of x(t) = e At x(0) + 0 eA(t−τ ) Bu(τ )dτ
= Te T Λt −1
=T
 ..
T

 .  gives
0 0 ... eλ n t
dx
= Ax + Bu
where λ i are the eigenvalues of the matrix A, i.e. the solutions dt
to the equation det(λ I − A) = 0

c K. J. Åström September, 2000 7
Vector and Matrix Notations Relation between Input and Output
• Very compact and practical notation
dx
• Numerical calculations supported by nice software = Ax + Bu
dt
• Learn to formulate and interpret y = Cx + Du

• Essentially the same as for scalar equations Input-output relation


• BUT remember that AB = B A! for matrices  t
y( t) = Ce x(0) + C
At
e A( t− s) Bu( s) ds + Du( t)
0

Compare with first order systems! Take Laplace transforms

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


Y ( s) = C X ( s) + DU ( 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 nonliner 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, y = Cx + Du
dt

• Vector and matrix notations, the matrix exponential e At


• Compact notation with computational tools

c K. J. Åström September, 2000 8

You might also like