14
Chapter 1 Systems and Models 1.1 In tr oduction In this chapter we will introduce and classify various kinds of systems and models. We will also describe the steps in a general modelling process and illustrate them on a simple example. Finally we disc uss the useful modelli ng tools of sca ling for size and dimensional analysis. Read Chapter 1 of the textbook and the following sections of the chapter. At the same time you will start learning to use the MATLAB computing package and applying it to some simple models. The computing work should be done in parallel to your reading. Appendix 1 contains notes on MATLAB including a page titled Getting Started with MATLAB, a copy of the MATLAB Primer by Kermit Sigmon and a copy of a sectio n titled An Introduction to MATLAB by G. Lindeld and J. Penn y . Read the page titled Getting Started with MATLAB and look through the other notes to see what is there (so you know where to look when you need to). Also browse through the online documentation Learning MATLAB and Finding Functions and Properties av ailable with MATLAB 6.5. It is best to sta rt usi ng MA TLAB as soon as p oss ibl e; work through the rst three Lab Exercises. 1.2 Types of syst ems and model s Generally speaking systems and models can be dened as follows: System - consists of one or more elements whose properties are determined by inter- actions of some kind e.g. solar system - sun and planets interacting under inuence of gravity airplane in ight chemical plant disease epidemic economy telephone network For each system, there are many questions that could be asked, for example: When is the next solar eclipse? What is the optimal design of the wing? How can the plant produce the chemical at 90-95% purity? When will half the population be infected by the disease? What are the eects of reduced tarrifs? 1

Systems&Models (1)

Embed Size (px)

Citation preview

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 1/14

Chapter 1

Systems and Models

1.1 Introduction

In this chapter we will introduce and classify various kinds of systems and models. Wewill also describe the steps in a general modelling process and illustrate them on asimple example. Finally we discuss the useful modelling tools of scaling for size anddimensional analysis.

Read Chapter 1 of the textbook and the following sections of the chapter.At the same time you will start learning to use the MATLAB computing package and

applying it to some simple models. The computing work should be done in parallel toyour reading. Appendix 1 contains notes on MATLAB including a page titled GettingStarted with MATLAB, a copy of the MATLAB Primer by Kermit Sigmon and a copyof a section titled An Introduction to MATLAB by G. Lindfield and J. Penny. Readthe page titled Getting Started with MATLAB and look through the other notes to

see what is there (so you know where to look when you need to). Also browse throughthe online documentation Learning MATLAB and Finding Functions and Propertiesavailable with MATLAB 6.5. It is best to start using MATLAB as soon as possible;work through the first three Lab Exercises.

1.2 Types of systems and models

Generally speaking systems and models can be defined as follows:

System - consists of one or more elements whose properties are determined by inter-actions of some kind

e.g. solar system - sun and planets interacting under influence of gravityairplane in flightchemical plantdisease epidemiceconomytelephone network

For each system, there are many questions that could be asked, for example:When is the next solar eclipse?What is the optimal design of the wing?How can the plant produce the chemical at 90-95% purity?When will half the population be infected by the disease?

What are the effects of reduced tarrifs?

1

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 2/14

What is the average waiting time for connection?How can such questions be answered? In some cases, it may be possible to do anexperiment with the actual system to see what happens. However, in many cases, suchexperiments are either impossible, too costly or dangerous, too slow (e.g. glacier) or

too fast (e.g. bomb).

Model - a representation of a system,e.g. a scale model of say an airplane wing.

Mathematical model - a mathematical description of the properties and interactionsin the system, i.e. equations relating different quantities/variables, e.g. Newton’s law:force = mass × acceleration (F  = ma).

The variables of a model can often be classified as:

inputs e.g. force, voltage, heat source

outputs - determined by cause-effect relationship, e.g. velocity, current, temperature

disturbances - type of input e.g. wind gusts.

state variables - chosen to characterize the system, i.e. a knowledge of the valuesof state variables at any time t0 together with input variables for all t ≥ t0determines the values of state variables and output variables for all t ≥ t0, e.g.position and velocity of the space shuttle.

The relationship between the variables and system can be displayed as follows.

−→ system −→inputs −→ (state −→ outputs

−→ variables) −→

2

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 3/14

Types of models

Models (and/or systems) can be classified in various ways each giving rise to a pair of possible types as listed below.

Fundamental/mechanistic - based on physical, chemical, etc laws and principleslike material and energy conservation.

Empirical/system identification - model is an estimate based on experimental in-put and output data - used if a fundamental model is unknown or too complicated,which is often the case for ecological and economic systems.

