You are on page 1of 46

Chap2 1

Models for Dynamic Systems


and Systems Similarity
Dr. H. Maverengo
MTR502
Chap2 2

Agenda
• Formulation of Models for Engineering
Systems
• Review of Solution of Differential
Equations
• Engineering Systems Similarity
• Simulation with Matlab

• Active learning: Pair-share questions,


Concept questions
Chap2 3

Formulation of Models for


Engineering Systems
Chap2 4

Conservation Laws of
Engineering Systems
• Linear momentum: translational
momentum is equal to applied impulse
(rigid body an or fluid)
 mv
d
F net
dt
• Angular momentum: angular impulse is
equal to time rate of change of angular
momentum
T net
d
 J 
dt
Chap2 5

Conservation Laws of
Engineering Systems
• Conservation of Charge/Kirchhoff’s law:
sum of all currents at a node is equal to
rate of storing charge
dQ de
 inode  dt  C dt
• Conservation of Mass: net mass flowrate
at a location equal to time rate of change
of mass that that location
 V   V  V
d
 m net
dt
Chap2 6

Conservation Laws of
Engineering Systems
• Conservation of Energy
– Energy in a system is constant

– Reduces to Bernoulli equation: energy is not


exchanged or stored
Chap2 7

Review of Solution of
Differential Equations
Chap2 8

Input Signals

Step input Ramp input


Chap2 9

Input Signals

Pulse input Sinusoidal input


Chap2 10

Classical Differential Equations


dx
1  Order : a1  a0 x  b0u
st

dt
System is stable if a1  0 and a0  0.
bo d a1
Let G  , D  ,   [ D  1]x  Gu(t )
ao dt ao
Chap2 11

Example Classical Differential Equations


• Use Table E.3 to find the solution, and find
steady state value. Is this system stable?
6 x  2 x  2u; u  0, xo  1
Solution :
bo 2 a 6
a1  6, ao  2, bo  2, G    1,   1   3
ao 2 ao 2
a1  0 and ao  0  System is stable. Table E.3  x  xo e t /  e t / 3
Steady state value : 2 methods
1) xss  x(t  )  e  / 3  0
X (s) 2 1
2) 6 sX ( s )  2 X ( s )  2U ( s )   
U ( s ) 6 s  2 3s  1
X ( s)
xss  lim s 0 s 0
U (s)
Chap2 12
Classical Differential Equations:
Pair-Share Exercise
• Use Table E.3 to find solution, and find steady state value for
this system. Is this system stable?
10 x  2 x  10u; u  uo  1 (step input ), xo  0
Solution :
bo 10 a1 10
bo  10, a1  10, ao  2, G    5,    5
ao  2 ao  2
x  xo e t /  Guo [t   (1  e t / )]  5[t  5(1  et / 5 )]
X ( s) 10 1
 ; U (s)  ;
U ( s ) 10s  2 s
X (s)
xss  lim s 0 s  lim s 0 X ( s )  .
U ( s)
System is unstable.
Chap2 13
Classical Differential Equations
2
d x dx
2  Order : a2 2  a1  a0 x  b0u
nd

dt dt
System is stable if a2  0, a1  0, and a0  0.
bo 1 a2 2 a1 d
Let G  , 2  ,  , and D  ,
ao  n ao  n a o dt
  1 : Underdamped case (Oscilliati on in response)
  1 : Overdamped case ( No oscilliati on in response)
  1 : Critically damped case ( No oscilliati on in response)
Chap2 14

Classical Differential Equations


Chap2 15

Classical Differential Equations


• Example: Using Table E.4 to find solution for this
system. Is this system stable?
x  x  x  u; u  0, xo  1, xo  0
Solution :
a2  1, a1  1, a0  1,  System is stable. bo  1,
bo 1 a 2 a1
G  1, 2  2  1   n  1,   1   .5,
ao  n ao  n ao
  1 : Underdamped case
 
d n
1   2  0.866

 t   x  t
x(t )  xo e n
cos( d t )  sin( d t )  o e n sin( d t )
 1  2   d
.5t  .5 
 e cos(0.866t )  sin(0.866t )
 0.866 
Chap2 16

State Space Description


• State variables describe present configuration of
a system and can be used to determine future
response, given inputs and dynamic equations
• Number of state variables
– Should be as small as possible, but a minimum
number of state variables must be selected as
components of the state vector (sufficient to describe
completely the state of the system)
– Usually equal to order of system’s differential
equation or number of energy-storage elements
• Choice of state variables is not unique
Chap2 17

State Space Representation


