Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ......

34
Process Control Laboratory 3. Mathematical Modelling 3.1 Modelling principles 3.1.1 Model types 3.1.2 Model construction 3.1.3 Modelling from first principles 3.2 Models for technical systems 3.2.1 Electrical systems 3.2.2 Mechanical systems 3.2.3 Process engineering systems 3.3 Model linearization 3.3.1 Motivation 3.3.2 Linearization of ODEs KEH Process Dynamics and Control 3–1

Transcript of Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ......

Page 1: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory 3. Mathematical Modelling 3.1 Modelling principles

3.1.1 Model types3.1.2 Model construction3.1.3 Modelling from first principles

3.2 Models for technical systems3.2.1 Electrical systems3.2.2 Mechanical systems3.2.3 Process engineering systems

3.3 Model linearization3.3.1 Motivation3.3.2 Linearization of ODEs

KEH Process Dynamics and Control 3–1

Page 2: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.1 Modelling principles

For design and analysis of a control system we need a mathematical model that describes the dynamical behaviour of the system. The dynamics can be described by differential equations for continuous-time dynamics difference equations for discrete-time dynamics

Most processes are time continuous, but some processes are inherently time discrete (e.g. radioactive decay) computer algorithms (i.e. controllers) and many measuring devices produce

outputs at discrete time instants– to design such controllers, we sometimes use discrete-time models to

describe continuous-time processes

In this course, we will consider both types of models controller design both in continuous and discrete time

However, the major part of the course deals with continuous time.

KEH Process Dynamics and Control 3–2

3.1.1 Model types

Page 3: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.1.2 Model constructionThere are two main principles for construction of mathematical models Modelling from first principles: we derive models using physical laws and other

known relationships (models). System identification: we use observations (measurements) of the system to

find a model empirically. Usually, designed identification experiments are carried out to generate suitable data.

Often both methods are combined: we derive the basic model from first principles and determine uncertain parameters by system identification.

It is important to realize that all models have a limited validity range, even the physical laws (e.g. Newton’s laws of motion do not apply close to the speed of light). It is especially important to note that models determined through system identification should not be used outside

the experimental range.

KEH Process Dynamics and Control 3–3

3.1 Modelling principles

Page 4: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.1.3 Modelling from first principlesIn the following we consider modelling from first principles. Because real technical systems tend to be complex we cannot or do not want to include all details of the system in the model.

We try to make a good compromise between the following two require-ments. The model should be sufficiently accurate for its intended purpose simple enough to use e.g. for system analysis and control design

In modelling from first principles, two types of mathematical relationships are used: conservation laws constitutive relationships

KEH Process Dynamics and Control 3–4

3.1 Modelling principles

Page 5: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.1 Modelling principles

Conservation lawsConservation laws apply to additive quantities of the same type in a system. There are two general kinds of conservation laws: flow balances ”effort” balances

A flow balance for a given quantity in a system has the general formaccumulation / time unit = inflow – outflow + production / time unit

where accumulation and production occur inside the system inflow and outflow cross the system boundaries

Flow balances apply to conserved quantities (under normal conditions). If no chemical or nuclear reactions take place, the production is zero.Examples of flow balance quantities: mass particles (moles) energy current (Kirchhoff’s first law)

Note that volume is not a conserved quantity for compressive fluids.

KEH Process Dynamics and Control 3–5

3.1.3 Modelling from first principles

Page 6: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.1 Modelling principles

An effort balance for a given quantity has the general formchange / time unit = forcing quantity – loading quantity

where change refers to a system property driving and loading refer to interaction with the surrounding

Generally, effort balances are applications of Newton’s laws of motion and Kirchhoff’s second law.

Examples of effort balance quantities: force momentum angular momentum voltage (Kirchhoff’s second law)

KEH Process Dynamics and Control 3–6

3.1.3 Modelling from first principles

Page 7: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.1 Modelling principles

Constitutive relationshipsConstitutive relationships are static relationships that relate quantities of different kinds in a system.

Examples of constitutive relationships: Ohm’s law: relates the current to the voltage over a resistance valve characteristics: relates the flow rate to the pressure drop over a valve Bernoulli’s law: relates the velocity of the flow out of a tank to the liquid level

in the tank the ideal gas law: relates the temperature to the pressure of a gas in a closed

container

KEH Process Dynamics and Control 3–7

3.1.3 Modelling from first principles

Page 8: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.1 Modelling principles

The general modelling procedure1. Formulate balance equations.2. Introduce constitutive relationships to

– relate variables to each other;– possibly to introduce new variables in the balance equations.

3. Do a correctness check by at least checking that– all additive terms in an equation have the same physical unit;– the left and right hand side of an equation have the same unit.

KEH Process Dynamics and Control 3–8

3.1.3 Modelling from first principles

Page 9: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.2 Models for technical systems3.2.1 Electrical systemsFig. 3.1 shows three basic components of electrical circuits.Variables 𝑡𝑡 = time 𝑢𝑢 = voltage [V] 𝑖𝑖 = current [A]

Component parameters 𝑅𝑅 = resistance [Ω] 𝐶𝐶 = capacitance [F] 𝐿𝐿 = inductance [H]

Relationships Resistor (Ohm’s law): 𝑢𝑢 𝑡𝑡 = 𝑅𝑅𝑖𝑖(𝑡𝑡) (3.1)