Dynamic - variables depend on time.

Steady state - variables are independent of time.

Distributed parameter - a state variable varies over space, e.g. temperature u(x, t)

in a rod, where x is the distance along the rod and t is time.Lumped parameter - state variable(s) depends only on a finite number of spatial

positions, e.g. the temperature in adjoining rooms can be lumped as follows:

u1(t) u3(t)

and u2(t) represents the temperature in the brick wall between the rooms.

Continuous time , e.g. solar system

Discrete time , e.g. financial system with ti being day i, or a continuous time modelthat has been sampled in time, e.g. temperature at midday.

Deterministic - no uncertainty in any variables, e.g. model of pendulum.

Stochastic - some variables are random, e.g. airplane in flight with random windgusts, mineral processing plant with random grade ore, phone network with ran-dom arrival times and call lengths.

Continuous change - system variables change continuously, e.g. solar system, spreadof pollutants, charging a battery.

Discrete event - changes take place as a result of discrete events, which usually occurrandomly, e.g. queueing systems (bank, telephone network, traffic lights, machinebreakdowns), card games, cricket match.

Hybrid - combination of a continuous and discrete event system, e.g. traffic along aroad with traffic lights.

Of course, one can use more than one of the above ways to describe a model. Forexample, one could consider a model of heat flow that is fundamental, deterministic,dynamic and distributed parameter.

3

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 4/14

In some application areas, it is generally possible to formulate a model that is agood representation of the system, while in other areas this is less so. The degree towhich a model represents the system determines the use that can be made of the modelin answering questions about the system. Karplus developed the following rainbow

diagram to illustrate how well models represent systems in different areas and thecommon purpose of the model.

Figure 1.1: Karplus’ rainbow of models

4

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 5/14

1.3 Modelling process

The methodology of the modelling process can be represented by the following flowdiagram.

Real world problem

↓|−−−−−−→ Define goals

↓−→ | −− − −− −→ Characterize system

↑ ↓| | − − − −− −→ Formulate model↑ ↓

Make changes Solve/simulate

↑ ↓| Analyse

↑ ↓− − − ←− − − − Validate model

Not adequate ↓ Adequate

Problem/goals solved

Each of the stages of this process will be described below and illustrated using thefollowing example.

Example (Ex 3.1 from Process Control by T.E. Marlin)Consider a tank of volume V  which is full of a solution of material A at concentrationC . A solution of the same material at concentration C 0 is flowing into the tank at flowrate F 0 and solution is flowing out the top of the tank at flow rate F 1. The diagram is:

We want to determine the dynamic response to a step change in the inlet concen-tration C 0. The outlet stream cannot be used until 90% of the change in the outletconcentration has occurred. When will that be?

Define goals - these could be qualitative, e.g. is the response monotonic or does itoscillate?, or quantitative. We may want the whole solution or perhaps just one value,e.g. the time at which 90% of the change in the outlet concentration has occurred.

Characterize systemIdentify the system and its environment.Identify the elements and interactions in the system.

5

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 6/14

List assumptions.Collect data about parameters in the system.

Example (continued) The system is the solution in the tank together with the inflowand outflow.

Assumptions:Well mixed solutionDensity of solution is constantConstant level in the tank

Data:F 0 = 0.085 m3/ min, V  = 2.1 m3

C 0(t) =

C init = 0.925 t ≤ 0−

C 0 = 1.85 t > 0kg/m3

The system is initially at steady state, i.e.

C (t) = C 0(t) = C init for t ≤ 0.

Formulate modelSelect the important variables.Equations are derived from fundamental principles of the system. There are 2 types:conservation laws and constitutive relationships.

Conservation laws , e.g. conservation of material (components and overall), energy,momentum, electrons (Kirchkoff’s laws), cars. Such laws lead to balance equa-tions which have the general form:

rate of accumulation = (rate) In - Out + Generation.

Often one requires several balance equations, e.g. material and energy balance.

Constitutive equations - relate quantities of different kindse.g. Hooke’s law for a spring: F  = kx relates the spring force F  to the spring’sdisplacement x, where k is the spring constant.e.g. Ohm’s law for a resistor: V  = Ri, where V  is the voltage drop, i is thecurrent and R is the resistance.

Note these are only approximate relations. For a real spring or resistor the relationholds well for a certain range only; outside this range the relation is nonlinear.

Write down the appropriate conservation laws and use suitable constitutive relation-ships to express the balance equations in terms of model variables. Use the dimensionsof quantities to check the equations.

