Table Of ContentMathematical Modelling Techniques in Process Design
Andrew T. Doig
Master of Philosophy
University of Edinburgh
1991
1
DECLARATION
The work described in this Thesis is the original work of the author and was
carried out without the assistance of others, except where explicit credit is given
in the text. It has not been submitted, in whole or in part, for any other degree
at any University.
Andrew T. Doig
11
ABSTRACT
Software has been developed which constructs mathematical models and
simulations of chemical engineering problems. It uses a generic description of
each problem domain, e.g. a flash problem consists of mass and heat balances,
vapour-liquid equilibrium relationships, etc, and a set of global constants, such
as Antoine coefficients. The fixed variables must be supplied for each instance of
the problem.
The first step in producing a simulation is the assignment of an equation to
be solved for each variable in the problem; these may be design variables or
others whose values are required. This assignment is found by the use of a flow
maximisation technique. Next the equations are partitioned into their minimal
solvable subsets by a depth first search algorithm. Following partitioning, the
smallest set of variables such that, knowing their values, the rest can be calculated
is identified, a guess is made for their starting values, and a computer program is
written to solve the equations. This program uses the Newton Raphson method
with analytical derivatives to solve simultaneous equation sets; the values of
these derivatives are found without explicit differentiation using an extension of
a method due to Ponton [75] for torn systems. Finally the results of computation
are reported to the user.
Critërea are presented for the comparison of models and simulations, and
qualitative definitions of merit are presented. The structural analysis of equation
sets is discussed in detail, and common methods are described and contrasted.
Throughout the thesis these topics are treated graph theoretically since many of
the concepts considered are visualised most easily in this way. In particular one
set of theorems appears which relate graphs, digraphs and their properties to the
structure of equation sets, another shows how a flow maximisation technique can
be used to solve the assignment problem, and yet another proves how and why
the decomposition technique chosen works. Whilst the first two sets of results are
well known, no proof has been located of them in the form in which they appear.
No statement or proof for the last set of theorems has been found.
Finally some improvements to the software are proposed. These are concerned
both with its structural detail, and with its ability to reason.
111
Acknowledgements
This work has been possible only due to the efforts of many people whose help
I am delighted to be able to acknowledge. I am grateful to my supervisors
Dr. Ken McKinnon and Professor Jack Ponton, and my industrial sponsors, B.P..
So too immeasurable thanks are due to my parents, Andy and Rena Doig, and
my brother, David, for their support during my studies, particularly during my
period of illness. I am indebted to Carleen Robertson and Martin Fallon, for
buying the beers and providing a calming influence. Last, but by no means least,
I wish to thank my friends and colleagues in both the Department of Chemical
Engineering and Pollock Halls for their help and advice.
(cid:9)(cid:9)(cid:9)
Contents
1 The Requirements of a Modelling System (cid:9) 1
1.1 (cid:9) Introduction ..............................1
1.2 Fundamental Aspects of Mathematical Modelling .........2
1.3 The Comparison of Models and Simulations ............3
1.3.1 What is a Good Model ? 3
1.4 The Derivation of a Mathematical Model ..............7
1.4.1 Choosing the Appropriate Equation Set ...........8
1.4.2 Equation Manipulation ....................10
1.4.3 Program Writing .......................12
1.4.4 Finding, Checking and Reporting Results ...........14
1.4.5 Approximation ........................14
1.5 A Modeller's Toolkit .........................16
2 The Graphical Analysis of the Structure of Equation Sets (cid:9) 20
2.1 (cid:9) Introduction ..............................20
2.2 (cid:9) Graph Theory .............................22
2.2.1 The Elements of a Graph ..................22
iv
(cid:9)(cid:9)(cid:9)(cid:9)
(cid:9)
CONTENTS
V
2.2.2 The Types of Graph of Interest ...............25
2.2.3 The Properties of Graphs ..................29
2.2.4 Vertex Elimination ......................30
2.2.5 Graph Representation and Algorithmic Complexity . . . . 32
2.3 Conditions for a Unique Solution ..................35
2.4 The Need to Select an Output Set ..................37
2.5 The Nature of Partitioning Matrices .................39
2.6 The Use of Decomposition Techniques ...............55
2.6.1 Optimal Tear Sets ......................57
2.6.2 Numerical Techniques Improved by Tearing ........59
2.7 (cid:9) Summary ...............................66
3 Literature Review and Selection of Methods (cid:9) 67
3.1 (cid:9) Introduction .............................. 67
3.2 Choosing An Output Set .......................68
3.3 Partitioning Matrices .........................80
3.3.1 A Characterisation of Matrix Partitioning ..........82
3.3.2 Symmetric Permutations ...................90
3.3.3 Asymmetric Permutations ..................92
3.3.4 (cid:9) Summary ...........................102
3.4 Methods Of Decomposition . . . . . . . . . . . . . . . . . . . . . 104
(cid:9)(cid:9)(cid:9)(cid:9)
(cid:9)
CONTENTS vi
3.4.1 Ad hoc Decomposition Methods ...............105
3.4.2 Graph Reduction Methods ..................107
3.4.3 Explicit Loop Breaking Strategies ..............112
3.4.4 Depth First Search Decomposition .............118
3.4.5 Summary ............................120
3.5 (cid:9) Conclusions ..............................122
4 Matching and ordering Variables and Equations (cid:9) 123
4.1 (cid:9) Introduction ..............................123
4.2 Analysing an Overdetermined Equation Set ............124
4.2.1 (cid:9) The Order of Analysis ....................124
4.2.2 Finding the Minimal Equation Subsets ........... 125
4.3 Finding an Output Set ........................130
4.4 Selecting and Ordering the Equation Set ..............138
4.5 Summary ...............................142
(cid:9)
5 Finding the Minimum Tear Sets 144
5.1 (cid:9) Introduction ..............................144
5.2 The Signal Flowgraph of a Digraph .................145
5.2.1 Deriving a Signal Flowgraph from a Bipartite Digraph . . 148
5.3 The Decomposition Algorithm ....................151
CONTENTS (cid:9) vii
5.3.1 The Rules for Decomposition ................151
5.3.2 A Description of the Algorithm ...............153
5.4 (cid:9) Two Examples (cid:9) ............................158
5.5 (cid:9) Summary (cid:9) ...............................160
6 The Generation of Analytical Derivatives and their use in an
Equation Solver (cid:9) 162
6.1 (cid:9) Introduction ..............................162
6.2 The Newton Raphson Method ....................163
6.3 The Generation of Analytical Derivatives ..............164
6.4 Application to Torn Systems .....................167
6.5 An Example Problem .........................168
6.6 A Recommendation for Future Development ............170
6.7 (cid:9) Summary ...............................175
(cid:9)
7 The Software Implementation 176
7.1 (cid:9) Introduction ..............................176
7.2 (cid:9) Introduction ...............................177
7.2.1 Programming in Prolog ....................178
7.3 A Description of the Modelling Software ..............179
7.4 An Example Modelling Session ...................184
7.4.1 The Physical and Thermodynamic Equations .......185
(cid:9)
CONTENTS (cid:9) viii
7.4.2 Parsing and Expanding the Equations ...........188
7.4.3 The Variable/Equation Matching ..............191
7.4.4 The Equation Subsets ....................193
7.4.5 The Decomposed equation Subsets .............194
7.5 Solving the Equations (cid:9) ........................195
7.5.1 (cid:9) Program Generation .....................195
7.5.2 Reporting the Results ....................196
7.6 (cid:9) Summary ...............................198
8 Conclusions and Recommendations for Future Work (cid:9) 199
8.1 Recommendations for Future Work .................199
8.2 (cid:9) Conclusions ..............................200
A The Operations Count for LU Decomposition (cid:9) 210
(cid:9)
B A Binary Ideal Flash Problem 212
(cid:9)
C The Dissociation of Water 215
D Methods for Convergence Acceleration (cid:9) 220
D.1 Derivative Methods ..........................220
D.1.1 Methods with an Analytical Jacobian ............220
D.1.2 Methods which Use Function Values ............221
(cid:9)
CONTENTS ix
D.2 Quasi-Newton Methods ........................221
D.3 Dominant Eigenvalue Methods ....................222
D.4 Application to Convergence Acceleration ..............225
(cid:9)
E The Modelling Interpreter 228
F The Initialization File for the Flash Problem (cid:9) 234
Description:Lastly a summary of the conclusions djwn from the separate chapters is presented in § 8. The class of decision problems which can be solved by polynomial time algorithms is called P. There is another this assigns a pointer to each subroutine in poLinit.c and it requisitions the space for the list