Capacitor: 𝑢𝑢 𝑡𝑡 = 𝑢𝑢 0 + 1𝐶𝐶 ∫0

𝑡𝑡 𝑖𝑖 𝜏𝜏 d𝜏𝜏 (3.2)

Inductor: 𝑢𝑢 𝑡𝑡 = 𝐿𝐿 d𝑖𝑖(𝑡𝑡)d𝑡𝑡

(3.3)

KEH Process Dynamics and Control –3 9

Fig. 3.1. Basic components in electrical circuits.

resistor capacitor inductor

Page 10: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

Example 3.1. A passive analog low-pass filter.

Notation: 𝑢𝑢R(𝑡𝑡) = voltage across the resistor, 𝑖𝑖R(𝑡𝑡) = current through the resistor 𝑢𝑢C(𝑡𝑡) = voltage across the capacitor, 𝑖𝑖C(𝑡𝑡) = current through the capacitor

According to Kirchhoff’s second law, the voltages satisfy

𝑢𝑢in 𝑡𝑡 = 𝑢𝑢R 𝑡𝑡 + 𝑢𝑢C(𝑡𝑡) (1)

𝑢𝑢out 𝑡𝑡 = 𝑢𝑢C(𝑡𝑡) (2)

When the output is uncharged, there is no current from the filter. Thus,

𝑖𝑖R 𝑡𝑡 = 𝑖𝑖C(𝑡𝑡) (3)

KEH Process Dynamics and Control –3 10

3.2.1 Electrical systems

Figure 3.2 shows a passive analog low-pass filter.How does the voltage 𝑢𝑢out(𝑡𝑡) on the output side depend on the voltage 𝑢𝑢in(𝑡𝑡) on the input side if the circuit is uncharged at the output? Fig. 3.2. A passive analog

low-pass filter.

Page 11: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.1 Electrical systems

Combination of (1) and (2) and elimination of 𝑢𝑢R(𝑡𝑡) by (3.1) give𝑢𝑢out 𝑡𝑡 = 𝑢𝑢in 𝑡𝑡 − 𝑅𝑅𝑖𝑖R (4)

Elimination of 𝑢𝑢C(𝑡𝑡) from (2) by (3.2) yields

𝑢𝑢out 𝑡𝑡 = 𝑢𝑢C 𝑡𝑡 = 𝑢𝑢C 0 + 1𝐶𝐶 ∫0

𝑡𝑡 𝑖𝑖C 𝜏𝜏 d𝜏𝜏 (5)

The derivative of both sides of (5) with respect to time givesd𝑢𝑢out(𝑡𝑡)

d𝑡𝑡= 1

𝐶𝐶𝑖𝑖C 𝑡𝑡 = 1

𝐶𝐶𝑖𝑖R(𝑡𝑡) (6)

where the last equality is given by (3). Combination of (4) and (6) to eliminate 𝑖𝑖R(𝑡𝑡) gives

𝑅𝑅𝐶𝐶 d𝑢𝑢out(𝑡𝑡)d𝑡𝑡

+ 𝑢𝑢out 𝑡𝑡 = 𝑢𝑢in(𝑡𝑡) (7)

This is a linear first-order differential equation. The circuit is a low-pass filterthat filters (i.e., reduces the amplitude of) of high-frequency oscillations in 𝑢𝑢in(𝑡𝑡).

In practical applications, the output is charged, which violates the assumption of this derivation. However, when an amplifier is used on the output side, (3) still holds (approximatively).

KEH Process Dynamics and Control –3 11

Example 3.1. A passive analog low-pass filter

Page 12: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

Example 3.2. A simple RLC circuit.Figure 3.3 shows a simple RLC circuitcharged by a current source.

How does the voltage across thecapacitor depend on the currentfrom the current source?

Notation: 𝑢𝑢R(𝑡𝑡) = voltage across the resistor, 𝑖𝑖R(𝑡𝑡) = current through the resistor 𝑢𝑢C(𝑡𝑡) = voltage across the capacitor, 𝑖𝑖C(𝑡𝑡) = current through the capacitor 𝑢𝑢L(𝑡𝑡) = voltage across the inductor, 𝑖𝑖L(𝑡𝑡) = current through the inductor

Kirchhoff’s laws give𝑢𝑢C 𝑡𝑡 = 𝑢𝑢R 𝑡𝑡 + 𝑢𝑢L(𝑡𝑡) (1)

𝑖𝑖 𝑡𝑡 = 𝑖𝑖R 𝑡𝑡 + 𝑖𝑖C(𝑡𝑡) (2)

𝑖𝑖R 𝑡𝑡 = 𝑖𝑖L(𝑡𝑡) (3)

KEH Process Dynamics and Control –3 12

3.2.1 Electrical systems

Fig. 3.3. A simple RLC circuit.

Page 13: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.1 Electrical systems

Substitution of (3.1) and (3.3) into (1):

𝑢𝑢C 𝑡𝑡 = 𝑅𝑅𝑖𝑖R 𝑡𝑡 + 𝐿𝐿 d𝑖𝑖L(𝑡𝑡)d𝑡𝑡

(4)

