You are on page 1of 76

Process Control: Designing Process and Control

Systems for Dynamic Performance


Chapter 3. Mathematical Modelling Principles

Copyright © Thomas Marlin 2013


The copyright holder provides a royalty-free license for use of this material at non-profit
educational institutions
CHAPTER 3 : MATHEMATICAL
MODELLING PRINCIPLES
When I complete this chapter, I want to be
able to do the following.

• Formulate dynamic models based on


fundamental balances
• Solve simple first-order linear dynamic
models
• Determine how key aspects of dynamics
depend on process design and operation
CHAPTER 3 : MATHEMATICAL
MODELLING PRINCIPLES
Outline of the lesson.

• Reasons why we need dynamic models


• Six (6) - step modelling procedure
• Many examples
- mixing tank
- CSTR
- draining tank
• General conclusions about models
• Workshop
WHY WE NEED DYNAMIC MODELS

Do the Bus and bicycle have different dynamics?


• Which can make a U-turn in 1.5 meter?
• Which responds better when it hits a bump?

Dynamic performance
depends more on the vehicle
than the driver!

The process dynamics


are more important
than the computer
control!
WHY WE NEED DYNAMIC MODELS

Feed material is delivered periodically, but the process


requires a continuous feed flow. How large should should
the tank volume be?
Periodic Delivery flow
Continuous
Feed to process

Time
We must provide
process flexibility
for good
dynamic performance!
WHY WE NEED DYNAMIC MODELS

The cooling water pumps have failed. How long do we have


until the exothermic reactor runs away?

Temperature
F
Dangerous

T L
A
time

Process dynamics
are important
for safety!
WHY WE DEVELOP MATHEMATICAL MODELS?

Input change, Effect on


e.g., step in Process output
coolant flow rate variable

T
A

Math models How does the • How far?


help us answer process • How fast
these questions! influence the
response? • “Shape”
SIX-STEP MODELLING PROCEDURE

1. Define Goals We apply this procedure


2. Prepare • to many physical systems
information
• overall material balance
3. Formulate
• component material balance
the model
• energy balances
4. Determine
the solution
5. Analyze
Results T
A
6. Validate the
model
SIX-STEP MODELLING PROCEDURE

1. Define Goals • What decision?


2. Prepare • What variable?
information • Location
T

3. Formulate A

the model
4. Determine
the solution Examples of variable selection

5. Analyze liquid level  total mass in liquid


Results pressure  total moles in vapor
6. Validate the temperature  energy balance
model
concentration  component mass
SIX-STEP MODELLING PROCEDURE

1. Define Goals • Sketch process Key property


of a “system”?
2. Prepare • Collect data
information
• State
3. Formulate assumptions
the model
• Define system
4. Determine
Variable(s) are the
the solution same for any
5. Analyze location within
Results T the system!
A

6. Validate the
model
SIX-STEP MODELLING PROCEDURE
CONSERVATION BALANCES
1. Define Goals
Overall Material
2. Prepare
information Accumulation of mass mass in mass out
3. Formulate Component Material
the model
Accumulati on of  component  component 
   
4. Determine component mass   mass in  mass out 
the solution generation of 
 
component mass 
5. Analyze Energy*
Results Accumulation 
   U  PE  KEin  U  PE  KEout
6. Validate the U  PE  KE 
model Q-W

* Assumes that the system volume does not change


SIX-STEP MODELLING PROCEDURE

1. Define Goals • What type of equations do we use first?


2. Prepare Conservation balances for key variable
information
• How many equations do we need?
3. Formulate
the model Degrees of freedom = NV - NE = 0
4. Determine • What after conservation balances?
the solution Constitutive
equations, e.g., Not
5. Analyze
fundamental,
Results Q = h A (T) based on
6. Validate the rA = k 0 e -E/RT empirical data
model
SIX-STEP MODELLING PROCEDURE
Our dynamic models will involve
1. Define Goals
differential (and algebraic) equations
2. Prepare because of the accumulation terms.
information
dC A
3. Formulate V  F (C A0  C A )  VkC A
the model dt
4. Determine With initial conditions
the solution CA = 3.2 kg-mole/m3 at t = 0
5. Analyze
Results And some change to an input
variable, the “forcing function”, e.g.,
6. Validate the
model CA0 = f(t) = 2.1 t (ramp function)
SIX-STEP MODELLING PROCEDURE