In many problems it is helpful to transform the equations into dimensionless formby using an appropriate scaling of each of the variables. This has certain advantages:one general solution covers all parameter cases and one can identify terms that arenegligible.

6

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 7/14

Example (continued)Input variables: C 0, F 0; State variables: C , F 1; Constant: V Overall material balance equation for the solution in the tank:

rate of change of mass = rate in−

rate outd

dt(ρV ) = ρF 0 − ρF 1

kg/ min = (kg/m3 × m3)/ min (kg/m3) × (m3/ min) (kg/m3) × (m3/ min)

i.e. 0 =dV 

dt= F 0 − F 1 (since ρ is constant)

i.e. F 0 = F 1 ≡ F  (1.1)

Material balance equation for material A in the tank:

rate of change of mass = rate in − rate outd

dt(CV ) = C 0F 0 − CF 1

kg/ min = (kg/m3

× m3

)/ min (kg/m3

) × (m3

/ min) (kg/m3

) × (m3

/ min)i.e. V 

dC 

dt= F  (C 0 − C )

i.e.dC 

dt+

V C  =

V C 0 (1.2)

SolutionFor (relatively) simple problems it is sometimes possible to find the solution analytically.This can make the analysis easier, e.g. one can analytically determine the long-termbehaviour of the solution and the sensitivity of the solution on the parameters. Forother problems it is necessary to compute the solution numerically, but this can nowbe done efficiently using powerful computer packages like MATLAB and SIMULINK.If only a certain feature of the solution is required, e.g. behaviour near a special point,it may be possible to determine this using a series expansion.

Example (continued)Equation (1.2) is a simple linear, first order differential equation (d.e.), which can easilybe solved analytically. It can be solved using an integrating factor, or as a separableequation, or as follows.

Note thatdC 

dt+

V C  =

V C 0 =

V C 0 for t > 0

is a linear d.e. with constant coefficient F/V  and constant right hand side. Solve the

homogeneous equation dC 

dt+

V C  = 0

using the characteristic equation

r +F 

V = 0 i.e. r = −F 

to getC H (t) = k e−(F/V )t for arbitrary k.

For the non-homogeneous equation

dC dt + F V  C  = F V  C 0

7

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 8/14

try the particular solution

C P (t) = A, i.e. constant.

Then

0 +F 

V  A =F 

V  C 0 so A = C 0

Therefore, the general solution of the non-homogeneous equation is

C (t) = C 0 + k e−(F/V )t

InitiallyC (0) = C 0 + k = C init

so k = C init − C 0

ThereforeC (t) = C 0 + (C init − C 0)e−(F/V )t, t ≥ 0.

AnalysisCheck the solution using the d.e., initial conditions, limiting values, etc. Graph thesolution. Determine its behaviour, e.g. monotonic, oscillatory etc, and find the timeconstant(s) τ , which indicates the speed of the dynamic response(s). Carry out asensitivity analysis, e.g. if some parameter is measured inaccurately, how will it affectthe solution?

Example (continued)It is easy to check that the solution C (t) derived above satisfies the d.e. and initialcondition C (0) = C init. Clearly, C (t) → C 0 as t → ∞, which is what we would expectintuitively. The graph of  C (t) is:

The monotonically increasing behaviour of  C (t) for t ≥ 0 is also intuitively reasonable.Note that the decay rate of the response is F/V  and the time constant is τ  = V /F  =24.7 (m3/(m3/ min) = min). To get a numerical feel for the time constant, we canrelate it to a percentage of the final (limiting) change in concentration (where 0% meansC  = C init and 100% means C  = C 0). Write C (t) = C init + (C 0 − C init)(1 − e−t/τ ) andcompute the following table.

t% of limiting change

i.e. (1 − e−t/τ ) × 100

τ  63.22τ  86.53τ  95.04τ  98.2

8

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 9/14

Note that this table is independent of the actual values of  τ , C init and C 0. To answerthe original question in this example, we want to find t such that

(1 − e−t/τ ) × 100 = 90

which givest = t90 = −τ  ln 0.1 = 56.9 min

What if the volume V  and flow rate F  are only known to be within 5% of the givenvalues? Then

max value of  t90 = − 2.1 × 1.05

0.085 × 0.95ln 0.1 = 6 2.9 min

and

min value of  t90 = − 2.1 × 0.95

0.085 × 1.05ln 0.1 = 51.5 min

Clearly, if it is critical to satisfy the condition, we should wait 62 .9 min.ValidationThe behaviour of the model is compared with the behaviour of the system using realdata. One needs to decide on validation criteria and this can depend on the goals.