Elimination of 𝑖𝑖R(𝑡𝑡) and 𝑖𝑖L(𝑡𝑡) by (2) and (3):

𝑢𝑢C 𝑡𝑡 = 𝑅𝑅 𝑖𝑖 𝑡𝑡 − 𝑖𝑖C(𝑡𝑡) + 𝐿𝐿 d 𝑖𝑖 𝑡𝑡 −𝑖𝑖C(𝑡𝑡)d𝑡𝑡

(5)

According to eq. (6) in Ex. 3.1:

𝑖𝑖C 𝑡𝑡 = 𝐶𝐶 d𝑢𝑢𝑐𝑐(𝑡𝑡)d𝑡𝑡

(6)

Substitution of (6) into (5):

𝑢𝑢C 𝑡𝑡 = 𝑅𝑅 𝑖𝑖 𝑡𝑡 − 𝐶𝐶 d𝑢𝑢𝑐𝑐(𝑡𝑡)d𝑡𝑡

+ 𝐿𝐿d 𝑖𝑖 𝑡𝑡 −𝐶𝐶d𝑢𝑢𝑐𝑐(𝑡𝑡)

d𝑡𝑡d𝑡𝑡

(7)

After rearrangement:

𝐿𝐿𝐶𝐶 d2𝑢𝑢C(𝑡𝑡)d𝑡𝑡2

+ 𝑅𝑅𝐶𝐶 d𝑢𝑢C(𝑡𝑡)d𝑡𝑡

+ 𝑢𝑢C 𝑡𝑡 = 𝑅𝑅𝑖𝑖 𝑡𝑡 + 𝐿𝐿 d𝑖𝑖(𝑡𝑡)d𝑡𝑡

(8)

where 𝑖𝑖(𝑡𝑡) is the input signal and 𝑢𝑢C(𝑡𝑡) is the output signal.

This is a linear second-order differential equation.

KEH Process Dynamics and Control –3 13

Example 3.2. A simple RLC circuit

Page 14: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.2.2 Mechanical systemsThe modelling of mechanical systems are mainly based on Newton’s second law

𝐹𝐹 = 𝑚𝑚𝑎𝑎 (3.4)𝐹𝐹 is the force acting on the mass 𝑚𝑚 and 𝑎𝑎 is the acceleration of the mass.

Example 3.3. An undamped pendulum.Figure 3.4 shows an undamped swinging pendulum. The pendulum can only move in two directions in the plane of the figure. Its point of sus-pension is at a distance 𝑢𝑢 and its center of mass (the round weight at the lower end of the pendulum) is at a distance𝑦𝑦 from the left-side vertical line.How does the position 𝑦𝑦 depend on 𝑢𝑢 ?Notation: ℓ = length of pendulum, 𝑚𝑚 = weight of mass ℎ = vertical position of the center of mass 𝜃𝜃 = angle of swing away from a vertical position 𝐹𝐹 = force acting on the suspension point in the

“negative direction” (upwards)

KEH Process Dynamics and Control 3–14

3.2 Models for technical systems

Fig. 3.4. Swinging pendulum.

Page 15: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

When the pendulum is affected by the suspension force 𝐹𝐹 and the gravitational force 𝑚𝑚𝑔𝑔, Newton’s second law yields horizontal force components: 𝑚𝑚𝑦 = −𝐹𝐹 sin𝜃𝜃 (1) vertical force components: 𝑚𝑚ℎ = −𝐹𝐹 cos 𝜃𝜃 + 𝑚𝑚𝑔𝑔 (2)

Here 𝑦 and ℎ are second-order time derivatives of 𝑦𝑦 and ℎ, respectively, i.e. the acceleration in the respective directions.

Assume that the swing of the pendulum is moderate so that the angle 𝜃𝜃 is always small. The pendulum then moves very little in the vertical direction and we can assume that ℎ ≈ 0. Elimination of 𝐹𝐹 then gives

𝑦 + 𝑔𝑔 tan𝜃𝜃 = 0 (3)The angle 𝜃𝜃 is given by the trigonometric identity

tan𝜃𝜃 = 𝑦𝑦−𝑢𝑢ℎ

≈ 𝑦𝑦−𝑢𝑢𝑙𝑙

(4)

Combination of (3) and (4) yields the model

𝑦 + 𝑔𝑔ℓ𝑦𝑦 = 𝑔𝑔

ℓ𝑢𝑢 (5)

Notice that the approximations ℎ ≈ 0 and “𝜃𝜃 small” limit the validity of themodel.

KEH Process Dynamics and Control –3 15

3.2.2 Mechanical systems

Page 16: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

Example 3.4. Suspension system in a car.

KEH Process Dynamics and Control –3 16

3.2.2 Mechanical systems

Fig. 3.5. a) Spring-mounted mass with dampingb) Principle of car suspension system.

Page 17: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.2 Mechanical systems

a) How does the vertical deviation 𝑦𝑦(𝑡𝑡) from an equilibrium point depend on a force 𝑢𝑢(𝑡𝑡) acting on the spring-mounted mass 𝑚𝑚 ?An equilibrium point applies when 𝑦𝑦 = 𝑢𝑢 = 0 (units omitted). If the downward direction is the positive vertical direction, Newton’s second law for the spring force and the damping force of the cylinder gives

