Algorithms for Chemists

Algorithms for Chemists

Compurrrs C/rem. Vol. 14. No. 2, PP. 183-187. 1990 Pergaman Press pk. Printed in Great Britain BOOK REVIEWS Numerical Methods with FORTRAN 77: A Prac...

241KB Sizes 2 Downloads 81 Views

Compurrrs C/rem. Vol. 14. No. 2, PP. 183-187. 1990 Pergaman Press pk. Printed in Great Britain

BOOK REVIEWS Numerical Methods with FORTRAN 77: A Practical Introduction, by L. V. Atkinson, P. J. Harley and J. D. Hudson, Addison-Wesley, Wokingham, U.K., 1989. ISBN O-201-17430-8, 386 pp, + index and contents. This book is a manual of the more usual mathematical library subroutines, implemented in FORTRAN 77, and would be useful either for an introductory course in numerical mathematics, or as a handbook for the computational practitioner. It covers linear and non-linear algebra, approximation and interpolation, quadrature, and simple ordinary differential equations. Each method is prefaced by a clear and concise mathematical exposition, followed by an outline of the computational strategy to be followed, and finally an implementation in a stylistically clear and readable F77 code. For the most part the subroutines are a page or less in length; while they may not be as comprehensive or robust as those in the standard libraries such as IMSL or NAG, they appear to be useful for a broad range of problems. A modular approach is used, building on what has gone before, as in any well-constructed library. The first few chapters are of special interest. Chapter 1 summarizes the special features of F77 which enable the improvement in clarity of style over earlier FORTRANs. Chapter 2 presents standards of program construction to be followed, and Chapter 3 deals with the effects of rounding errors, conditioning and stability. These subjects are all too often neglected and it is refreshing to see them treated as prerequisites for the construction of quality code. Whatever may be said of the deficiencies of FORTRAN as a programming tool, it remains the language of choice for numerically intensive computational tasks, and it is a pleasure to see many of the well-established routines redone in an understandable form. The authors state that the codes are available in machine-readable form (media and cost unspecified) which could provide small machine users with a (presumably tested) workable subroutine library for many purposes, and avoid their attempts at amateurish and error prone codes. Many exercises throughout the book offer useful practice in accessing the library routines and exploring their application: the answers are also given.

Computational Methods in the Chemical Sciences, by A. F. Carley and P. H. Morgan, Ellis Horwood, Chichester, U.K., 1989. ISBN O-85312-746-8, 335 pp. including index and contents, US $65.00. Algorithms for Chemists, by J. Zupan, Wiley, New York, 1989. ISBN O-471-92173-4, 290 pp. + contents, us $39.50.

Both these books appeared on your Editor’s desk almost simultaneously. At first glance, they appeared to be just some more additions to the growing list of texts combining the elements of programming and numerical analysis with examples targeted to a particular field, chemistry in this case. Closer examination, however, showed that they were indeed different from the usual text, and substantially different from each other in their approach, their content, and the level of the audience at which they are aimed. Carley and Morgan have directed their book to the chemistry student with little computational experience but fair mathematical ability. Their rationale is to imbue him with an understanding of methods of data reduction which are being incorporated into automated instrumentation, and to allow him to experiment with the algorithms to learn how they work, their range of application and the pitfalls associated with them. Along the way elements of the standard topics of numerical analysis are presented: interpolation and approximation, integration and differentiation, differential equations, curve fitting and optimization. In each case only a few basic methods are discussed; for example, quadrature stops with Simpson’s rule and half a page of discussion of spline methods. This is done, as the authors state, to “keep the book to a manageable length” and “not overwhelm the student”. There are no linear algebra based methods; these are “deferred to a future volume” which is also promised to include molecular graphics, Fourier transform techniques and cluster analysis. Zupan’s book, while claiming a similar ruison d’etre, viz. the teaching of methods of data manipulation and reduction, is aimed at a more advanced audience and specifically excludes areas which are usually covered by other courses. It is not intended to teach programming or numerical analysis by way of application, but assumes the student is already familiar with these subjects, and goes on to address topics specific to chemical data processing. In this sense, it Depardment of Chemical DAVID EDELSON might be the future volume envisioned by Carley and Engineering Morgan. It is divided into several parts. The first, FA MU / FS II Coilege of Engineering titled DATA, deals with measurement space and TullahQssee, FL 32316-2175, U.S.A. vectors, file storage and data access, includes the use 183