Example (continued) Suppose we obtain some experimental data for the concentrationC (t). If the data points near t ≈ 60 are “close” to the model solution, then we canaccept the model for the given goal of finding when 90% of the limiting change occurs.We could then use this model to answer the same question for other values of  V  andF .

9

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 10/14

1.4 Modelling tools

1.4.1 Scaling for size

For a cube of side length made of a homogeneous material, clearly

surface area = 62 ∝ 2

volume = 3, therefore, mass ∝ 3

It turns out that for any homogeneous, 3 dimensional object of  characteristic length,

surface area ∝ 2

volume ∝ 3, mass ∝ 3.

The characteristic length does not have to be the length from one side of the object tothe opposite side; it can be any length measure on the object that determines its size.For example, for a sphere, we could use the diameter or radius. Note that a sphere of 

radius has surface area = 4π2

and volume = (4/3)π3

, which is consistent with thegeneral result.

Example - Size and shape of animalsHave you ever noticed that larger animals have thicker legs, e.g. an elephant comparedto a dog? (Draw these two animals below.) Why is this so?

Crude model:The leg bones must be strong enough to withstand the weight of the animal and anyadditional forces put on them when the animal moves. Moreover, they will be juststrong enough for this purpose (since evolution has determined this).

From elasticity theory,

bone strength ∝ cross-sectional area A

For a stationary animal standing on 4 legs, clearly

force on leg bone = (1/4)mg,

where m = mass of animal and g = acceleration due to gravity. Therefore

A ∝ m

But

A ∝ d2

10

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 11/14

where d = diameter of leg bone, so

d ∝ A1/2 ∝ m1/2.

This means that d increases faster with m than it would under the simple scalingrelationship d ∝ m1/3 above, i.e. large (heavy) animals have relatively thicker legsthan small (light) animals.

How can this model be validated? First we would need to collect animal data(mi, di), where mi and di are the mass and leg bone diameter, respectively. If d ∝ m1/2,then log d = c + (1/2)log m for some constant c. Hence, to validate the model, we canplot (log mi,log di) and check for linear behaviour with slope 1/2.

Example - Pergola beamConsider a pergola beam of width w, thickness t and length which is fixed at the endsand is supporting a uniform load over its length. Let δ be the absolute deflection of thebeam. We don’t want the beam to sag! How should w and t increase with so that

the relative deflection δ/ is constant?From elasticity theory

δ

∝ F 2

w2A

where A is the cross-sectional area and F  is the force. Now

F  = weight of beam plus weight carried= ρAg + c for some constant c.

Thereforeδ

∝ (ρAg + c)2

w2A

= ρ3gw2

+ c3w2A

For the first term not to grow as l increases, we must have

w ≥ k 3/2 for some constant k.

Then the second term satisfies

c3

w2A=

c3

w3t≤ c3

k39/2t∝ 1

3/2t

so there is no need for t to increase with . Therefore, we choose w

∝3/2. This shows

that to avoid sagging, w must increase faster than simply proportional to , which iswhy long beams should be much wider than short beams.

11

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 12/14

1.4.2 Dimensional Analysis

In dimensional analysis, one investigates the relationships between the dimensions of physical quantities that occur in a system. This can be very useful for the modellingof complex problems. In particular, by examining the dimensions, it may be possible

to obtain the form of an unknown relationship between the actual quantities involvedin the system. Another possible benefit is that, by using relationships between groupsof quantities, it can be much easier to prepare and interpret tables and graphs of experimental data. Also, one can use the relationships to predict the behaviour of areal system from that of a scale model.

The basic dimensions are those of mass (denoted M ), length (denoted L) and time(denoted T ). The dimensions of other dimensioned quantities that occur in a problemcan be expressed in terms of these basic dimensions. The dimension of a dimensionlessquantity is assigned the numerical value 1. Note the usual notation for the dimensionof a quantity q is [q].

Example - Free fall of a body in a vacuumUse dimensional analysis to derive a formula for the final velocity V  of a body of massm that falls from rest at a height h under the influence of gravity (with gravitationalacceleration g).

First list all the quantities that might affect V , i.e. g, h, m, so V  = V (g,h,m).Now, clearly

[V ] = LT −1, [g] = LT −2, [h] = L and [m] = M.

Since M  appears only in [m], we must have

V  = V (g, h).

Note that T  appears only in [V ] and [g], and [V 2/g] = L, so

V 2

g= w(h)

or we could use

V √g

= w(h)

for some function w (or w). Repeating this to remove the length dimension, we getthat

V 2

ghis dimensionless, so

V 2

gh= constant.

Thus