𝑚𝑚𝑦 = −𝑏𝑏𝑦 − 𝑘𝑘𝑦𝑦 + 𝑢𝑢 𝑡𝑡 , i.e., 𝑚𝑚𝑦 + 𝑏𝑏𝑦 + 𝑘𝑘𝑦𝑦 = 𝑢𝑢 𝑡𝑡 (1)where 𝑏𝑏 and 𝑘𝑘 are constants. The gravitational force 𝑚𝑚𝑔𝑔 is cancelled outwhen deviations from the equilibrium point are considered.

b) How do the deviations 𝑦𝑦1(𝑡𝑡) and 𝑦𝑦2(𝑡𝑡) in a car suspension system dependon 𝑢𝑢(𝑡𝑡), which denotes the roughness of the ground?𝑚𝑚1 is the mass of the car, 𝑚𝑚2 is the mass of the wheels and the axles, 𝑏𝑏1 and𝑘𝑘1 describe the dynamics of the car shock absorber, 𝑘𝑘2 denotes the elasticityof the tires. In equilibrium, 𝑦𝑦1 = 𝑦𝑦2 = 𝑢𝑢 = 0. The model becomes

𝑚𝑚1𝑦1 + 𝑏𝑏1 𝑦1 − 𝑦2 + 𝑘𝑘1 𝑦𝑦1 − 𝑦𝑦2 = 0 (2)𝑚𝑚2𝑦2 − 𝑏𝑏1 𝑦1 − 𝑦2 − 𝑘𝑘1 𝑦𝑦1 − 𝑦𝑦2 = 𝑘𝑘2 𝑢𝑢 − 𝑦𝑦2 (3)

These are two coupled 2nd order differential equations that describe the vertical position of the car body and the wheels as function of the vertical roughness of the road.

KEH Process Dynamics and Control –3 17

Example 3.4. Suspension system in a car

Page 18: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.2.3 Process engineering systemsProcess engineering systems are typically modeled with flow balances (mass andenergy balances) and constitutive relationships.

Example 3.5. Liquid tank with free outflow.A volumetric flow rate 𝑢𝑢 is supplied continu-ously to a container and a volumetric flow rate𝑞𝑞 flows out freely by gravity as determined bythe height ℎ of the liquid the container.The container has a constant cross-sectionalarea 𝐴𝐴, and the outlet tube has the “effective”cross-sectional area 𝑎𝑎. The liquid has a con-stant density 𝜌𝜌.How does the level of the liquid depend on the inflow 𝑢𝑢?

Mass balance: dd𝑡𝑡

𝜌𝜌𝐴𝐴ℎ = 𝜌𝜌𝑢𝑢 − 𝜌𝜌𝑞𝑞 (1)

Because 𝜌𝜌 and 𝐴𝐴 are constants, (1) can be simplified to

𝐴𝐴 dℎd𝑡𝑡

= 𝑢𝑢 − 𝑞𝑞 (2)

KEH Process Dynamics and Control –13 8

3.2 Models for technical systems

Fig. 3.6. Liquid tank with free outflow.

Page 19: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.3 Process engineering systems

According to Bernoulli’s law, the following constitutive relationship applies for the outflow of a liquid:

𝑣𝑣 = 2𝑔𝑔ℎ (3)

Here 𝑣𝑣 is the velocity of the outflow and 𝑔𝑔 is the acceleration due to gravity. The volumetric flow rate 𝑞𝑞 is then given by

𝑞𝑞 = 𝑎𝑎𝑣𝑣 = 𝑎𝑎 2𝑔𝑔ℎ (4)

where 𝑎𝑎 is the effective cross-sectional area of the outflow tube, which is slightly smaller than the actual cross-sectional area 𝐴𝐴. Combination of (2) and (4) now yields

dℎd𝑡𝑡

+ 𝑎𝑎 2𝑔𝑔𝐴𝐴

ℎ = 1𝐴𝐴𝑢𝑢 (5)

This is a nonlinear differential equation that describes how the level ℎ depends on the inflow 𝑢𝑢.

KEH Process Dynamics and Control –3 19

Ex. 3.5. Liquid tank with free outflow

Page 20: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

Example 3.6. A mixing tank.Two inflows with the volumetric flow rates𝐹𝐹1 and 𝐹𝐹2, and concentrations (mass/volume) 𝑐𝑐1 and 𝑐𝑐2 of some component𝑋𝑋, are mixed continuously in a container.The outflow has the volumetric flow rate𝐹𝐹3 and concentration 𝑐𝑐3. The containerhas a constant cross-sectional area 𝐴𝐴 andthe height of liquid is ℎ. The mixing in thecontainer is assumed to be perfect so that the concentration of 𝑋𝑋 is 𝑐𝑐everywhere in the container.

How do the level ℎ and the concentration 𝑐𝑐 depend on other variables?

If the two inflows have the same constant temperatures and “small” (or not too different) concentrations of 𝑋𝑋 , it is reasonable to assume that the liquid density in the different flows is constant and the same.

KEH Process Dynamics and Control –3 20

3.2.3 Process engineering systems

Fig. 3.7. A mixing tank.

Flow 1 Flow 2

Flow 3

Page 21: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.3 Process engineering systems

As in Ex. 3.5, the density can be cancelled out yielding a

