modeling and analysis of - content.kopykitab.com · 5. difficulties in optimization (numerical...

21

Upload: others

Post on 22-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem
Page 2: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Modeling and Analysis ofChemical Engineering Processes

Page 3: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Modeling and Analysis ofChemical Engineering Processes

K. BaluProfessor of Chemical Engineering &Dean of Technology, Anna University

Alagappa Chettiar College of Technology Campus,Chennai - 600 025

K. PadmanabhanEmeritus Fellow, Dept. of Chemical Engg.

Alagappa Chettiar College of Technology CampusChennai - 600 025

I.K. International Publishing House Pvt. Ltd.NEW DELHI • MUMBAI • BANGALORE

Page 4: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Published byI.K. International Publishing House Pvt. Ltd.S-25, Green Park ExtensionUphaar Cinema MarketNew Delhi 110 016 (India)E-mail: [email protected]

Branch Offices:A-6, Royal Industrial Estate, Naigaum Cross RoadWadala, Mumbai 400 031 (India)E-mail: [email protected]

G-4, “Embassy Centre”, 11 Crescent RoadKumara Park East, Bangalore 560 001 (India)E-mail: [email protected]

ISBN ????

© 2007 I.K. International Publishing House Pvt. Ltd.

All rights reserved. No part of this book may be reproduced or used in any form,electronic or mechanical, including photocopying, recording, or by anyinformation storage and retrieval system, without written permission from thepublisher.

Published by Krishan Makhijani for I.K. International Publishing House Pvt.Ltd. S-25, Green Park Extension, Uphaar Cinema Market, New Delhi 110 016.Printed by Rekha Printers Pvt. Ltd., Okhla Industrial Area, Phase II, New Delhi110 020.

Page 5: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Preface

Globalization has changed the world. Our world faces unprecedented changes.The Chemical Industry is one of the foundations of our civilization, since hardlyany branch can survive without innovation. The Chemical process industryfaces serious problems with regard to new materials and efficient methods ofproduction due to increasing costs of energy, stringent environmental regulationsand global competition.

To tackle these is complex enough and it needs a clearer understanding ofthe processes themselves. One of these is to understand the process clearlythrough a crisp modeling method. Another is to improve profitability andefficiency through an optimal operation of the process itself.

In this book, which is in two parts, the first one discusses the methods ofmodeling chemical engineering processes through well known mathematicalmethods with numerical calculations. This includes the recent concepts of Fuzzylogic and neural nets. In the second, the three chapters describe the efficientoptimization methods which are available for the effective application to many achemical process. This involves methods of search for extrema as well asoptimization with and without constraint relations.

In this book, a number of problems of choice have been worked out.Additionally computer programs are included for almost all the topics. Mostbooks on nonlinear programming are of a theoretical type and the exact proceduresof computation are often obscure.

The optimization programs are very intricate and having provided the flowcharts and the program in clear BASIC language for easy readability, the readercan exactly understand the mathematical methods.

In a book of this kind, which has gleaned information and help from varioussources like books, journals and also the internet, it is difficult to acknowledgeeach one individually. The authors are thankful to all these, including helprendered by students.

Further the second author wishes to acknowledge the assistance of the AICTEin the course of writing the book by providing him an emeritus fellowship.

Authors

Page 6: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Contents

Preface v

Part I:Mathematical Methods of Analysis and Modelling in Chemical Engineering

1. Modelling Through Algebraic, Differential and Partial DifferentialEquations 3

1.1 Modelling Methods 31.1.2 Principles of Modelling 4

1.2 Solution of simultaneous linear equations in n variables 51.3 Matrix form of simultaneous equations. 61.4 Inversion of a Matrix 71.5 Minimising Memory 91.6 C. Program matrix inversion—Matrix read into A (I, J) (Fortran) 101.7 Extraction—an example of algebraic equations 121.8 Two stage Extraction—Algebraic equation Model 131.9 Solution of Nonlinear Algebraic Equations 151.10 Modelling through Differential and Difference Equations—Some

biotech problem models 151. Growth of Population 152. Logistic Growth Model 163. Prey-Predator Model 16

1.11 Difference Equation 19The Arbitrary Function of the Solution 20

1.12 Linear higher Order equations with constant Co-efficients 221.12.1 Difference equations—Multi-stage extraction 25

1.13 The solution of differential Equations—Runge-Kutta Method 271.13.1 Conversion of higher order linear differential equation to

simultaneous first order equations 281.13.2 MATLAB for solving ordInary differential equations 30

1.14 Basic Program for Simultaneous equations Solutions 31

Page 7: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

viii Modeling and Analysis of Chemical Engineering Processes

1.15 Matrix Inversion—Basic program (Uses a random number genera-tor in line 40 to create a matrix for testing the program) 32

1.16 Program for Solving Differential Equations(Rung Kutta 4th Order Method) 33

1.17 Complex Solutions by Superposition 341.18 Accumulation in time: first order differential equation 351.19 Chemical Reactions—Law of Mass Actions 361.20 Rate of dissolution 361.21 First Order Equations in Chemical Engineering 38

1.21.1 First order homogeneous differential equations 401.22 MIMO System-transient Study-Differential Equations 431.23 The Kremson-Brown Equation: absorption column 45

1.23.1 Spray Column—Hydrolysis of Fat to get Glycerine—aSimultaneous Difference Equation 47

1.23.2 Development of the Difference Equation Per Stage 481.24 Differential equations—Linear Boundary value Problems 50

1.24.1 Superposition of Solutions 511.24.3 Solution of a Linear Differential Equation for a Boundary

Value Problem 521.24.3 nth Order Boundary Value Problem 541.24.4 Boundary Conditions in 2nd Order D.E. 54

1.25 Newton-Kantrovich Method 551.26 Construction of the Finite Difference Analogy 571.27 Boundary value problems by the Embedding Method 581.28 Nonlinear Boundary-value Problems 611.29 The Method of Parameter Mapping 621.30 Gas Liquid System Kinetic Study example—Pure Analytical

Solution 641.31 Shooting method for Boundary value Problems 661.32 Shooting Method—use of Newton Raphson Method 681.33 Boundary value problem example—Heat and Mass Transfer in

Tubular Reactor 701.34 Method based on the derivatives of the Residuum 721.35 Integral Equation Method for Two Point Boundary

Value Problem 731.35.1 Another form of B.V. Integral Method 75

1.36 A general boundary value Problem—Green’s Functions 751.37 A biotech Problem—Growth of species and inhibition 76

1.38. Dirac-Delta Function )()( τδ=τk 771.39 Partial Differential Equation in Chemical Engineering 78

1.39.1 Fluid Dynamics 781.39.2 Heat Flow Q 801.39.3 Diffusion 81

1.40 Solution Methods for Partial differential problems 81

Page 8: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Contents ix

1.40.1 Liebmann’s Method for Boundary Value Problemsin P.D.E. 84

1.40.2 Relaxation Method 841.40.3 Finite Difference Approximation 85

1.41 Percolating liquid via a porous Material—a PDe problem 881.41.1 Determination of Free Surface 91

1.42 Matlab for Partial Differential Equations 931.43 Dimensional Analysis in Chemical Engineering Models,

the Buckingham’s π Theorem 971.44 An example of typical Dimensional analysis—Gas phase gas

absorption 102Exercises I 103

2. Transform Techniques 113

2.1 Transform Methods—Fourier Transform 1132.2 The Fourier Transform Method 1142.3 1-D Fourier Transform in NMR Chemistry 1172.4 Spatial Signals and Fourier Transform 1192.5 2D Fourier Transform Program (Basic) 1202.6 Discrete Fourier Transform 122

2.6.1 FFT Algorithm 1242.6.2 Radix 2 Fast Fourier Transforms 1242.6.3 Radix-2 Decimation-in-Time (DIT) FFT Algorithm 1252.6.4 Radix-2 Decimation-in-Frequency (DIF) FFT Algorithm 128

2.7 Auto-Correlation Coefficients 1332.8 Fast Fourier Transform Routine in Basic 133

2.8.1 FFT Program Written In C’ Language 1342.8.2 FFT USING MATLAB 137

2.9 Complex Fourier Transform 1392.10 Doppler flow signals are Complex 1412.11 Practical Considerations in FFT for signals 144

2.11.1 Picket-fence Effect 1462.11.2 Windows 146

2.12 Method of Taking Spectrum of Signals Using FFT 154Displays of Spectrum 155

2.13 Introduction to Wavelet Analysis 155Introduction 155

2.14 Monte Carlo Method 1622.15 Wavelets for Solving Boundary Value Problems (P.D.E.) 164

The Poisson Equation and Grid Transfers 1652.16 Wavelet Analysis 168

References 168Exercises 2 169

Page 9: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

x Modeling and Analysis of Chemical Engineering Processes

3. Mathematical Aspects of the Basis of Optimisation Methods 172

3.1 Calculus of variations 1723.1.1 Minimal Surface of Revolution 1743.1.2 Bio-tech Problem of Harvesting 176

3.2 Modelling Through Pontryagin’s maximum principle 1783.2.1 An Example in Time Optimality 178

3.3 Introduction to Dynamic Programming 1803.4 Dynamic programming leads to Euler Lagrange equations 1823.5 Dynamic Programming 184

3.5.1 Solution to the Problem 188Exercises 3 195

4. Large Systems Analysis-Methods 199

4.1 Fuzzy Logic and Applications 1994.2 Fuzzy Control Systems 2004.3 Traditional Control Theory 2014.4 Automatic Control System 2024.5 The Notion of Fuzzy Sets 2024.6 Crisp and Fuzzy Relations 2074.7 Example 2074.8 Fuzzy Control 2084.9 Present Day Applications—a Few 2124.10 Fuzzy Aircraft Control 2144.11 Defuzzification—Methods 2154.12 The Need for De-fuzzification 2194.13 Hardware Versus Software in Fuzzy Logic 2204.14 A Simple Fuzzy Logic Problem and Its Development 220

4.14.1 a-cut and ‘Strong a-cut’ of a Fuzzy Set 2264.14.2 Process Controllers Using Fuzzy Logic 227

4.15 Introduction to Neural Networks 2294.16 Neural Networks in Portable Applications 2304.17 The Processing Element of a Neuron 2314.18 An ANN Based Process Model Application with Embedded

Controller 2374.19 Principle of Training Neural Networks 2394.20 Methods for Inputs to Neural Networks 2404.21 Developing Program Codes for Neural Networks 2414.22 Neural Network for Plant Performance Analysis 2414.23 Organization and Application of Ozone Plant test Data, Neural

Network Training 2434.23.1 Confirmation of Neural Network Results 2454.23.2 Use of Neural Network for Ozone Plant 245

Exercises 4 246

Page 10: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Contents xi

Part II:Optimisation Theory

1. Extrema of Functions andSearch Methods 251

1. Introduction 2511.1 Definition 252

2. Application of Optimization 2522.1 Objective of Optimization 2522.2 General Procedure for Optimization Problem 2532.3 Objective Function 253

3. Methods of Optimization 2544. Difficulties in Optimization (with respect to Model) 2555. Difficulties in Optimization (Numerical Difficulties) 2576. Definitions 2577. Analytical Methods for Single Variable Problem 2598. Numerical methods for Single Variable 2629. Dichotomous Search 26310. Equal Interval Search 26611. Fibonacci Search 26812. Multivariable Optimisation 27213. Function of two variables 27414. Lagrange Multiplier Method 27615. Lagrange method for inequality constraints 28516. Method of Steepest Descent 290

Multivariable Functions 291Exercises 1 294

2. Methods of Numerical Optimization 298

1. Functions of One variable 2982. Functions of n Variables 3013. Newton’s Method 3024. Fibonacci Method 3045. Golden Section Search 3106. Quadratic Interpolation 3137. Cubic Interpolation 3198. The Method of Hooke and Jeeves 326Exercises 2 333

Page 11: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

xii Modeling and Analysis of Chemical Engineering Processes

3. Some Additional Methods for Optimisation and ConstrainedOptimisation 334

A: Unconstrained Optimisation Methods 3341. Nelder and Mead’s Method 3342 The Method of Steepest Descent 3443. The Davidson–Fletcher–Powell Method 350

4.1 Conjugate Directions 3634.2 The Fletcher–Reeves Method 364

B. Constrained Optimisation Methods 3725. Modified Hooke and Jeeves Method 3726. The Complex Method 3767. Penalty Functions 386

7.1 Other Penalty Functions 3948. Fiacco-McCormic or SUMT Method

(Sequential Unconstrained Minimisation Technique) 396Exercises 3 405

Page 12: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

PART I

Mathematical Methods of Analysisand Modelling in Chemical Engineering

Page 13: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

CHAPTER 1

Modelling Through Algebraic, Differentialand Partial Differential Equations

1.1 MODELLING METHODS

Modelling or simulation finds its place appropriately in chemical engineeringplant designs. Early methods used mathematical analysis and study of graphicalrepresentations of various possibilities of designs. Today, the computer plays avery important role in modelling and simulation. Problems which would involveextensive mathematical analysis are solved in no time now with the use ofcomputer programs. There are computer programs on hand for anything fromsimple simultaneous equations to extensive neural network models. Further,special mathematical software are also available such as Matlab, Mathcad andso on.

Mathematical methods have been used in astronomy since centuries to findout planetary motion and movement of comets. To find the time it takes a satelliteat 10,000 km to orbit once around the earth, we do not have to actually send asatellite, but its model will be enough to make the evaluation. In some cases, thereis not even the possibility, to do an actual testing, such as the finding of life hoursof, say, an electric lamp.

The purpose of a mathematical model for a typical problem can be one ormore of the following.

1. One can vary the parameters easily in the mathematical model withouthaving any real hardware rebuilding for each change.

2. It is possible, by such parameter variations, to approximately find out themost useful design, which is best either in performance or economy or speed ofimplementation.

3. Once a mathematical model is devised for a particular system, furtherdesign modifications need little time. The design of a certain volume extractionseparator, once made, can be used to quickly design many similar units at anylater time. These become useful software packages for development.

In order to design a mathematical model, it takes considerable time, becausethe developer of such a model should know the process closely and understand

Page 14: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

4 Modeling and Analysis of Chemical Engineering Processes

the physical basis of the same in full. In this process, the observer might initiallymake certain approximations, assume certain relations to behave as linear(though they might be nonlinear) and he might even ignore certain changes orfactors, as for example, assuming the flow rate is constant. Thereafter, he buildsthe model based on mathematical formulation. The set of tools he would useinclude, among others, the following:

1. Linear (algebraic) simultaneous equations, using matrix methods2. Linear differential equations3. Partial differential equations4. Difference equations in descrete mathematical models5. Calculus, including calculus of variations6. Transforms, such as Fourier transform and spectral representations7. Graphical plots, 2D plots8. Statistical methods.

There are certain problems that are far too complex and have a wide range ofvariables. They are like finding the best set-points of a large refinery distillationsystem or plant under certain input conditions, or for example, finding the bestoperating conditions of a large-scale water treatment plant using ozone. Forthese situations, methods based on neural network models and Monte-Carlosimulations are very useful.

1.1.2 Principles of Modelling

Wherever we want to find the value of an entity which cannot be measureddirectly, we introduce symbols x, y, z etc., to represent the entity. Then we probeinto the physics or chemistry of its working. We glean whatever information isavailable to us, find the relations between the variables either by measurement orindirectly. For example, the height of tower; we try to find it in terms of somedistances and angles which can be measured on the ground; for e.g., the volumeof blood in the body is found by injecting a dye and finding its dilution in bloodindirectly; or to find the life span of a bulb, we take random samples of suchbulbs, find their life by burning them out, derive statistics of such samples andthereby estimate the average life-span of the bulb.

Methods of modelling by direct solutions of underlying physical principlesdescribed via any of the equations pertinent to the model is the basic techniqueemployed over the years, in the design of chemical engineering plant andapparatus.

Nowadays, methods based on transforms of the variables involved, infrequency domain or in other functional domains have entered into the techniquesof design. Rather than by a direct solution of mathematical equations, methodsbased on transformations give a wider scope to the problem of design, by ananalysis of the frequency components involved, either in the time-varying modelequations or the space dependent 2-D equations.

Page 15: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Modelling Through Algebraic, Differential and Partial Differential Equations 5

New techniques of large-scale plant parameter descriptions and analysisare now emerging. These can be useful for such large-scale plant analysis andmight provide good results both for design and control. Neural networks andfuzzy logic are typically used for such plant models. Additionally, wavelet-basedanalysis of systems is also finding importance in the analysis of many problems.These are described in the last part of this book.

1.2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS IN NVARIABLES

Though this is a problem well known and covered in earlier study since it findsits application in several simulations and modelling including higher orderdifferential equation solving, it is described with brevity herein.

The following method due Gauss and Siedel is used in computer programs.Consider for example:

2x1 – 2x2 + x3 = 1

4x1 – 2x2 + 4x3 = 12

6x1 – 4x2 + 2x3 = 4

First, subtract twice the first equation from the second. That will eliminate x1between them.

Then subtract three times the first equation from the third. That will yieldanother equation without x1.

Thus, in general, multiply the first equation by aki/a11 and subtract from thekth equation.

2x1 – 2x2 + x3 = 1

0x1 + 2x2 + 2x3 = 10

0x1 + 2x2 – x3 = 1

Now subtract one times the second equation from the third. In general, multiplythe second equation by ak2/a22 and subtract from the kth equation. (k > 2).

2x1 – 2x2 + x3 = 1

0x1 + 2x2 + 2x3 = 10

0x1 + 0x2 – 3x3 = – 9

Thus, we have reduced all elements to the left of the ‘diagonal’ to zero. Then, by‘Back stubstitution’, we get:

3rd equation: x3 = – 9/– 3 = 3

Page 16: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

6 Modeling and Analysis of Chemical Engineering Processes

2nd equation: 2x2 = 10 – 2(3) = 4; x2 = 2

1st equation: 2x1 = 1 + (2)(2) – (3) = 2; x1 = 1

which is the solution. In general, the notation used is as follows.

a11 x1 + a12 x2 + a13 x3 = y1

a21 x1 + ... + ... a23 x3 = y2

a31 x1 + ... + ... a33 x3 = y3

The a matrix is usually stored as a dimensioned array A (N, N) while x and y areallotted vector space as x(N), y(N). N is the total number of equations.

In the course of the above procedure, sometimes the value of the divisor, a22,for example, can become zero. Then ak2/a22 cannot be found. Then, the method isto interchange the equations 2 and 3 so that a22 is not zero.

1.3 MATRIX FORM OF SIMULTANEOUS EQUATIONS.

The equations mentioned above can be ordered as a matrix form.

4

12

1

246

424

122

3

2

1

=

x

x

x

In general, the equation

AX = Y

means that A is an N × N matrix, X is a vector N × 1 and so is Y. Knowing Y andA, we find X.

X = A–1 Y

is written with the meaning that A·A–1 = I, the identity matrix.

100010001

=I

Naturally, the next problem that follows the solution of simultaneous equationis one of inverting the matrix A.

Page 17: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Modelling Through Algebraic, Differential and Partial Differential Equations 7

1.4 INVERSION OF A MATRIX

The equation AX = Y can be rewritten as

IYAX =

0=− IYAX

0=− YX

IA (a)

The solution of the equations in terms of the inverse matrix A–1 is

01

1

1

==

=

=

YAIX

YAIX

YAX

which is the same as

01 =−

YX

AI (b)

In (a) above, the matrix AI has the unit matrix I at the right, but in (b), the matrix(IA–1) has the unit matrix to the left.

By operating on the AI matrix in (a) so as to transform it into one with theunity matrix to its left as in (b), we will arrive at the A–1 matrix.

Let us illustrate this by an example. Take the A matrix and unite it alongsidethe I matrix.

100411

010121

001112

=AI(c)

Divide the first row by 2; subtract from the second row; also from 3rd row.In general, multiply ith row by a( j, i)/a(i, i) to subtract from jth row. We obtain

1021

2132

10

0121

21

2110

001112

−(d)

Page 18: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

8 Modeling and Analysis of Chemical Engineering Processes

In this above process, we have obtained zeros in the first column below thediagonal.

Thus, divide 2nd row by 3 and subtract from the 3rd

131

31

31300

0121

21

2110

001112

−−

−(e)

Since our aim is to get a I matrix to the left, all diagonal entries to the left half mustbe unity and zeros must be got above the diagonal as well. So, looking at the 1strow, divide it by 2. In general, divide the ith row by aii.

131

31

31300

0121

21

2110

0021

21

211

−−

−(f)

To get zero above the diagonal in the 2nd column, multiply 2nd row by 31 and

subtract from the first. Then divide second row by a(2, 2) or 1 21 , to make diagonal

entry unity.

131

31

31300

032

31

3110

031

32

3101

−−

(g)

Similarly, zeroise the 3rd column entries above diagonal by dividing 3rd row by10 and subtract from 2nd as well as 1st rows.

131

31

31300

1.07.03.0010

1.03.07.0000

−−

−−

−−

(h)

Now divide the last row by A(3, 3) or 10/3. This gives

Page 19: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Modelling Through Algebraic, Differential and Partial Differential Equations 9

3.01.01.0100

1.07.03.0010

1.03.07.0001

−−

−−

(i)

The above procedure can be stated in 3 steps.For the ith column of the matrix

1. Obtain zeros below the diagonal2. Obtain zeros above the diagonal3. Divide the terms in ith row by a(i, i).

For column 1, step 2 is omitted; for last column, step 1. In finding out a( j, i)/a(i, i), suppose a(i, i) happens to be zero.

Then division cannot be made. Then we can interchange the ith row withanother row so that, after the interchange, the new a(i, i) is non-zero. Aninterchange between ith and jth rows means an interchange between xi and xj ofthe matrix AX = Y. So in the inverse relation A–1Y = X, the ith and jth columns of theA–1, will be interchanged. This is because, in the product A–1Y columns of A–1

multiply with rows of Y to give X.If, in the course of the procedures above (1 to 3), a(n, n) happens to be zero,

then the matrix is singular, i.e., no inverse exists.

1.5 MINIMISING MEMORY

In a computer program, the I matrix occupies an equal space as the matrix Aitself, i.e., double the space in total is required. This can be avoided. Look at therelation (d) for instance. The first column has zeros below the diagonal. The 4thcolumn has –1/2, –1/2 below the diagonal. We can transfer the latter in theplaces occupied by zeros.

The right half matrix can their be ignored or it need not be stored at all.The relation (d) will look like this in memory.

2132

12

12

12

1121

112

Likewise, in relation (e), the significant entries in the right half can be replacedinto the zeroised locations of the left.

Page 20: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

10 Modeling and Analysis of Chemical Engineering Processes

3133

13

12

12

1121

112

−−

Thus, final inverse matrix appears in the same memory as the matrix A was readin.

3.01.01.0

1.07.03.0

1.03.07.0

−−

−−

−−

1.6 PROGRAM MATRIX INVERSION—MATRIX READ INTO A (I, J)(FORTRAN)

Dimension A (12, 12), IND1 (12), IND2 (12)100 FORMAT (E12.6)200 FORMAT (16H SINGULAR MATRIX)300 FORMAT (I3)

READ 300, NREAD 100 ((A (I J), J = 1, N), I = 1, N)L = 0 (Counts row interchanges, if any)DO 17 I = 1, NIF (I–N) 2, 1, 2

1 IF (A (I, I)) 11, 20, 112 IF (A (I, I))7, 3, 73 II = I + 1

DO 4J = II, NIF(A(J, I))5, 4, 5

4 CONTINUE5 DO 6 K = 1, N

S = A(J, K)A(J K) = A(I, K)

6 A (I, K) = SL = L + 1IND1 (L) = IIND2 (L) = J

If a (i, i) is zero, the rows are interchanged with any of the succeeding jth rowwhich do not have the entry A (j, i) as zero. Then, the values of (i, j), namely the

Page 21: Modeling and Analysis of - content.kopykitab.com · 5. Difficulties in Optimization (Numerical Difficulties) 257 6. Definitions 257 7. Analytical Methods for Single Variable Problem

Modeling And Analysis of ChemicalEngineering Processes

Publisher : IK International ISBN : 9788189866310 Author : K Balu, K.Padmanabhan

Type the URL : http://www.kopykitab.com/product/5626

Get this eBook

30%OFF