1. Define Goals We will solve simple models analytically


2. Prepare to provide excellent relationship between
information process and dynamic response, e.g.,

𝐶 𝐴 (𝑡)=𝐶 𝐴 (𝑡)|𝑡=0 𝑒 +(Δ𝐶 𝐴0)𝐾(1−𝑒 )


3. Formulate −𝑡/𝜏 −𝑡/𝜏
the model
4. Determine
the solution Many results will have the same
5. Analyze form! We want to know how the
Results process influences K and , e.g.,

6. Validate the F V
model K 
F  kV F  Vk
SIX-STEP MODELLING PROCEDURE
We will solve complex models
1. Define Goals
numerically, e.g.,
2. Prepare
information dC A
V  F (C A0  C A )  VkC A2
3. Formulate dt
the model Using a difference approximation
4. Determine for the derivative, we can derive the
the solution Euler method.
5. Analyze  F (C A0  C A )  VkC A2 
C An  C An1  ( t ) 
Results  V  n 1
6. Validate the
model Other methods include Runge-Kutta
and Adams.
SIX-STEP MODELLING PROCEDURE

1. Define Goals • Check results for correctness


2. Prepare - sign and shape as expected
information - obeys assumptions
- negligible numerical errors
3. Formulate
• Plot results
the model
• Evaluate sensitivity & accuracy
4. Determine
the solution
5. Analyze
Results
6. Validate the
model • Compare with empirical data
SIX-STEP MODELLING PROCEDURE

1. Define Goals
Let’s practice modelling until we are
2. Prepare ready for the Modelling Olympics!
information
3. Formulate
the model
4. Determine
the solution
5. Analyze
Results Please remember that modelling is not
a spectator sport! You have to practice
6. Validate the
(a lot)!
model
MODELLING EXAMPLE 3.1. MIXING TANK

Textbook Example 3.1: The mixing tank in the figure has


been operating for a long time with a feed concentration of
0.925 kg-mole/m3. The feed composition experiences a step
to 1.85 kg-mole/m3. All other variables are constant.
Determine the dynamic response.

F
CA0
CA V

(We’ll solve this in class.)


Let’s understand this response, because we will see it
over and over!
Output is smooth, monotonic curve
1.8
tank concentration

1.6 Maximum
1.4 slope at  63% of steady-state CA At steady state
“t=0” CA = K CA0
1.2

0.8 
0 20 40 60 80 100 120
time
Output changes immediately
2
inlet concentration

1.5

CA0 Step in inlet variable


1

0.5
0 20 40 60 80 100 120
time
MODELLING EXAMPLE 3.2. CSTR

The isothermal, CSTR in the figure has been operating for


a long time with a feed concentration of 0.925 kg-mole/m3.
The feed composition experiences a step to 1.85
kg-mole/m3. All other variables are constant. Determine
the dynamic response of CA. Same parameters as textbook
Example 3.2

F
CA0
A B CA V
 rA  kC A
(We’ll solve this in class.)
MODELLING EXAMPLE 3.2. CSTR
Annotate with key features similar to Example 1
reactor conc. of A (mol/m3)

0.8
Which is faster,
mixer or CSTR?
0.6
Always?
0.4
0 50 100 150
time (min)

2
inlet conc. of A (mol/m3)

1.5

0.5
0 50 100 150
time (min)
MODELLING EXAMPLE 3.3. TWO CSTRs

Two isothermal CSTRs are initially at steady state and


experience a step change to the feed composition to the
first tank. Formulate the model for CA2. Be especially
careful when defining the system!

F
CA0
CA1 V1
CA2 V2
A B
 rA  kC A