total mass balance: 𝐴𝐴 dℎd𝑡𝑡

= 𝐹𝐹1 + 𝐹𝐹2 − 𝐹𝐹3 (1)

Since it is not specified what 𝐹𝐹3 depends on, it cannot be eliminated now.A mass balance can also be formed for each component 𝑋𝑋:

partial mass balance: dd𝑡𝑡

𝐴𝐴ℎ𝑐𝑐 = 𝐹𝐹1𝑐𝑐1 + 𝐹𝐹2𝑐𝑐2 − 𝐹𝐹3𝑐𝑐3 (2)

Because perfect mixing is assumed, the concentration is the same every-where in the container at a given time instant. This means that theconstitutive relationship: 𝑐𝑐3 = 𝑐𝑐 (3)must hold. Development of the derivative in (2) according to the product rule and elimination of 𝑐𝑐3 by (3) yield

𝐴𝐴𝑐𝑐 dℎd𝑡𝑡

+ 𝐴𝐴ℎ d𝑐𝑐d𝑡𝑡

= 𝐹𝐹1𝑐𝑐1 + 𝐹𝐹2𝑐𝑐2 − 𝐹𝐹3𝑐𝑐 (4)

Combination of (4) with (1) gives

𝐴𝐴ℎ d𝑐𝑐d𝑡𝑡

= 𝐹𝐹1 𝑐𝑐1 − 𝑐𝑐 + 𝐹𝐹2(𝑐𝑐2−𝑐𝑐) (5)

This is a linear differential equation with (in general) non-constant parameters𝐹𝐹1, 𝐹𝐹2, 𝑐𝑐1, 𝑐𝑐2.

KEH Process Dynamics and Control –3 21

Example 3.6. A mixing tank

Page 22: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

Example 3.7. A water heater.The inflow of water to the water heaterhas the mass flow rate 𝑚1 and tempera-ture 𝑇𝑇1 whereas the outflow has the massflow rate 𝑚2 and temperature 𝑇𝑇2. Themass of water in the heater is 𝑀𝑀 and it isheated to a temperature 𝑇𝑇 with a heatingpower 𝑄. The mixing of water in theheater is assumed to be perfect.How do the amount of water and the temperature in the heater depend on other variables?

Mass balance: d𝑀𝑀d𝑡𝑡

= 𝑚1 − 𝑚2 (1)

Energy balance: d𝐸𝐸d𝑡𝑡

= 𝐸1 − 𝐸2 + 𝑄 (2)

Here, 𝐸1 and 𝐸2 are energy flows associated with the inflow and the outflow, respectively.

KEH Process Dynamics and Control –3 22

3.2.3 Process engineering systems

Fig. 3.8. A water heater.

Flow 1

Flow 2

Page 23: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.3 Process engineering systems

The energy in a substance is proportional to its mass or mass flow rate. For liquids it applies with good accuracy that the energy is also proportional to itstemperature. This results in theconstitutive relationships: 𝐸𝐸 = 𝑐𝑐p𝑇𝑇𝑀𝑀, 𝐸1 = 𝑐𝑐p𝑇𝑇1𝑚1, 𝐸2 = 𝑐𝑐p𝑇𝑇2𝑚2 (3)Here 𝑐𝑐p is the specific heat capacity for water, which in this case is assumed to be constant independently of the water temperature. Combination of (2) and (3) and development of the derivative according to the product rule give

𝑇𝑇 d𝑀𝑀d𝑡𝑡

+ 𝑀𝑀d𝑇𝑇d𝑡𝑡

= 𝑇𝑇1𝑚1 − 𝑇𝑇2𝑚2 + 𝑄𝑐𝑐p

(4)

Because of the assumption of perfect mixing, there is also aconstitutive relationship: 𝑇𝑇2 = 𝑇𝑇 (5)Elimination of ⁄d𝑀𝑀 d𝑡𝑡 from (4) by (1) and substitution of (5) give

𝑀𝑀d𝑇𝑇d𝑡𝑡

= 𝑚1 𝑇𝑇1 − 𝑇𝑇 + 𝑄𝑐𝑐p

(6)

Equation (1) and (6) show how the mass and the temperature in the heater depend on the inflow and the heating power 𝑄.

KEH Process Dynamics and Control –3 23

Example 3.7. A water heater

Page 24: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.3 Process engineering systems

If we want to use volumetric units instead of mass units in the model, this can easily be accomplished by the substitutions

𝑀𝑀 = 𝜌𝜌𝐴𝐴ℎ, 𝑚1 = 𝜌𝜌1𝐹𝐹1 (7)

which applied to (6) yield

𝜌𝜌𝐴𝐴ℎ d𝑇𝑇d𝑡𝑡

= 𝜌𝜌1𝐹𝐹1 𝑇𝑇1 − 𝑇𝑇 + 𝑄𝑐𝑐p

(8)

Note that the water density is not assumed to be constant in equation (8).

Equation (1) expressed in volumetric units becomes more complicated when the water density is non-constant., i.e.,

𝐴𝐴 d𝜌𝜌ℎd𝑡𝑡

= 𝜌𝜌1𝐹𝐹1 − 𝜌𝜌2𝐹𝐹2 = 𝜌𝜌1𝐹𝐹1 − 𝜌𝜌𝐹𝐹2 (9)

