Programs in the book
Dynamic Modeling of Transport Process Systems
(Academic Press, San Diego, 1992, ISBN 0-12-643420-4)
by
C. A. Silebi
and
W. E. Schiesser*
*Iacocca Hall, Room D307
Lehigh University
111 Research Drive
Bethlehem, PA 18015 USA
(215) 758-4264 (office)
(215) 758-5297 (fax)
WES1@LEHIGH.EDU
(Internet)
Please read the following information before using the programs on the
diskette, which is written as a series of DOS-formatted files stored
in subdirectories according to the chapters in the book (the contents
of this printed set of instructions is in file README.1ST in the root
directory of the diskette).
(1) The diskette was prepared on the assumption that the set of 30
Runge Kutta ODE integrators will be used to execute: (a) the
various models described in the book and (b) provide solutions
to the problems at the end of the chapters. These 30 ODE
integrators are called by main program DSS2S on page 466, which
in turn calls subroutine INTEG on page 475; the actual calls to
the 30 integrators are on page 480 (calls to subroutines INT1 to
INTM15).
Other ODE integrators discussed in the book, e.g., LSODE, DASSL,
are available as part of the DSS/2 software library available
from the author (details are available on request).
The following routines are in subdirectory LIBRARY on the
diskette which contains a library of mathematical routines:
(1.1) Main program DSS2S (or DSS2D) and subroutine INTEG
(DSS2S.SP and DSS2D.DP, INTEG.SP and INTEG.DP), where
.SP and .DP denote single and double precision formats,
respectively. The 30 ODE integrators, INT1 to INTM15,
are included in INTEG.SP and INTEG.DP.
(1.2) PDE spatial differentiation routines:
(single precision)
DSS002.SP, DSS004.SP, DSS012.SP, DSS018.SP, DSS020.SP,
DSS034.SP, DSS036.SP, DSS042.SP, DSS044.SP, DSS046,SP,
DSS048.SP, DSS050.SP
(double precision)
DSS002.DP, DSS004.DP, DSS012.DP, DSS018.DP, DSS020.DP,
DSS034.DP, DSS036.DP, DSS042.DP, DSS044.DP, DSS046,DP,
DSS048.DP, DSS050.DP
The single precision orthogonal collocation (OC) routines,
DSS046.SP, DSS048.SP and DSS050.SP call a series of subor-
dinate routines in OC.SP. Similarly, the double precision
OC routines DSS046.DP, DSS048.DP and DSS050.DP call a
series of subordinate routines in OC.DP.
(1.3) Utilities:
JMAP, EIGEN and subordinate routines for mapping and
computing the eigenvalues of an ODE Jacobian matrix
(files JMAP.SP and JMAP.DP, EIGEN.SP and EIGEN.DP).
TPLOTS and subordinate routines for point plotting
of solutions in 8 1/2 x 11 inch format (files TPLOTS.SP
and TPLOTS.DP).
SPLOTS and subordinate routines for point plotting
of solutions in a format that fits on a PC monitor
(files SPLOTS.SP and SPLOTS.DP).
All of these routines should be readily identifiable from a list
of files produced by the DOS command DIR/P on the subdirectory
LIBRARY.
(2) Subdirectories CHAP2 to CHAP8 contain the programs discussed in
Chapters 2 to 8 (Chapter 1 does not have any programs that can be
included on the diskette). The files in these seven subdirector-
ies have names and extensions which identify their types:
name.FOR for Fortran source files pertaining to particular
application problems.
name.DAT for data files associated with name.FOR files with
the same name.
(3) The file names indicate the particular programs in the book. For
example, Program 2.1 (Program 1 in Chapter 2) has the name PRO2P1.
FOR (it is a main program that does not read a data file, so it
is self contained). Similarly, Programs 2.2 and 2.3 are named
PRO2P2.FOR and PRO2P3.FOR, respectively.
Note also that the programs in Chapters 2 to 8 are coded in single
precision Fortran; this is due to their development on a long word
length computer (64 bits in single precision). However, they
should run without modification on a short word length computer
(e.g., 32 bits in single precision); this has been done by the
author. Alternatively, the programs can be converted to double
precision and run with the double precision library routines of (1).
As another example, Program 1 in Chapter 3 has two files, PRO3P1.
FOR, which contains the Fortran source code of subroutines INITAL,
DERV and PRINT, and PRO3P1.DAT, which contains the data file read
by main program DSS2S.SP. DSS2S.SP in turn calls subroutine
INTEG.SP. Thus, to run Program 3.1, DSS2S.SP, INTEG.SP and PRO3P1.
FOR should be compiled, linked and executed with PRO3P1.DAT read
during execution. This is the basic arrangement of routines for
essentially all of the programs in the book. The exceptions are:
PRO2P1.FOR, PRO2P2.FOR, PRO2P3.FOR (see (3) above))
FIG4P1.FOR, FIG4P2A.FOR and FIG4P2B.FOR (see (5) below))
PRO4P1.FOR and PRO4P2.FOR (see (6) below))
The execution may require modification of the OPEN statement in
DSS2S.SP which defines the input unit number and the name of
the data file. Also the output file may be modified by repro-
gramming the second OPEN statement; modification of the I/O
(OPEN) statements in DSS2S.SP (or DSS2D.DP if you are coding
in double precision) should be the only required changes in the
Fortran. As received, they are:
NI=5
NO=6
OPEN(NI,FILE='DATA', STATUS='OLD')
OPEN(NO,FILE='OUTPUT',STATUS='NEW')
Thus, if these I/O statements are used, file PRO3P1.DAT should
be renamed to file DATA before running Program 3.1. Similarly,
the other data files, which end with the extension .DAT, should
be renamed as DATA as they are used if you use the preceding OPEN
statement defining file DATA.
(4) As another example of the name of files, most of the problems
at the ends of the chapters which have programs as solutions
are included on the diskette. For example, the solution of
Problem 5.5 on page 177 is contained in the Fortran source file
HW5P5.FOR (HW = homework), which has subroutines INITAL, DERV
PRINT; the corresponding data file is HW5P5.DAT. Thus, to
run this problem, DSS2S.SP, INTEG.SP and HW5P5.FOR should be
compiled, linked and executed with data file HW5P5.DAT (again,
renamed DATA if the preceding OPEN state is used).
(5) The following programs, used to produce the plots in Figures 4.1,
4.2a and 4.2b, pages 64, 76 and 77, are included in subdirectory
CHAP4:
FIG4P1.FOR - Figure 4.1
FIG4P2A.FOR - Figure 4.2a
FIG4P2B.FOR - Figure 4.2b
These three programs write the numbers for the plots to a file
which can then be sent to a plotting program; these are stand-
alone programs that do not involve the integration of ODEs.
(6) Programs 4.1 and 4.2 (Programs 1 and 2 in Chapter 4) use the
LSODE integrator. Thus, PRO4P1.FOR and PRO4P2.FOR include
main programs which read data files PRO4P1.DAT and PRO4P2.DAT,
and call LSODE. PRO4P1.FOR and PRO4P2.FOR also include the
usual subroutines INITAL, DERV and PRINT. One of the main
programs that calls LSODE is listed in Appendix 6.
Finally, DSS/2, a library of routines for the solution of ODEs/DAEs/PDEs
which is available at nominal cost, contains many more routines than
could be put on a diskette, e.g., the spatial differentiation routines
listed in Appendix 9 of the book. Also, nine sets of applications
that run under DSS/2 are available. A list of the application titles
for eight sets is given in Appendix 8; the ninth set, called DIFFPACK,
is a collection of problems in stiff and nonstiff ODEs, and one, two
and three dimensional, elliptic, parabolic and hyperbolic PDEs, which
is intended to illustrate the solution of all of the major classes
of ODEs and PDEs within a single software framework.
To summarize the basic arrangement of routines for execution:
(1) Single precision:
DSS2S.SP + INTEG.SP + DSSXXX.SP + DSSYYY.SP + ... + UTILITIES.SP
+ PROXPY.FOR
are compiled, linked and executed with data file PROXPY.DAT. DSSXXX.SP,
DSSYYY.SP, ... are spatial differentiation routines that may be required
for PDE problems, e.g., DSSXXX.SP = DSS002.SP, DSSYYY.SP = DSS004.SP.
UTILITIES.SP are utilities such as TPLOTS.SP that may be required for
a particular application. PROXPY.FOR is the Fortran for a particular
application, e.g., Program Y in Chapter X, and typically consists of
subroutines INITAL, DERV and PRINT plus any subordinate routines, e.g.
a subroutine called from PRINT to produce a continuous plot of the
solution. PROXPY.DAT is the data file read by main program DSS2S.SP.
(2) Double precision:
DSS2S.DP + INTEG.DP + DSSXXX.DP + DSSYYY.DP + ... + UTILITIES.DP
+ PROXPY.FOR
The double precision organization is the same as for single precision.
Of course, the application, PROXPY.FOR, should be coded in double pre-
cision. In fact, mixing single and double precision routines is one
of the more subtle sources of problems (incorrect execution); most
computers will not detect that mixing of precisions has occurred, but
rather, will compile, link and execute the mixed routines to produce
output which is incorrect for no apparent reason (or worse, generate
error messages that have no bearing on the essential error, the mixing
of routines of different precisions). Also, the data files, as con-
stituted on the diskette, can be used with either single or double
precision routines.
The organization of the series of programs which call different utility
routines has been a challenge. I hope the arrangement of the files on
the diskette will facilitate the use of the programs in the book. If
you encounter any difficulties in using the diskette, please feel free
to contact me.
W. E. Schiesser
20JAN93