Compurers & Chemicrrl Engineering Printed in Great Britain.
Vol. 8. No.
1, pp. 9-18,
009s1354/84 $3.00 + ml Pergamon Press Ltd.
1984
SPARSE MATRIX METHODS FOR EQUATION-BASED CHEMICAL PROCESS FLOWSHEETING-I REORDERING
Chemical
PHASE
MARK A. STADTHERR* and E. STEPHENWOOD? Engineering Department, University of Illinois, Urbana, IL 61801, U.S.A. (Received 26 August 1982; received for publication 24 January 1983)
Abstract-Four new sparse matrix reordering algorithms, varying in degree of sophistication, are described. These and five other algorithms, including the P4 and hierarchical partitioning algorithms, are compared on the basis of reordering time and performance. Two of the new techniques offer overall improvement on randomly generated matrix structures, while another performs extremely well on flowsheeting matrices. Scope-The drawbacks to the well-known sequential-modular approach to process flowsheeting are today increasingly being recognized. When applied to complex processes with a number of recycle streams, the sequential-modular approach may become extremely slow, due in part to the nesting of iteration loops in the computation. It is equally important to note that the sequential-modular approach does not efficiently handle problems in which a number of design constraints are imposed, nor is it well-suited to the solution of process optimization problems. A promising alternative for overcoming these limitations is the so-called equationbased approach. In this case the entire process is represented by a large set of generally nonlinear equations that are then solved simultaneously. Today at least five prototype equation-based flowsheeting systems in various stages of development exist: SPEEDUP (Imperial College) [I 1, ASCEND II (Carnegie-Mellon)[2], QUASILIN (University of Cambridge)[3], FLOWSIM (University of Connecticut/Control Data)[4, 51, and SEQUEL (University of Illinois)[6]. Many of the aspects involved in equation-based flowsheeting are discussed in detail by Westerberg et al.[7], Shacham et a1.[5], and Stadtherr & Hilton[6]. The central computational problem in equation-based flowsheeting is the solution of a very large nonlinear equation system. While initial work in equation-based flowsheeting typically involved solution by tearing, the recent trend is toward solution by simultaneous linearization. In this case all the equations are linearized and all the variables iterated on simultaneously, using Newton-Raphson or some related technique. This approach requires the periodic solution of a large, sparse, linear equation system ultimately involving perhaps tens of thousands of equations. Thus arises the need, emphasized in more detail in [7], for sparse matrix techniques capable of efficiently solving such huge systems. This paper is the first in a series of reports in which we consider in detail the computational efficiency of sparse matrix algorithms and associated codes, paying particular attention to performance on matrices with the structure inherent in flowsheeting problems. We focus here on the reordering techniques used for solving sparse matrix problems. In our experience, and that of others[5,8], a priori reordering methods appear preferable in dealing with large matrices with a flowsheeting structure. We compare here five published reordering techniques, namely PREORD[9], P4[10], HP, HP10 and HP20[11], as well as four new techniques, including a new algorithm designed specifically for flowsheeting problems. The comparisons are based on both the speed of reordering and the efficiency with which the solution is found once the reordering is complete. In the second paper in this series we concentrate on solution algorithms and codes. Conclusions and Significance-When simultaneous linearization is applied to the solution of the very large nonlinear equation systems encountered in equation-based chemical process flowsheeting, a key step in the computational procedure is the solution of a very large and sparse system of linear equations. One phase in the solution of such systems is to reorder the matrix in such a way that it can be solved without requiring excessive core storage or computation time. Based on comparisons of reordering speed and performance, we conclude that, of the several methods considered, the new BLOKS reordering algorithm is dramatically better than others for matrices arising in flowsheeting problems. This is because in achieving a desirable reordering BLOKS recognizes and attempts to maintain the natural block structure of the flowsheeting problem. For randomly structured matrices, the new SPKl and SPK2 algorithms, as well as the well-known P4 algorithm, are most attractive. *Author to whom correspondence TPresent address: AmocoChemical
should be addressed. Co., Naperville IL 60540, U.S.A. 9
MARK A. STADTHERRand E. STEPHEN WOOD
10 BACKGROUND
Consider the solution of the linear equation system Ax = b where A is large, sparse, and of order n. The sparse matrix A is typically stored using some sort of “packed” storage scheme in which only the nonzero elements are stored. Several such schemes are reviewed by Duff[l2] and Tewarson [ 131. Generally these schemes require roughly either 27 or 37 storage locations, where r is the number of nonzero elements in A. The usual solution procedure can be represented by the factorization A = LU, where L and U are respectively lower and upper triangular factors. The triangular factors or their equivalent are typically calculated using Gaussian elimination or some variation thereof. This is equivalent to calculating the elimination form of the inverse (EFI). For a large and sparse A, the number of nontrivial nonzeros in L and Umay greatly exceed the original number of nonzeros in A, a phenomenon generally known as “fill-in”. A major concern in the development of sparse matrix methods is the reduction of such fill-in, since the loss of sparsity may lead to excessive storage requirements and considerable increases in computational times. In many, perhaps most, applications, especially those arising in the discretization of PDE problems, the sparse matrix A has rather well-defined structural and numerical properties, such as symmetry, bandedness, and positive definiteness. A considerable number ofspecial-purpose solution techniques have been developed with these applications in mind. Flowsheeting matrices are not so well-defined either structurally or numerically and thus require the use of generalpurpose solution techniques. Nevertheless, as discussed below, flowsheeting matrices do have a certain inherent structure that can be used to advantage in selecting and developing sparse matrix techniques. General-purpose sparse matrix routines in general involve a reordering phase and a numerical phase. In the reordering phase the rows and columns of A are reordered in such a way that sparsity will be maintained during the numerical phase, in which the actual elimination is performed. Reordering is of course equivalent to selecting a sequence of elements on which to pivot during the numerical phase. Reordering techniques are generally classified as either a priori or local. When a priori techniques are used the solution is obtained in two passes: first all or part (rows only or columns only) of the reordering phase is completed, after which the numerical phase begins. When local techniques are used the solution is obtained in only one pass, during which one alternates between the reordering and numerical phases. 123456789T