It is possible to show that even if 𝜌𝜌 ≠ 𝜌𝜌1 due to the fact that 𝑇𝑇 ≠ 𝑇𝑇1, the effects tend to cancel out in such a way that

𝐴𝐴 dℎd𝑡𝑡≈ 𝐹𝐹1 − 𝐹𝐹2 (10)

becomes a good approximation of (1) and (9).

KEH Process Dynamics and Control –3 24

Example 3.7. A water heater

Page 25: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2 Models for technical systems

Example 3.8. Gas flow through a tank.Figure 3.9 illustrates a closed gastank with the volume 𝑉𝑉, amountof substance 𝑛𝑛 (number of moles),pressure 𝑝𝑝, and temperature 𝑇𝑇.The inflow to the tank is the molarflow rate 𝑛1 at pressure 𝑝𝑝1 beforeValve 1, the outflow is the molar flow rate 𝑛2 at pressure 𝑝𝑝2 after Valve 2. Valve 2 can be used for control by adjustment of the valve position 𝑢𝑢.

How does the pressure 𝑝𝑝 in the tank depend on other variables?

Molar balance: d𝑛𝑛d𝑡𝑡

= 𝑛1 − 𝑛2 (1)

The molar flow rate through a valve with a given opening position can be assumed to be proportional to the square root of the pressure difference across the valve. It is also reasonable to assume that the proportionality factor is proportional to the square of the “linear” valve position 𝑢𝑢. Thus:

Constitutive relationships: 𝑛1 = 𝑘𝑘1 𝑝𝑝1 − 𝑝𝑝 , 𝑛2 = 𝑘𝑘2𝑢𝑢2 𝑝𝑝 − 𝑝𝑝2 (2)

KEH Process Dynamics and Control –3 25

3.2.3 Process engineering systems

Fig. 3.9. Gas flow through a tank.

Valve 1 Valve 2

Page 26: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.2.3 Process engineering systems

In the absence of other information, we can assume that the ideal gas law holds. Thus, we have

Constitutive relationship: 𝑝𝑝𝑉𝑉 = 𝑛𝑛𝑅𝑅𝑇𝑇 (3)

Here, 𝑅𝑅 is the general gas constant and 𝑇𝑇 is the temperature expressed in Kelvin.

If the temperature 𝑇𝑇 is constant, substitution of (2) and (3) in (1) givesd𝑝𝑝d𝑡𝑡

= 𝑅𝑅𝑇𝑇𝑉𝑉d𝑛𝑛d𝑡𝑡

= 𝑅𝑅𝑇𝑇𝑉𝑉

𝑘𝑘1 𝑝𝑝1 − 𝑝𝑝 − 𝑘𝑘2𝑢𝑢2 𝑝𝑝 − 𝑝𝑝2 (4)

which is a relatively complex nonlinear differential equation, even if it is of first order.

KEH Process Dynamics and Control –3 26

Example 3.8. Gas in closed tank

Page 27: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.3 Model linearization

We have in a number of examples shown how to derive dynamic models for many types of technical systems. In all cases, the obtained models are ordinary differential equations. We note that the differential equations (DEs) are often nonlinear even if they are linear, the coefficients are generally not constant because

they depend on some physical time-varying quantity it is difficult, maybe impossible, to find general solutions to these kinds of DEs

Therefore, we need to study special cases and/or do simplifying assumptions

Frequently used simplifications is to assume that some quantities are constant, even if they are (slightly) time-varying input signals change in some ideal (but reasonable) way

KEH Process Dynamics and Control 3–27

3.3.1 Motivation

Page 28: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.3 Model linearization

In practice, it is often enough to know the system behaviour in a limited region close to a known operating point. Then, the model simplification may be to linearize the model equations at the operating point.

The advantage of this is that efficient analysis, synthesis, and design methods based on linear algebra can

be used.

If the system is very nonlinear, or the operating region very large, one can use several linear models that are linearized at different operating points.

Because of the reasons mentioned above, modelling from first principles is often followed by a linearization of the

model.

In this course, we are only considering models obtained from ordinary differential equations, not partial DEs.

KEH Process Dynamics and Control 3–28

3.3.1 Motivation

Page 29: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3. Mathematical Modelling

3.3.2 Linearization of ODEsA general ODEConsider an 𝑛𝑛:th order ODE, which we can formally write as

𝑓𝑓 𝑦𝑦 𝑛𝑛 , … , 𝑦, 𝑦𝑦,𝑢𝑢 = 0 (3.5)

For simplify, time derivatives of 𝑢𝑢 are not included; they can be handled in the same way as the time derivatives of 𝑦𝑦.

Usually the time derivatives appear linearly in (3.5); however, the linearization applies also when they do not appear linearly.

Equation (3.5) can be linearized by a first-order Taylor series expansion at the nominal operating point 𝑦𝑦 𝑛𝑛 , … , 𝑦𝑦, 𝑦𝑦, 𝑢𝑢 , denoted by 𝑓𝑓:

𝑓𝑓 𝑦𝑦 𝑛𝑛 , … , 𝑦, 𝑦𝑦,𝑢𝑢 = 𝑓𝑓 𝑦𝑦 𝑛𝑛 , … , 𝑦𝑦, 𝑦𝑦, 𝑢𝑢 + 𝜕𝜕𝜕𝜕𝜕𝜕𝑦𝑦(𝑛𝑛) 𝜕𝜕