x  Ax  Bu
y  Cx  Du
x  state vect or y  output vector
x  time deriv ative of t he state v ector
u  input vect or
A  system matrix
B  input matr ix
C  output mat rix
D  feedforwar d matrix
Chap2 18

State Space Representation


• Example: Express x  2 x  3x  f in State
Space format
x  2 x  3 x  f
z  x
z  x
x  z  2 x  3 x  f  2 z  3 x  f
 x   0 1   x  0 
 z    3  2  z   1 f
      
• Is this system stable? Yes
Chap2 19

State Space Representation:


Pair-Share Exercise
• Example: Express in state space format
x  2x  3x  4 x  f
z  x
y  z  x
y  z  x  2 x  3 x  4 x  f
 2 y  3 z  4 x  f
 x   0 1 0   x  0 
 z    0 0 1   z   0  f
      
 y   4  3  2  y  1

• Is this system stable? Yes


Chap2 20

State Space Representation


• Example: develop a state space model with output vL

• Ldi/dt+Ri+(1/c)∫idt=v(t)
• i(t)=dq/dt, i’=q”
• Lq”+Rq’+(1/c)q=v(t)

• To make two 1st-order equations


– dq/dt=i
– di/dt=-(1/LC)q-R/Li+v(t)/L
• Output: vL=Ldi/dt
Chap2 21

State Space Representation:


Concept Question
• Which variables can be chosen to describe the state of the system?
A. Only i
B. Only q
C. i and q
D. Only VR
E. Only VC
F. L, R, or C
G. Other possibilities
• How many state variables are sufficient to describe the state of the
system?
• Some possible pairs
– i and q
– VR and VC
– ……
Chap2 22

State Space Representation


Choose q and i :

x  Ax  Bu
dq di 1 R 1
i   q  i  v(t )
dt dt Lc L L
dq / dt   0 1 
x    , A 1 R

 Lc 
 di / dt  L 
q  0
x , B   1  , u  v(t)
i   L 
output equations
y  Cx  Du
 1 
y  vL (t ), C  - - R , D  1
 c 
Chap2 23

State Space Representation:


Pair-Share Exercise
Form state space model with vR and vC

• vL=Ldi/dt=(L/R) dvR/dt
• As vL+vR+vC=v(t)
• (L/R) dvR/dt+vR+vC= v(t)
• dvR/dt=-(R/L) vR-(R/L) vC+(R/L)v(t)
• vC=(1/c) ∫(vR/R)dt
• Differentiate
• dvC/dt=(1/RC)vR
• New state equations
Chap2 24

State Space
Graphical Representation
q
• q,i were selected
as state variables

• Graphical i

representation
of state space
and a state vector

Function of time t
Chap2 25

State Space Representation


• Example: RLC Electrical circuit
dvC 1 1
 vC  iL
dt RC C
Output iR(t)
diL 1 1
  vC  v(t )
dt L L
1
output i R  vC
R
 1 1

vC   RC C  vC   0 
 i    1      1  v(t )
 L   0   iL   L 
 L 
1  vC 
iR   0  
R   iL 
Chap2 26

State Space Solution


• Solution for state space equation
x  Ax  Bu
sX ( s )  X (0)  AX ( s )  BU ( s )
( sI  A) X ( s )  X (0)  BU ( s )
X ( s )  ( sI  A) 1 X (0)  ( sI  A) 1 BU ( s )

t
x(t )  (t ) x(0)   (t   )]Bu ( )d
0

where (t ) is Laplace transform of ( sI  A) 1 ,


With (t ), x(0), and u ( ) known, x(t ) can be solved or evaluated numericall y.
(t ) : state transition matrix
Chap2 27

State Space Solution


0 1 1
x    x, x(0)  0 and u  0.
  2  3  
• Example
1
1
 1 0   0 1  1  s  3 1
( sI  A)   s     2  3   ( s  1)( s  2)   2 s 
  0 1     
 s3 1 
 ( s  1)( s  2) ( s  1)( s  2) 
 
  2 s 
 ( s  1)( s  2) ( s  1)( s  2) 
Take inverse Laplace transform,
 ( 2e  t  e  2 t ) (e  t  e  2 t ) 
(t )   t  2t t  2t 
 ( 2 e  2 e ) (  e  2 e )

 2e  t  e  2 t 
x(t )  (t ) x(0)   t  2t 
  2 e  2 e 
Chap2 28

State Space Solution:


Pair-Share exercise
• Find solution for this system
0  2  1
x    x, x(0)  1 and u  0.
1  3  
1
 1 0 0  2  1  s  3  2