V  = c gh for some constant c.Note we have derived this formula using only dimensional analysis. From basic physics,the actual formula is V  =

√2gh, so the value of  c above is c =

√2.

An equation is dimensionally homogeneous if all (additive) terms have the samedimension and the equation is independent of the fundamental system of units used.This is also called a physical law.

Example The equation V  =√

2gh is dimensionally homogeneous since the termsV  and

√2gh have dimension LT −1 and the equation holds no matter what system

of units (m and sec, ft and sec, etc) is used. By contrast, note that the formulaV  =

√2

×32

×h = 8

√h (obtained by substituting g = 32 ft/sec2) would only be valid

in ft and sec units.

12

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 13/14

In the example of a falling body, we could derive the form of the physical law usinga simple dimensional argument. In more complex problems, however, this approachwould not be feasible. Instead we use a general method that is based on the followingfundamental result of dimensional analysis.

Buckingham Pi TheoremLet f (q1, q2,...,qn) = 0 be a dimensionally homogeneous equation involving quanti-ties q1, q2,...,qn. The same law can be expressed in terms of dimensionless quantitiesΠ1, Π2,..., Πk as f (Π1, Π2, ..., Πk) = 0 for some function f , or as Π1 = f (Π2,..., Πk) forsome function f  if k ≥ 2 and Π1 = c, a constant, if  k = 1. The dimensionless quantitiesare not unique.

Example - Falling bodyThe equation

f (V , g , h) = V 2 − 2gh = 0

can be expressed as (i.e. is equivalent to)

f (Π) = Π − 2 = 0, where Π =V 2

gh

is dimensionless (or alternatively as

f (Π) = Π2 − 2 = 0, where Π =V √gh

is dimensionless).

Example - Newton’s law of gravitation

Consider the force F  of attraction between two masses m1 and m2 at a distance r apart.Use dimensional analysis to derive the inverse square law for F , which is:

F  =Gm1m2

r2

where G is the universal gravitational constant and has dimension [G] = M −1L3T −2.We wish to derive a dimensionally homogeneous equation

f (G, m1, m2, r , F  ) = 0.

By the Buckingham Pi Theorem, we know there is an equivalent representation in termsof dimensionless quantities, so we now proceed to find these dimensionless quantities.Let

Π = Ga1ma21 ma3

2 ra4F a5

Then, since [m1] = M , [m2] = M , [r] = L and [F  = mass × acceleration] = M LT −2,we have

[Π] = M −a1L3a1T −2a1M a2M a3La4M a5La5T −2a5

= M −a1+a2+a3+a5L3a1+a4+a5T −2a1−2a5

This means that Π will be dimensionless if and only if 

−a1 + a2 + a3 + a5 = 03a1 + a4 + a5 = 0

−2a1 − 2a5 = 0

13

8/3/2019 Systems&Models (1)

http://slidepdf.com/reader/full/systemsmodels-1 14/14

which is a linear system in the unknowns ai, i = 1, . . . , 5. To solve this, choose a1 anda2 to be arbitrary. Then

a5 = −a1, a4 = −2a1 and a3 = 2a1 − a2.

Taking a1 = 1 and a2 = 0, we have the solution

a = (1, 0, 2, −2, −1)

which defines the dimensionless quantity

Π1 =Gm2

2

r2F 

Now, taking a1 = 0 and a2 = 1, we obtain the solution

a = (0, 1,

−1, 0, 0)

which defines the dimensionless quantity

Π2 =m1

m2

From the Buckingham Pi Theorem, the required law can be expressed in the formf (Π1, Π2) = 0, or as Π1 = f (Π2), i.e.

Gm22

r2F = f 

m1

m2

This givesF  =

Gm22

r2

f m1

m2

for some

where≈

f  =1f 

which clearly implies that F  has an inverse square dependence on r.

From the dimensional analysis, we cannot determine the function≈

f  (e.g.≈

f (x) = x p

would be dimensionally valid for any exponent p). However, from the known expression

F  =Gm1m2

r2

we can see that≈

f (x) = x. And the expression for f  is

f (Π1, Π2) = Π1Π2 − 1 = 0.

Note The choice of dimensionless quantities in the Buckingham Pi Theorem is notunique. Each of the infinite number of solutions of the linear system above defines adimensionless quantity. In more complicated examples it may sometimes be necessaryto experiment a little with the solutions of the appropriate linear system to obtaindimensionless quantities which reveal the desired relationship.

Exercise Work through this example by taking a1 = 0, a2 = 2 instead of a1 = 0, a2 = 1above. Repeat with the choice a1 = 1, a2 = 1.

14