𝑦𝑦 𝑛𝑛 − 𝑦𝑦 𝑛𝑛 +

⋯+ 𝜕𝜕𝜕𝜕𝜕𝜕𝑦 𝜕𝜕

𝑦 − 𝑦𝑦 + 𝜕𝜕𝜕𝜕𝜕𝜕𝑦𝑦 𝜕𝜕

𝑦𝑦 − 𝑦𝑦 + 𝜕𝜕𝜕𝜕𝜕𝜕𝑢𝑢 𝜕𝜕

𝑢𝑢 − 𝑢𝑢 (3.6)

Usually the operating point is a static (steady-state) point with all time derivatives equal to zero, but (3.6) holds even if this is not so.

KEH Process Dynamics and Control 3–29

3.3 Model linearization

Page 30: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.3 Model linearization

We introduce the variables

∆𝑦𝑦(𝑛𝑛) ≡ 𝑦𝑦 𝑛𝑛 − 𝑦𝑦 𝑛𝑛 , … , ∆𝑦 ≡ 𝑦 − 𝑦𝑦, ∆𝑦𝑦 ≡ 𝑦𝑦 − 𝑦𝑦, ∆𝑢𝑢 ≡ 𝑢𝑢 − 𝑢𝑢 (3.7)

which denote deviations from the nominal operating point. We call such variables deviation variables, or simply, ∆-variables.

Combination of (3.5), (3.6) and (3.7) with the fact that the nominal operating point has to satisfy (3.5) yields

𝜕𝜕𝜕𝜕𝜕𝜕𝑦𝑦(𝑛𝑛) 𝜕𝜕

∆𝑦𝑦(𝑛𝑛) + ⋯+ 𝜕𝜕𝜕𝜕𝜕𝜕𝑦 𝜕𝜕

∆𝑦 + 𝜕𝜕𝜕𝜕𝜕𝜕𝑦𝑦 𝜕𝜕

∆𝑦𝑦 + 𝜕𝜕𝜕𝜕𝜕𝜕𝑢𝑢 𝜕𝜕

∆𝑢𝑢 = 0 (3.8)

This is a linear 𝑛𝑛:th order ODE with constant coefficients.

Note: If the ODE contains time derivatives of 𝑢𝑢, they appear as ∆-variables in (3.8) in the same way as the time derivatives of 𝑦𝑦 appear.

KEH Process Dynamics and Control 3–30

3.3.2 Linearization of ODEs

Page 31: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.3 Model linearization

ODEs linear in the time derivativesIf the time derivatives appear linearly in (3.5), we can formally write

𝑓𝑓𝑛𝑛 𝑦𝑦,𝑢𝑢 𝑦𝑦 𝑛𝑛 + ⋯+ 𝑓𝑓1 𝑦𝑦,𝑢𝑢 𝑦 + 𝑓𝑓0 𝑦𝑦,𝑢𝑢 = 0 (3.9)

Equation (3.6) can now be used to linearize every term separately giving

𝑓𝑓0 𝑦𝑦,𝑢𝑢 = 𝑓𝑓0 𝑦𝑦, 𝑢𝑢 + 𝜕𝜕𝜕𝜕0𝜕𝜕𝑦𝑦 𝜕𝜕0

∆𝑦𝑦 + 𝜕𝜕𝜕𝜕0𝜕𝜕𝑢𝑢 𝜕𝜕0

∆𝑢𝑢

The term with the 𝑖𝑖:th derivative results in

𝑓𝑓𝑖𝑖 𝑦𝑦,𝑢𝑢 𝑦𝑦 𝑖𝑖 = 𝑓𝑓𝑖𝑖 𝑦𝑦, 𝑢𝑢 𝑦𝑦 𝑖𝑖 + 𝑓𝑓𝑖𝑖 𝑦𝑦, 𝑢𝑢 ∆𝑦𝑦 𝑖𝑖 + 𝜕𝜕𝜕𝜕𝑖𝑖𝜕𝜕𝑦𝑦 𝜕𝜕𝑖𝑖

𝑦𝑦 𝑖𝑖 ∆𝑦𝑦 + 𝜕𝜕𝜕𝜕𝑖𝑖𝜕𝜕𝑢𝑢 𝜕𝜕𝑖𝑖

𝑦𝑦 𝑖𝑖 ∆𝑢𝑢

Substitution into (3.9) and cancelling out constant terms give

𝑓𝑓𝑛𝑛 𝑦𝑦, 𝑢𝑢 ∆𝑦𝑦 𝑛𝑛 + ⋯+ 𝑓𝑓1 𝑦𝑦, 𝑢𝑢 ∆𝑦 + 𝜕𝜕𝜕𝜕0𝜕𝜕𝑦𝑦 𝜕𝜕0

∆𝑦𝑦 + 𝜕𝜕𝜕𝜕0𝜕𝜕𝑢𝑢 𝜕𝜕0

∆𝑢𝑢 = ∆ 𝑓𝑓 (3.10)