184

Book Reviews

of pointers, hashing techniques and sorting methods. Part 2, PROCESSING OF DATA, treats smoothing, peak-picking, baseline correction, correlation and principle component analysis and various transformations. It concludes with a chapter on optimization and curve fitting. The final section, entitled DATA HANDLING, begins with chapters on clustering and pattern recognition, and then seemingly goes off on a tangent to discuss computerized handling of chemical structures, including a brief excursion into graph theory, fractals and cellular automata, neural networks and expert systems. These latter topics are introduced to “keep the students informed about new trends and to keep them awake!” These discussions do not go into any depth, but are well supported with a bibliography of supplemental reading. An even greater contrast between the two books is apparent in the way the algorithms are presented. Carley and Morgan use Applesoft Basic, with the rationale that this makes for easy transportability, and apologizing for the difficulty in reading code written in such a primitive and unstructured language. Zupan has copied the code in whatever was used by its original author, and thus has a mixture of Basic, Fortran, Pascal and Knuth’s Mix, that “hopefully will be understood by anyone with. . . a basic knowledge of computer programming”. Presumably both authors have tested the codes so that they are reasonably bug-free; Zupan offers to supply complete source codes or compiled versions of most of the algorithms presented. There is no doubt that both these books will find use for their intended (rather limited) audiences, in chemistry as well as other disciplines, but neither appears to be suitable for a first course in numerical analysis/computer science. Most students, in the United States at least, will have some computer experience even before coming to university, where it will be extended by formal coursework in programming, usually Fortran or Pascal based, making Carley and Morgan somewhat too elementary. On the other hand, Zupan might be too advanced for this purpose. Thus their adoption as a text will depend on the particular circumstances of the school, the instructor and the students. Anyone contemplating a new choice of text for such a course would be well advised to study both of them carefully before making a decision. However, both books contain much material which could be used for enrichment of the traditional curriculum. Department of Chemical Engineering FAMVfFSU College of Engineering Tallahassee, FL 323162175, U.S.A.

DAVID EDELSON

Advanced Scientific Computing in BASIC with Applications in Chemistry, Biology and Pharmacology, by

P. Valko and S. Vajda, Elsevier, Amsterdam, 1989. TSBN O-444-87270- I, 318 pp. + index contents, about US $100; supplemental disk for use on IBMPC/XT/AT and Microsoft BASIC, US $53.60. This book is photoreproduced from text printed on a dot-matrix printer with somewhat ragged characters, rather washed-out in appearance and quite difficult to read. The clarity is not helped by the numerous errors in English usage. Within these limitations, forced on them by the publisher, the authors have exerted care to produced a neat manuscript. The authors have chosen BASIC as the language because of the “interpreter’s ability to enable you to interactively enter a program, immediately execute it and see the results without stopping to compile and link the program.” This is a book on numerical analysis with illustrations of applications to chemistry, biology and pharmacology. The applications seem to have been selected primarily to illustrate the use of the numerical method under consideration. From the viewpoint of a biologist, a chemist or a pharmacologist they are elementary and/or specialized. The majority are from physical chemistry. They will be of little interest to the specialist. Someone who needs to develop numerical methods can find much of interest, but this book is not a source of ready-to-use application programs. This book could be useful as a text for either self-study or for a course in numerical analysis applied to one of the target fields. In fact, such is evidently the intent. There are numerous excercises throughout. However, the high price of this book will tend to restrict its popularity with students. There are five main sections: Computational Linear Algebra (68 pp.), Nonlinear Equations and Extremum Problems (70 pp.), Parameter Estimation (80 pp.), Signal Processing (40 pp.) and Dynamical Methods (56 pp.). The writing is tight; there is a lot of information, but some of the treatment is sketchy. The underlying principles are described concisely, but sometimes without discussion of relative merits. There is not space to provide a complete listing of contents, but I shall mention most of the applications to give an indication of coverage. Section I on Computational Linear Algebra includes solution of matrix equations, simplex method for normal form, matrix inversion, finding eigenvalues and eigenvectors, fitting a line by the method of least absolute deviations, Euclidean norm and condition number of a square matrix, principal component and factor analysis (mentioned very briefly in two pages). The applications in section I are as follows: a “blending problem,” a linear programming example to maximize the profit by making the optimum number of units of Product I and Product II which consist of different mixtures of two ingredients. This