Professional Documents
Culture Documents
Modelling
Dr George Panoutsos
Department of Automatic Control and
Systems Engineering
Welcome!
Dr George Panoutsos
Amy Johnson Building (ACSE), Room D8a
g.panoutsos@sheffield.ac.uk
MOLE
Lecture Slides
code, examples
Notes
Extra Material
Module Structure
ACS6001 Systems Modelling
30 Credits for the whole of ACS6001
Assessment: Assignment 12.5% - ACS6001.02b GP
Monday 29 Nov. 2010, 4pm
(barcode system)
2.Theoretical
& Empirical
Equations
3. System
Linearisation
4. First
Order
Systems
5. Second
Order
Systems
6. Transfer
Function
Models
7. DC Motor
Models
8. Block
Diagrams
9. State Space
Models
Computing
Design
System
Testing
Abstraction
Computer
Simulation
Systems Modelling
Performance
Mathematical
Analysis
Dynamic Analysis
Systems Modelling
Systems Engineering
What is systems engineering?
10
Systems Engineering
What is systems engineering?
Aslaksen & Belcher, Sys. Eng. Chapter 2
2.1.1
2.1.2
2.1.3
11
Systems Modelling
1. System description and
abstraction
We need to
have an understanding of the system
be able identify the systems relevant
components
be able to suggest an appropriate
abstraction level
Example
ACS6001 2010-2011 Copyright
12
Systems Modelling
2. Modelling the system
Solving the model
A mathematical
model is a description
of a system in terms
of equations
Close, Modeling and Analysis of Dyn
Sys, pp2-4
ACS6001 2010-2011 Copyright
y=f(x)
13
Systems Modelling
2. Modelling the system
Solving the model
y=f(x)
14
Systems Modelling
3. Computer aided
simulation
Easier to analyse
complex and/or large
scale systems
MATLAB/Simulink
(Dr Z Q Lang)
Y1=f(x1)
Y2=f(x1,x2)
Y3=g(x3)
Y4=g(x1,x3)
Y5= Y3-Y1
15
Systems Modelling
Performance related to
design/specification
amplitude
time
16
Systems Modelling
Example of the systems engineering
approach
Student attention level in lectures
17
System Abstraction
What is abstraction and why we need it?
simplification
Partitioning the system allows for a reduced
complexity
Easier to focus on specific system properties
Fundamental to the systems approach
18
Example:
The human cardiovascular system
19
Example:
The human cardiovascular system
20
Example:
The human
cardiovascular system
21
Example:
The human cardiovascular system
What is the correct abstraction level?
Problem specific
It needs to include the systems properties under
investigation
Sometimes its not possible to get to the right
abstraction level! (why?)
ACS6001 2010-2011 Copyright
22
Systems Modelling
What is a model?
A model is representation of something
The model should be as similar as possible to the
entity that it represents
but can never be exactly same as the real thing!
23
Systems Modelling
Types of model
Physical toy model of a car
Pilot plant a small/large scale working model
of a system
Mathematical set of equations describing
the real system
ACS6001 2010-2011 Copyright
24
Reduce risk
25
26
27
Mathematical Models
can be applied to a variety of systems:
Engineering
Biomedical
Financial
Weather
+ many more!
ACS6001 2010-2011 Copyright
28
Mathematical Models
For this course:
Model is a set of mathematical equations
describing the behaviour of a system
29
Modelling errors
Parameters difficult to measure
i.e. friction
Environmental errors
Temperature, pressure, humidity
ACS6001 2010-2011 Copyright
30
31
Example
32
Modelling Techniques
Theoretical equations
System behaviour is known from theory
Example: electrical circuit
33
Modelling Techniques
Empirical Equations
System behaviour is not known from theory
or too complex!
34
Modelling Techniques
3. Fit a mathematical relationship
Example: CV system
35
Example:
Mathematical model of CV system
(simplified form)
Blood pressure (systolic mmHg)
Cortisol level (total metabolites)
Blood pressure
Cortisol
100
5000
120
6000
140
7000
160
8000
36
In practice a combination of
theoretical/empirical models may be used
as necessary
Example: electrical circuit
Independent study:
Complexity Generality!
regarding systems modelling
2.Theoretical
& Empirical
Equations
3. System
Linearisation
4. First
Order
Systems
5. Second
Order
Systems
6. Transfer
Function
Models
7. DC Motor
Models
8. Block
Diagrams
9. State Space
Models
dY
= AY + BX
dt
2nd
d 2Y
dY
=A
+ BY + CX
2
dt
dt
SYSTEM
COMPONENT
OUTPUT Y
Superposition principle
Test for linearity:
Suppose: Input X 1 (T ) Output Y1 (T ) and
Input X 2 (T ) Output Y2 (T )
What does
input of X 1 (T ) + X 2 (T )
give?
If X 1 (T ) + X 2 (T ) Y1 (T ) + Y2 (T ), system is linear.
If not, system is non-linear.
Examples
ACS6001 2010-2011 Copyright
Superposition principle
In general:
Electrical, mechanical systems:
Approximately linear over certain operating
range
Thermal, fluid systems: non-linear
Linearisation
dg
y = g ( x0 ) +
dx
d 2g
( x x0 ) +
dx 2
x= x0
x= x0
( x x0 ) 2
d 3g
+
dx 3
2
x= x0
( x x0 ) 3
+
3!
(1)
dg
dx
Or:
where y0 = g ( x0 ) and
( x x0 )
x= x0
y = y0 + m( x x0 )
m=
dg
dx
x= x0
( y y0 ) = m ( x x0 )
or as: y = m x
10
Multiple inputs
with one output
Suppose
y = g ( x1 , x2 , xn )
Expanding about
and neglecting high
order terms:
g
y = g ( x10 , x20 , xn 0 ) +
x1
g
( x1 x10 ) +
x2
x= x0
+
( x2 x20 )
x= x0
g
xn
( x1 xn 0 )
x= x0
11
Example:
Pendulum
L
1
0.8
0.6
Torque
0.4
0.2
0
-pi
pi
-0.2
-0.4
-0.6
-0.8
-1
-4
-3
-2
-1
Angle
12
d sin
( )
d
0
= MgL cos 0o 0o
= 0
= MgL
This is reasonably accurate over the range
13
120
Blood Pressure
110
100
90
80
70
60
50
40
500
600
700
800
900
Sampling Time
1000
1100
1200
14
Types of systems
Linear across the whole range
Linear for specific range
Linear only around a specific point
Other types of non-linearity
Saturation
Dead-zone
ACS6001 2010-2011 Copyright
15
Dead-zone
Other non-linearities: delay, backlash
A look-up table may be used to describe the
system
ACS6001 2010-2011 Copyright
16
st
1
Order Systems
Example 1
A cup of coffee cooling from 100 o C to room temperature of 21o C .
M odelling
It is known from theoretical considerations that the rate of heat loss if proportional to
the difference between the temperature of the coffee and room temperature (thus,
the rate of heat loss decreases as the temperature of the coffee falls).
It is also known from theoretical considerations that the rate of fall in temperature is
proportional to the rate of heat loss.
Thus:
dT
= k (T Troom )
dt
(1)
Troom
17
st
1
Order Systems
Example 2
A water tank with a steady flow of water into the top of the tank has a leak from the
bottom of the tank.
The rate of leakage is proportional to the depth of the water in the tank, H.
M odelling
Rate of inflow = S
dH
= S KH
dt
(2)
18
Use of models
Models are created in order to investigate how the real system that the model
represents behaves. We may wish to determine the following from the models above:
Example 1
o
How long will it take for the coffee to cool to 90 C ?
Example 2
N.B. solving or simulating a model involves forming an expression for the output
variable of the system as a function of time.
Solving example 1
dT
+ kT = kTroom
dt
(3)
90 = 79e kt + 21
e kt = 69 79 ;
Thus, kt = 0.1353
We are trying to find a value for t but we have only got a value for kt
We can find an approximate vale for k but not its exact value.
Hence, although we know the general form of the model from the background theory,
there is an error because we do not know the exact value of k.
ekt = 79 69 = 1.1449
When the water level reaches steady-state, the rate of change of level is zero, i.e.
dH/dt=0.
Thus, H = S/K
Note that we need to know the value of the parameter K in order to get H
To get an expression for the value of H at some general time t, we need to solve
equation (2).
To do this, we can apply the general solution for a first order system given in equation
(5) if we make the following substitutions:
X = H, a = K, b = 1, u = S.
ACS6001 2010-2011 Copyright
2.Theoretical
& Empirical
Equations
3. System
Linearisation
4. First
Order
Systems
5. Second
Order
Systems
6. Transfer
Function
Models
7. DC Motor
Models
8. Block
Diagrams
9. State Space
Models
nd
2
order systems
MS System
Newtons second
law of motion states:
Consider a small
displacement of
mass y downwards:
Force exerted by spring = Ky
Thus, Ky = My
or My + Ky = 0
ACS6001 2010-2011 Copyright
D-MS System
or My + Cy + Ky = 0
Solution of
equations
nd
2
order system
Output = f(t)
Analytical type of solution (as the one
developed for 1st order systems) is very
difficult for 2nd order systems!
We can use Laplace transform instead
Laplace Transform
Time
domain,
differential
equation
Laplace
Transform
Laplace
variable S,
algebraic
equation
D-MS System
Solution of:
My + Cy + Ky = 0
Laplace transform:
M [ s 2Y ( s ) sy (0) y (0)] + C [sY ( s ) y (0)] + KY ( s ) = 0
Initial conditions?
D-MS System
M [ s 2Y ( s ) sy (0) y (0)] + C [sY ( s ) y (0)] + KY ( s ) = 0
(Eq. 1)
Initial conditions:
Let y (0) = y0 ; y = 0 at t = 0
9
Inserting initial conditions in equation (1) gives:
Y ( s) =
(Ms + C ) y0
(Eq.2)
Ms + Cs + K
2
s + y0
A( s )
M
Y (s) =
=
C
K B( s)
s2 +
s+
M
M
where A( s) = s +
C
Cs K
2
+
y0 and B ( s ) = s +
M
M M
(Eq.3)
10
Design example
returning to equation 3:
s+5
Then : Y ( s ) = 2
s + 5s + 6
Let
C
=5 ;
M
s+5
(s + 2)(s + 3)
K
=6
M
y0 = 1
11
Design example
Expanding as partial fractions:
3
2
Y (s) =
(s + 2) (s + 3)
Y (s) =
k1
k
+ 2
(s + 2) (s + 3)
k1 =
(s + 2)(s + 5) = (s + 5) = 3 = 3
(s + 2)(s + 3) s =2 (s + 3) s =2 1
k2 =
(s + 3)(s + 5) = (s + 5) = 2 = 2
(s + 2)(s + 3) s =3 (s + 2) s =3 1
12
Design example
Performance evaluation
Step Response
0.9
0.8
0.7
Amplitude
0.6
0.5
0.4
0.3
0.2
0.1
0
0.5
1.5
Time (sec)
2.5
3.5
13
Design example
Performance evaluation
Step Response
c/m=5 -> 3
0.7
0.6
(damper)
Amplitude
0.5
0.4
0.3
0.2
0.1
0.5
1.5
2.5
Time (sec)
3.5
4.5
14
Design example
Performance evaluation
k/m=6 -> 10
Step Response
0.45
0.4
(spring)
0.35
Amplitude
0.3
0.25
0.2
0.15
0.1
0.05
0
0.5
1.5
2.5
Time (sec)
3.5
4.5
15
Design example
Have we finished our design?
No! we cannot apply S domain equations to
the system!
16
[ ] = (s 1 a )
Hence,
Y (s) =
1
at
L1
=
e
s a
at
(Eq.4)
3
2
(s + 2) (s + 3)
y (t ) = 3e 2t 2e 3t
17
Simulation languages
Clearly, the process of simulation by solving the model
equations is tedious.
Because of this, simulation is usually carried out by using
purpose-designed simulation languages
Different simulation languages require the system to be
described in different ways.
One way is to express the system in terms of first and
second order ordinary differential equations (as just
developed in recent lectures).
Another way is to express the system in terms of the
transfer functions of its components.
ACS6001 2010-2011 Copyright
18
Transfer function
The relationship between the input and
output of a system component is often
expressed in terms of the TRANSFER
FUNCTION (TF).
L [ y (t ) ]
TF =
L [ x(t ) ]
19
Transfer function
LTI only!
Cannot describe internal system structure
(i.e. in/out only)
2.Theoretical
& Empirical
Equations
3. System
Linearisation
4. First
Order
Systems
5. Second
Order
Systems
6. Transfer
Function
Models
7. DC Motor
Models
8. Block
Diagrams
9. State Space
Models
DC Motors
Widely applied in industry
Robot manipulators
Disc drives
Machine tools
Home appliances
etc.
DC Motors
Benefits
Provide accurate speed/position control
Portable
High torque
Drawbacks
Not enough power for certain applications (use
hydraulics instead)
Difficult to use in gas explosion risk environments
ACS6001 2010-2011 Copyright
DC Motors
Main components:
A rotor (armature)
which rotates and
therefore creates the
torque for the load
A stator (does not
move) which is used to
create a magnetic field
for the rotor
ACS6001 2010-2011 Copyright
DC Motors
Electromagnetic phenomena:
Torque creation due to a current in a
conductor (rotor) that is exposed to a
magnetic field (created by the stator)
Induction of back EMF to the rotor due to a
moving conductor (rotor) in a magnetic field
(created by the stator)
ACS6001 2010-2011 Copyright
DC Motors
Physics: Some units that well use:
Force: N=kgm/s2
Torque: Nm
Current: A (Ampere)=C/s (Coulomb/s)
Magnetic Field: T (Tesla)=N/(Am)
Magnetic flux: Wb (Webber) = Tm2
DC Motors
Creation of torque:
Lorentz Force
dF = idl B
DC Motors
Torque:
T=I A B sin
where A is the area of
the current loop (coil)
DC Motors
10
DC Motors
Brushes
Commutator
11
DC Motors
In practice:
Several coils are added into to armature to increase torque.
As an approximation
T = Ka I
12
DC Motors
Back EMF (electro-motive force)
Faradays law of induction
(one coil)
(many coils)
d c
dA( B cos )
=
dt
dt
d
= AB sin
= AB sin
dt
e =
eb = K b
Kb = K a
eb
- +
-
13
DC Motors
Electrical and mechanical equations:
dI
ea = Ra I + La
+ eb
dt
d 2
d
J 2 +F
=T
dt
dt
14
DC Motors
Differential equation
model of armature
controlled DC motors
dI
ea = Ra I + La dt + eb
T = K a I
J + F = T
, = d / dt
e
K
=
b
b
Kb = K a
15
DC Motors
Laplace transform
16
DC Motors
Solve ia as a function
of ea, then use the
result in the torque
equation
17
DC Motors
Use the new torque
result in the
mechanical equation
18
DC Motors
Use the back EMF
equation and solve for
theta
19
DC Motors
Armature
-
Motor Load
20
DC Motors
Frequently the
armature inductance
is neglected
TF Model
La=0
Differential equation
21
DC Motors
Frequently the
armature inductance
is neglected
La=0
TF Model
22
DC Motors
State-space
representation:
Define state variables:
Define control and
input variables:
23
DC Motors
DC Motor with a gearbox
Inertias, frictions: common reference
NL NM = n
NL
NM
+
Inertia
Friction
Angle
Motor
Jm
Fm
m
Load
JL
FL
L
24
DC Motors
DC Motor with a gearbox
Load to motor gear ratio: NL/NM=n
Mechanical equation:
25
DC Motors
DC Motor with a gearbox
n = N L N M = L M = r1 r2
2 r1 N M = 2 r2 N L
J m m = Tm r1 f c Fmm
J L L = r2 f c FL L
Tm=
m =
fc
fc
ACS6001 2010-2011 Copyright
= L
= f c r2
26
DC Motors
DC Motor with a gearbox
Mechanical equation
2
2
J
+
n
J
+
(
F
+
n
FL )m =
Tm
( m
L) m
m
or
J m + Fm =
Tm
where:
J=
J m + n2 J L , F =
Fm + n 2 FL
ACS6001 2010-2011 Copyright
27
DC Motors
The modelling process:
1. Schematic diagram of the system
28
DC Motors
4. Derive an output-input set of equations
describing the process under
investigation
5. Apply Laplace transform to bring the
equations to a transfer function format
6. Draw a block diagram of the
process/system in TF format
ACS6001 2010-2011 Copyright
29
DC Motors
7. Use a software package to further
investigate/analyse the system (i.e.
simulink)
30
Conclusions: DC Motors
Transfer functions for systems under
investigation are not typically available
Control/Systems engineer to derive them!
31
Conclusions: DC Motors
Physical models allow the engineer to:
See the effect of various system parameters
Give physical meaning to the states of the
system
Get a better understanding of the limitations
of the model
modelling is the most time consuming stage
of the control design workflow
ACS6001 2010-2011 Copyright
2.Theoretical
& Empirical
Equations
3. System
Linearisation
4. First
Order
Systems
5. Second
Order
Systems
6. Transfer
Function
Models
7. DC Motor
Models
8. Block
Diagrams
9. State Space
Models
Y ( s) = G ( s) R( s)
Y ( s ) = G1 ( s) R1 ( s ) + G2 ( s ) R2 ( s )
Two TFs
Y1 ( s ) = G11 ( s ) R1 ( s ) + G12 ( s ) R2 ( s )
Y2 ( s ) = G21 ( s ) R1 ( s ) + G22 ( s ) R2 ( s )
or in Matrix Form:
Y1 ( s ) G11 ( s ) G12 ( s ) R1 ( s )
Y ( s ) = G ( s ) G ( s ) R ( s )
22
2 21
2
Y1 ( s ) G11 ( s )
Y2 ( s ) G21 ( s )
Y ( s ) G ( s )
I I1
G1J ( s ) R1 ( s )
G2 J ( s ) R2 ( s )
GIJ ( s ) RJ ( s )
Example:
Complex D-MS system
k
c2
M1
c1
M2
ACS6001 2010-2011 Copyright
Example:
Complex D-MS system
Review of modelling strategy
(1) Split system into its separate component parts
(2) Model each component separately
(3) Combine the component models into a model
of the full system
Here, there are two main components, M1 and M2
k
c2
M1
c1
M2
Example:
Difficulty: to get the damper forces right
k
c2
M1
x1
c1
x2
M2
w(t)
ACS6001 2010-2011 Copyright
Forces on M1
Spring force : Kx1( t )
Damper force : C1 [ x 1( t ) x 2( t )]
Accelerating force : M1x1( t )
Equating forces:
Newtons 2nd law of motion: ODE (1)
Forces on M2
Damper forces : C 2 x 2( t ) C1 [ x 2( t ) x 1( t )]
Accelerating force : M2 x 2( t )
Disturbing force : W( t )
Equating forces:
Newtons 2nd law of motion: ODE (2)
10
sC1
X 2( s ) W( s )
= 0
2
X
(
s
)
s M1 + sC1 + k 1
sC1
11
Block Diagram
The facility to represent the relationship of
a systems variables using diagrammatic
means
Block Diagram representation
Modern Control Systems, Dorf & Bishop
12
G(s)
13
Example:
DC Motor TF model:
ea(s)
G(s) =
G(s)
(s)
14
X(s)
Y(s)=AX(s)
Or A=-5
Or k/M
Or 1/t
Y(s)
15
F(s)
Y(s)
16
F(s)
Y(s)
G(s)
Equivalent diagram:
X(s)
Numerical example
ACS6001 2010-2011 Copyright
F(s)G(s)
V(s)
V(s)
17
V1(s)
+
G(s)
Equivalent diagram:
X(s)
Numerical example
ACS6001 2010-2011 Copyright
Y(s)
V2(s)
F(s)+G(s)
Y(s)
18
Example:
s 3 + 12 s 2 + 35s + 19
s 3 + 9 s 2 + 26 s + 24
ACS6001 2010-2011 Copyright
19
Negative feedback
U(s)
V(s)
G(s)
Z(s)
H(s)
Y(s)
V ( s) = U ( s) Z ( s)
Y ( s ) = G ( s )V ( s )
Z ( s ) = H ( s )Y ( s )
eliminate V ( s ), Z ( s )...
Y ( s ) = G ( s )[U ( s ) H ( s )Y ( s )]
[1 + G ( s ) H ( s )]Y ( s ) = G ( s )U ( s )
or :
G (s)
T (s) =
1 + G ( s) H ( s)
20
Negative feedback
U(s)
G(s)
V(s)
Y(s)
Z(s)
Equivalent diagram:
H(s)
U(s)
G (s)
1 + G ( s) H ( s)
Y(s)
21
Positive feedback
U(s)
G(s)
V(s)
Y(s)
+
Z(s)
Equivalent diagram:
H(s)
U(s)
G (s)
1 G ( s) H ( s)
Y(s)
22
Example:
1
s 2 + a1s + a0
23
(s + 2) (s + 3)
24
DC Motor
Armature
-
Motor Load
25
System representation
We can also use signal flow graphs
(independent study)
26
5
X(s)
1
s
1
s 3 + 3s 2 + 4
1
s2 + 3
s+2
s 4 + 3s
+
+
Y(s)
2.Theoretical
& Empirical
Equations
3. System
Linearisation
4. First
Order
Systems
5. Second
Order
Systems
6. Transfer
Function
Models
7. DC Motor
Models
8. Block
Diagrams
9. State Space
Models
State variables
Definition: The state of a system is a set of
variables such that the knowledge of these
variables and the input functions will, with
the equations describing the dynamics,
provide the future state and output of the
system.
(Dorf & Bishop, Modern Control Sys.)
State variables
For a dynamic system, the state of the
system is described using the state
variables:
[x1(t), x2(t),, xn(t)]
Simple Example:
ON/OFF switch!
The state variables allow the system
outputs to be calculated for all time
provided that the inputs are known for all
time and the initial conditions are known.
ACS6001 2010-2011 Copyright
State equations
The differential equations in the state
variables relating the system inputs to the
system outputs are known as the state
equations.
D-MS
k
U(t)
M
y(t)
x1 (t ) = y (t )
x2 (t ) = y (t )
My(t ) + Cy (t ) + Ky (t ) = U (t )
(1)
x1 (t ) = x2 (t )
U (t ) Kx1 (t ) Cx2 (t )
(
)
=
x
t
2
M
M
M
(3)
(2)
10
x1 (t ) = Ky (t )
x2 (t ) = K 2 y (t )
Using Eq.1 :
My(t ) + Cy (t ) + Ky (t ) = U (t )
M
C
x (t ) + 2 x2 (t ) + x1 (t ) = U (t )
2 2
K
K
x1 (t ) = x2 (t ) / K
K 2U (t ) K 2 x1 (t ) Cx2 (t )
x2 (t ) =
M
M
M
11
x1 (t ) = x2 (t )
U (t ) Kx1 (t ) Cx2 (t )
(
)
=
x
t
2
M
M
M
x1 0
x = K
2
M
1
C
x1 0
+ 1 U
M x2 M
12
Linear Dependency
The state variables must be linearly
independent!
x1 (t ) = y (t )
x2 (t ) = Ky (t )
this will not result in 1st order odes
13
Linear Dependency
In general:
For a system of order n, if [x1(t), x2(t),, xn-1(t)]
are state variables then xn(t) is not a legitimate
system variable if it can be expressed as a liner
combination of the other state variables such as:
xn(t)=c1x1(t),+c2x2(t)+ + cn-1xn-1(t)
14
x n an1 ann x n bn1 bnm um
15
x1
x
2
is known as the state vector
x n
Usually the state space models are expressed in the following form:
where x is the state vector ,
u1
u is the input vector
um
a11 a1n
A=
an1 ann
b11 b1m
B=
bn1 bnm
x = Ax + Bu
16
c11 c1n
C=
c n1 c nn
y = Cx
17
18