where ∆ 𝑓𝑓 = −∑𝑖𝑖=1𝑛𝑛 𝑦𝑦 𝑖𝑖 𝜕𝜕𝜕𝜕𝑖𝑖𝜕𝜕𝑦𝑦 𝜕𝜕𝑖𝑖

∆𝑦𝑦 + 𝜕𝜕𝜕𝜕𝑖𝑖𝜕𝜕𝑢𝑢 𝜕𝜕𝑖𝑖

∆𝑢𝑢 (3.11)

Note that ∆ 𝑓𝑓 = 0 if the operating point is a steady-state with all 𝑦𝑦 𝑖𝑖 = 0.

KEH Process Dynamics and Control 3–31

3.3.2 Linearization of ODEs

Page 32: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.3 Model linearization

Constitutive relationshipsNonlinear constitutive relationships also need to be linearized. Such a relationship can be formally written

𝑔𝑔 𝑧𝑧, 𝑦𝑦,𝑢𝑢 = 0 (3.12)

where 𝑧𝑧 is a new variable that is related to 𝑦𝑦 and 𝑢𝑢 according to (3.12). Linearization using a first-order Taylor series expansion as in (3.6) gives

𝜕𝜕𝑔𝑔𝜕𝜕𝑧𝑧 𝑔𝑔

∆𝑧𝑧 + 𝜕𝜕𝑔𝑔𝜕𝜕𝑦𝑦 𝑔𝑔

∆𝑦𝑦 + 𝜕𝜕𝑔𝑔𝜕𝜕𝑢𝑢 𝑔𝑔

∆𝑢𝑢 = 0 (3.13)

If the nominal operating point is a steady state with all time derivatives zero, differentiation with respect to time gives for the 𝑖𝑖:th time derivative

𝜕𝜕𝑔𝑔𝜕𝜕𝑧𝑧 𝑔𝑔

∆𝑧𝑧(𝑖𝑖) + 𝜕𝜕𝑔𝑔𝜕𝜕𝑦𝑦 𝑔𝑔

∆𝑦𝑦(𝑖𝑖) + 𝜕𝜕𝑔𝑔𝜕𝜕𝑢𝑢 𝑔𝑔

∆𝑢𝑢(𝑖𝑖) = 0 (3.14)

If desired, the variable ∆𝑧𝑧 can be introduced as dependent variable instead of ∆𝑦𝑦in (3.8) or (3.10) by means of (3.13) and (3.14).

KEH Process Dynamics and Control 3–32

3.3.2 Linearization of ODEs

Page 33: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.3 Model linearization

Example 3.9. Linearization of a first-order DE.In Example 3.5 we derived the nonlinear DE

𝐴𝐴ℎ + 𝑎𝑎 2𝑔𝑔ℎ − 𝑢𝑢 = 0 (1)

We want to linearize this DE at the steady-state operating point ℎ, 𝑢𝑢 . Application of (3.10) gives

𝐴𝐴∆ℎ + 𝜕𝜕𝜕𝜕ℎ

𝑎𝑎 2𝑔𝑔ℎ − 𝑢𝑢ℎ,𝑢𝑢

∆ℎ + 𝜕𝜕𝜕𝜕𝑢𝑢

𝑎𝑎 2𝑔𝑔ℎ − 𝑢𝑢ℎ,𝑢𝑢

∆𝑢𝑢 = 0

⟹ 𝐴𝐴∆ℎ + 𝑎𝑎 2𝑔𝑔 d ℎdℎ ℎ

∆ℎ − d𝑢𝑢d𝑢𝑢 𝑢𝑢

∆𝑢𝑢 = 0 (2)

which gives

𝐴𝐴∆ℎ + 𝑎𝑎 2𝑔𝑔

2 ℎ∆ℎ = ∆𝑢𝑢 (3)

KEH Process Dynamics and Control 3–33

3.3.2 Linearization of ODEs

Page 34: Process Laboratory Control 3. Mathematical · PDF fileLaboratory 3. Mathematical Modelling ... There are two main principles for construction of mathematical models Modelling ... 3.2.2

ProcessControl

Laboratory

3.3 Model linearization

Exercise 3.1. Linearization of constitutive relationship.Consider a control valve ina pipeline, schematicallyillustrated in the figure.At a given pressure, theflow rate 𝑞𝑞 through thevalve depends on the position 𝑥𝑥 of the valve plug (stem) according to the valve characteristic

𝑞𝑞 = 𝐶𝐶(𝛼𝛼𝑥𝑥 − 1)/(𝛼𝛼 − 1)where 𝐶𝐶 and 𝛼𝛼 are constant parameters depending on the size and construction of the valve. The valve is closed when 𝑥𝑥 = 0 and fully open when 𝑥𝑥 = 1.The position 𝑥𝑥 is adjusted by an actuator responding to a control signal 𝑢𝑢. Because of inertia, 𝑥𝑥 follows 𝑢𝑢 according to the dynamic relationship

𝑇𝑇𝑥 + 𝑥𝑥 = 𝐾𝐾𝑢𝑢where 𝑇𝑇 and 𝐾𝐾 are constant parameters (time constant and static gain).

Derive a linear dynamic model that shows how 𝑞𝑞 depends on 𝑢𝑢 close to an operating point 𝑞𝑞 = 𝑞𝑞.

KEH Process Dynamics and Control 3–34

3.3.2 Linearization of ODEs