(We’ll solve this in class.)
MODELLING EXAMPLE 3.3. TWO CSTRs
Annotate with key features similar to Example 1
1.2 1.2
tank 1 concentration

tank 2 concentration
1 1

0.8 0.8

0.6 0.6

0.4 0.4

0 10 20 30 40 50 60 0 10 20 30 40 50 60
time

2
inlet concentration

1.5

0.5
0 10 20 30 40 50 60
time
SIX-STEP MODELLING PROCEDURE

1. Define Goals We can solve only a few models


analytically - those that are linear
2. Prepare
(except for a few exceptions).
information
We could solve numerically.
3. Formulate
the model We want to gain the INSIGHT from
learning how K (s-s gain) and ’s
4. Determine
(time constants) depend on the
the solution
process design and operation.
5. Analyze
Results
Therefore, we linearize the models,
6. Validate the even though we will not achieve an
model exact solution!
LINEARIZATION
Expand in Taylor Series and retain only constant and linear
terms. We have an approximation.

This is the only variable

dF 1 d 2F
F ( x )  F ( xs )  ( x  xs )  2
( x  xs ) 2  R
dx xs 2! dx xs

Remember that these terms are constant


because they are evaluated at xs

We define the deviation variable: x’ = (x - xs)


LINEARIZATION

y =1.5 x2 + 3 about x = 1
We must evaluate the
exact

approximation. It depends
on approximate

• non-linearity
• distance of x from xs

Because process control maintains variables near desired


values, the linearized analysis is often (but, not always)
valid.
MODELLING EXAMPLE 3.5. N-L CSTR

Textbook Example 3.5: The isothermal, CSTR in the figure


has been operating for a long time with a constant feed
concentration. The feed composition experiences a step.
All other variables are constant. Determine the dynamic
response of CA.
Non-linear!

F
CA0
A B CA V
 rA  kC A2
(We’ll solve this in class.)
MODELLING EXAMPLE 3.5. N-L CSTR

We solve the linearized model analytically and the non-linear


numerically.
Deviation variables
do not change the
answer, just
translate the values

In this case, the


linearized
approximation is
close to the
“exact”non-linear
solution.
[ ][ ] [ ]
𝑎 11 𝑎 12 𝑎 13 𝑥1 𝑎11 𝑥 1+ 𝑎 12 𝑥2 + 𝑎13 𝑥 3
𝑎 21 𝑎 22 𝑎 23 𝑥 2 = 𝑎 21 𝑥 1 +𝑎 22 𝑥 2+ 𝑎 23 𝑥 3
𝑎 31 𝑎 32 𝑎 33 𝑥3 𝑎 31 𝑥 1 +𝑎 32 𝑥 2+ 𝑎 33 𝑥 3
MODELLING EXAMPLE 3.6. DRAINING TANK

Textbook Example 3.6: The tank with a drain has a


continuous flow in and out. It has achieved initial steady
state when a step decrease occurs to the flow in. Determine
the level as a function of time.

Solve the non-linear and linearized models.


MODELLING EXAMPLE 4. DRAINING TANK

Small flow change:


linearized
approximation is good

Large flow change:


linearized model is
poor – the answer is
physically impossible!
(Why?)
DYNAMIC MODELLING
We learned first-order systems have the same output “shape”.

dY
  Y  K[f (t ))] with f(t) the input or forcing
dt
Output is smooth, monotonic curve
1.8
tank concentration

1.6
Maximum
1.4 slope at » 63% of steady-state D At steady state
“t=0”
Sample 1.2 D = K
response 1

to a step 0.8 t
0 20 40 60 80 100 120
input time
Output changes immediately
2
inlet concentration

1.5

 = Step in inlet variable


1

0.5
0 20 40 60 80 100 120
time
DYNAMIC MODELLING

The emphasis on analytical relationships is directed to


understanding the key parameters. In the examples, you
learned what affected the gain and time constant.

K: Steady-state Gain :Time Constant