( sI  A) 1   s  
 1  3    1 
  0 1     ( s  1)( s  2)  s 
Take inverse Laplace transform,
(2e t  e  2t ) (2e t  2e  2t )
(t )   t  2t t  2t 
 ( e  e ) (  e  2e )

e  2 t 
x(t )  (t ) x(0)    2t 
e 
Chap2 29

Engineering Systems
Similarity
Chap2 30

System Similarity
• Models in different engineering systems
have same or similar differential equations
• Similar basis elements
– Resistance
– Capacitance
– Inductance
• Dynamic behaviors have different time
constants, influencing modeling choices
and assumptions
Chap2 31

System Similarity
Chap2 32

Effort and Flow Variables


• Variables used for differential equations are
either effort or flow variables
– Effort variables: express effort placed on a
component, e.g., force, voltage
– Flow variables: express flow or time rate of change of
a system variable, e.g., velocity, current
• Impedance: is any transfer function between a
flow variable as input and effort variable as
output
– Effort = impedance x flow
– Impedance can be static (resistance) or dynamic
(capacitance/inductance)
Chap2 33
Chap2 34

General Model Structure for


Mechanical System
Chap2 35
General Model Structure for
Electrical System
Chap2 36

Simulation with Matlab


Chap2 37

1st Order System: Differential


Equation and Transfer Function

Free body diagram: Sliding block with friction

• f(t) - m v' - b v = 0
• L{ v(t) } = V(s), L{ v’(t) } = sV(s) – v(0), L{ f(t) } = F(s)
• Assume v(0) = 0,
• m[sV(s)] + b[V(s)] – F(s) = 0
• Rearranging we get: [ms + b]V(s) = F(s)
• The transfer function is: V(s)/F(s) = 1/[ms+b]
Chap2 38

1st Order System: TF in Matlab


• Let m = 20,000kg, b = 500kg/s

• Matlab commands:
>> m = 20000;
>> b = 500;

>> num = [ 1 ];
>> den = [ m b ];
>> first_tf = tf(num, den)

Transfer function:
1
-------------
20000 s + 500
Chap2 39

1st Order System: Step Response


>> u = 1; >> u = 20000;
>> step(u * first_tf) >> step(u * first_tf)
Chap2 40

1st Order System: Impulse


Response
>> u = 1; >> u = 20000;
>> impulse(u * first_tf) >> impulse(u * first_tf)
Chap2 41

1st Order System: State Space


x' = Ax + Bu
y = Cx + Du

>> [A, B, C, D] = tf2ss(num,den) >> first_ss = ss(first_tf)


A=
-0.0250 a= x1
x1 -0.025
B=
1 b= u1
C= x1 0.007813
5.0000e-005
D= c= x1
y1 0.0064
0
d= u1
y1 0
Chap2 42

2nd Order System: Differential


Equation and Transfer Function
• Sum of all torques bq’
• kq + bq' + Iq" = 0
kq
Iq”
• L{ q(t) } = Q(s)
• L{ q’(t) } = sQ(s) – q(0)
• L{ q"(t) } = s2Q(s) – sq(0) – q'(0)

• k[Q(s)] + b[sQ(s)] + I[s2Q(s) - w(0)] = 0


• Or [Is2 + bs + k]Q(s) = I*w(0)
a rotational mass inertia I,
fiction oefficient b, spring
• Q(s) = [ 1/[Is2 + bs + k] ] * I*w(0)
coefficient k
• The transfer function is:
• G(s) = 1/[Is2 + bs + k]
Chap2 43

2nd Order System:


I = 1,500,000kgm2
b = 200,000Nm/s • >> u = 0.002 * 1.5e6;
k = 4,000,000Nm >> impulse(u * second_tf)

>> I = 1500000;
>> b = 200000;
>> k = 4000000;
>> num = [ 1 ];
>> den = [ I b k ];
>> second_tf = tf(num, den)
1
------------------------------
1.5e006 s^2 + 200000 s + 4e006
Chap2 44

Matlab Simulation Exercise


• Find the transfer function, state space
model, and simulate the impulse and step
response for this system
x  2 x  3 x  u
x (0)  0
x(0)  0
Chap2 45

Homework 2: chapter 2




Chap2 46

References
• Woods, R. L., and Lawrence, K., Modeling
and Simulation of Dynamic Systems,
Prentice Hall, 1997.
• Palm, W. J., Modeling, Analysis, and
Control of Dynamic Systems
• http://www.me.cmu.edu/ctms/index.html

You might also like