• sign
• sign (positive is stable)
• magnitude (don’t forget
• magnitude (don’t forget
the units)
the units)
• how depends on design
• how depends on design
(e.g., V) and operation
(e.g., V) and operation
(e.g., F)
(e.g., F)
DYNAMIC MODELLING: WORKSHOP 1

For each of the three processes we modelled, determine how


the gain and time constant depend on V, F, T and CA0.

• Mixing tank
• Linear CSTR F
• CSTR with CA0
CA V
second order
reaction
DYNAMIC MODELLING: WORKSHOP 2

Describe three different level sensors for measuring liquid


height in the draining tank. For each, determine whether the
measurement can be converted to an electronic signal and
transmitted to a computer for display and control.

I’m getting tired of monitoring


the level. I wish this could
be automated.

L
DYNAMIC MODELLING: WORKSHOP 3

Model the dynamic response of component A (CA) for a


step change in the inlet flow rate with inlet concentration
constant. Consider two systems separately.
• Mixing tank
• CSTR with first order reaction
V = constant

F
CA0
CA V
DYNAMIC MODELLING: WORKSHOP 4

The parameters we use in mathematical models are never


known exactly. For several models solved in the textbook,
evaluate the effect of the solution of errors in parameters.
•  20% in reaction rate constant k
•  20% in heat transfer coefficient
•  5% in flow rate and tank volume
How would you consider errors in several parameters in the
same problem?
Check your responses by simulating using the MATLAB m-
files in the Software Laboratory.
DYNAMIC MODELLING: WORKSHOP 5

Determine the equations that are solved for the Euler


numerical solution for the dynamic response of draining
tank problem. Also, give an estimate of a good initial value
for the integration time step, t, and explain your
recommendation.
DYNAMIC MODELLING: WORKSHOP 6

A. Select a topic of interest to you that can be investigated


using mathematical modelling and research
developments in modelling the topic. For some ideas, see
the following.
http://plus.maths.org/content/teacher-package-mathemati
cal-modelling

B. Results from mathematical models contain uncertainty.


Review the following report and discuss uncertainty in
the models that you investigated in Part A above.

http://www.nap.edu/openbook.php?record_id=13395
CHAPTER 3 : MATH. MODELLING
How are we doing?

• Formulate dynamic models based on


fundamental balances
• Solve simple first-order linear dynamic
models
• Determine how key aspects of dynamics
depend on process design and operation

Lot’s of improvement, but we need some more study!


• Read the textbook
• Review the notes, especially learning goals and workshop
• Try out the self-study suggestions
• Naturally, we’ll have an assignment!
CHAPTER 3: LEARNING RESOURCES
• SITE PC-EDUCATION WEB
- Instrumentation Notes
- Interactive Learning Module (Chapter 3)

www.pc-education.mcmaster.ca/

- Tutorials (Chapter 3)
- M-files in the Software Laboratory (Chapter 3)
• Read the sections on dynamic modelling in previous
textbooks
- Felder and Rousseau, Fogler, Incropera & Dewitt
CHAPTER 3:
SUGGESTIONS FOR SELF-STUDY
1. Discuss why we require that the degrees of freedom for a
model must be zero. Are there exceptions?
2. Give examples of constitutive equations from prior
chemical engineering courses. For each, describe how we
determine the value for the parameter. How accurate is
the value?
3. Prepare one question of each type and share with your
study group: T/F, multiple choice, and modelling.
4. Using the MATLAB m-files in the Software Laboratory,
determine the effect of input step magnitude on linearized
model accuracy for the CSTR with second-order reaction.
CHAPTER 3:
SUGGESTIONS FOR SELF-STUDY
5. For what combination of physical parameters will a first
order dynamic model predict the following?
• an oscillatory response to a step input
• an output that increases without limit
• an output that changes very slowly
6. Prepare a fresh cup of hot coffee or tea. Measure the
temperature and record the temperature and time until
the temperature approaches ambient.
• Plot the data.
• Discuss the shape of the temperature plot.
• Can you describe it by a response by a key parameter?
• Derive a mathematical model and compare with your
experimental results

You might also like