A Chemical-Reaction Interpreter for Simulation of Complex Kinetics

ACS Symposium Series , Volume 306, pp 176–185. Abstract: Applications of symbolic computer programming to group theory will be discussed. These prog...
0 downloads 13 Views 650KB Size
10 A Chemical-Reaction Interpreter for Simulation of Complex Kinetics 1

David Edelson

Downloaded by UNIV OF PITTSBURGH on May 3, 2015 | http://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch010

AT&T Bell Laboratories, Murray Hill, NJ 07974

Simulation of the kinetics of complex chemical systems is finding ever increasing use for analysis of reaction mechanism as well as for process prediction and control. Software for the solution of the large number of coupled mass-action differential equations is now readily available, as are reaction rate data banks for many systems of interest. However, application of the technique is discouraged by the tedious, error-prone task of manually formulating the differential equation set and coding i t for the computer. Several chemical reaction interpreters which can do this have been written over the years; this report describes our most recent version which uses modern operating systems and programming techniques to implement an interactive, user-friendly program. Portability was a prime consideration in its design so that i t could be interfaced with any differential equation solving program. Although i t was written in C for use on machines having a UNIX operating system, the subroutines that i t produces for the equation solver are in FORTRAN, so that they can be ported to other machines, and are compatible with most simulation packages in use today. Special features include free form input, batch or interactive operation, f u l l ASCII capability, and dynamic storage allocation. The extensive use of the "structure" data type in the C source code makes i t easy to modify or enhance the interpreter to suit the needs of the current application or computing environment.

Computer s i m u l a t i o n o f c h e m i c a l r e a c t i o n o r r e a c t i o n - t r a n s p o r t systems has l o n g been used i n chemical engineering process d e s i g n , and h a s more r e c e n t l y moved i n t o t h e c h e m i c a l r e s e a r c h

1

Current address: Department of Chemistry, Florida State University, Tallahassee, F L 32306 0097-6156/86/0306-0119$06.00/0 © 1986 American Chemical Society

In Artificial Intelligence Applications in Chemistry; Pierce, T., et al.; ACS Symposium Series; American Chemical Society: Washington, DC, 1986.

Downloaded by UNIV OF PITTSBURGH on May 3, 2015 | http://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch010

120

ARTIFICIAL INTELLIGENCE APPLICATIONS IN CHEMISTRY

a r e a , where i t has become a t o o l f o r t h e e l u c i d a t i o n o f c h e m i c a l mechanism(/). The t e c h n i q u e has a l s o f o u n d a p p l i c a t i o n i n t h e p r e d i c t i o n o f t h e b e h a v i o r o f l a r g e complex c h e m i c a l systems, s u c h as a t m o s p h e r i c and e n v i r o n m e n t a l systems(2,5), e s p e c i a l l y i n t h e s t u d y o f t h e e f f e c t o f p o l l u t a n t s and s t r a t e g i e s f o r t h e m i n i m i z a t i o n of t h e i r e f f e c t s ( 4 ) . The mathematical problem posed is the solution of the s i m u l t a n e o u s d i f f e r e n t i a l e q u a t i o n s w h i c h a r i s e f r o m t h e massa c t i o n treatment of the c h e m i s t r y . F o r t h e homogeneous, w e l l mixed reactor, this becomes a s e t of ordinary, non-linear, f i r s t - o r d e r d i f f e r e n t i a l equations. For systems t h a t are not s p a t i a l l y u n i f o r m and i n v o l v e m a t e r i a l and e n e r g y t r a n s p o r t , t h e c h e m i c a l t e r m s a r e c o u p l e d w i t h t h e f l u i d m e c h a n i c s and heat transfer to give sets of partial differential equations. Numerical techniques for solving these systems have been e x t e n s i v e l y developed(5,6), but r e g a r d l e s s of the s t r a t e g y used t o s o l v e the s e t of o r d i n a r y d i f f e r e n t i a l equations, or the s p a t i a l d i s c r e t i z a t i o n methods employed f o r p a r t i a l d i f f e r e n t i a l equations(7,£), t h e f i n a l t a s k i s t h a t of s o l v i n g v e r y l a r g e m a t r i x systems of a l g e b r a i c e q u a t i o n s . T h i s has traditionally been t h e f o r t e o f t h e l a r g e m a i n - f r a m e computer, b u t t h e r a p i d l y expanding c a p a b i l i t y o f m i n i s and m i c r o s has e n a b l e d them t o h a n d l e t h e s o l u t i o n o f modest p r o b l e m s . A t t h e o t h e r end o f s c a l e , the expanding scope of a p p l i c a t i o n of t h e s e s i m u l a t i o n methods, e s p e c i a l l y t o two- and t h r e e - d i m e n s i o n a l s y s t e m s , has v a s t l y i n c r e a s e d t h e number o f e q u a t i o n s t o be s o l v e d , and so has e n t e r e d the realm of the supercomputer. From t h e c h e m i s t ' s p o i n t o f view as a u s e r , t h e s e s i m u l a t i o n t e c h n i q u e s r e q u i r e him t o p r o v i d e computer code f o r t h e time d e r i v a t i v e o f e a c h c h e m i c a l s p e c i e s i n t h e mechanism. According t o the p r i n c i p l e of m a s s - a c t i o n , the d e r i v a t i v e of the x-th s p e c i e s c o n c e n t r a t i o n i n a mechanism o f M r e a c t i o n s i n v o l v i n g Ρ c h e m i c a l s p e c i e s i s g i v e n by

d[N ] x

a

t

μ

ρ

i-1

7-1

where fc, i s t h e r a t e c o n s t a n t o f t h e i - t h r e a c t i o n , and v« i s t h e stoichiometric coefficient of the ;-th species i n the i - t h reaction. Since the d i f f e r e n t i a l equations are u s u a l l y handled by methods appropriate to stiff equations, the partial d e r i v a t i v e s o f e a c h o f t h e above e x p r e s s i o n s w i t h r e s p e c t t o a l l t h e Ρ s p e c i e s ( J a c o b i a n m a t r i x ) a r e n e e d e d as w e l l . While each t e r m i n t h e summation above r a r e l y has more t h a n t h r e e s p e c i e s i n t h e p r o d u c t (i.e. most o f t h e i/~'s a r e z e r o ) , t h e a l g e b r a i n v o l v e d i n c o l l e c t i n g a l l t h e sums ana p r o d u c t s i s so l a r g e and t h e l a b o r (and t h e p o s s i b i l i t y o f e r r o r ) i n t h e c o d i n g so g r e a t , t h a t t h i s t a s k i s u n l i k e l y t o be u n d e r t a k e n m a n u a l l y f o r any b u t s m a l l c h e m i c a l mechanisms. However, a mechanism f o r a t m o s p h e r i c or c o m b u s t i o n c h e m i s t r y may e a s i l y r u n t o s e v e r a l h u n d r e d r e a c t i o n s and s p e c i e s . F u r t h e r m o r e , i n r e s e a r c h a p p l i c a t i o n s i t i s common t o t e s t s e v e r a l a l t e r n a t e m o d e l s f o r t h e s y s t e m under s t u d y , and t h e amount o f code t o be w r i t t e n e s c a l a t e s g r e a t l y . Clearly a m a c h i n e a i d i s r e q u i r e d t o make t h e t e c h n i q u e s i m p l e t o use so t h a t i t s e x p l o i t a t i o n i s encouraged. Over t h e y e a r s , v a r i o u s a p p r o a c h e s t o t h i s p r o b l e m have been taken. In one of the earliest, each chemical species was a s s i g n e d an i d e n t i f i c a t i o n number, c h e m i c a l e q u a t i o n s r e w r i t t e n i n t h e s e t e r m s , and t h e computer c o n s t r u c t e d a s y m b o l i c r e a c t i o n t a b l e w h i c h would s u b s e q u e n t l y be u s e d i n a l o o k u p p r o c e d u r e t o guide the computation. I n t h o s e y e a r s , t h e c o m p u t a t i o n was slow and cumbersome, and t h e a d d i t i o n a l o v e r h e a d o f t h e t a b l e l o o k u p a t each s t e p of the i t e r a t i v e s o l u t i o n p r o c e s s g r e a t l y i n c r e a s e d t h e c o s t s o f t h e s i m u l a t i o n . The n e x t s t e p was t o use t h i s t a b l e l o o k u p j u s t once t o w r i t e a r o u t i n e w h i c h would be c o m p i l e d as p a r t of the s i m u l a t i o n program. F o r t r a n was t h e m a j o r h i g h - l e v e l l a n g u a g e a v a i l a b l e ; i t was n e c e s s a r y t o use a s s e m b l y l a n g u a g e t o w r i t e t h e F o r t r a n code f o r t h e s i m u l a t i o n p a c k a g e ( P ) .

In Artificial Intelligence Applications in Chemistry; Pierce, T., et al.; ACS Symposium Series; American Chemical Society: Washington, DC, 1986.

Downloaded by UNIV OF PITTSBURGH on May 3, 2015 | http://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch010

10.

EDELSON

Simulation of Complex Kinetics

121

The n e x t advance was s c a n n i n g and i n t e r p r e t a t i o n of t h e t e x t o f t h e o r i g i n a l r e a c t i o n s e t , w r i t t e n i n as c l o s e an a p p r o x i m a t i o n t o r e a l c h e m i c a l n o t a t i o n as t h e s t r a i g h t - l i n e , u p p e r - c a s e o n l y f o r m a t o f t h e 72-column c a r d would permit(10). Since character and string manipulation through Fortran was at that time cumbersome and inefficient, these p a r t s of t h e i n t e r p r e t a t i o n p r o g r a m were w r i t t e n i n a s s e m b l y l a n g u a g e . The i n t e r p r e t e r u s e d F o r t r a n output statements to generate the s i m u l a t i o n code i n assembly l a n g u a g e , making t h e s i m u l a t i o n more e f f i c i e n t , but unfortunately non-portable. The p a s s a g e o f t i m e has b r o u g h t v a s t l y i m p r o v e d f a c i l i t i e s f o r s t r i n g and c h a r a c t e r h a n d l i n g by h i g h - l e v e l l a n g u a g e s . Smaller m a c h i n e s have come i n t o vogue, and i n t e r a c t i v e operation has taken p r e f e r e n c e over batch systems. The g r o w t h i n p r o b l e m s i z e , however, has k e p t t h e m a i n f r a m e m a c h i n e s i n t h e p i c t u r e , and has even brought i n the supercomputers, which a r e , at t h i s w r i t i n g , g e a r e d t o b a t c h mode o p e r a t i o n and m o s t l y F o r t r a n programming. Front-end machines, however, offer a v a r i e t y of i n t e r a c t i v e e n v i r o n m e n t s and programming l a n g u a g e s . This suggests that a b e t t e r a p p r o a c h would be t o s e p a r a t e t h e p r o b l e m i n t e r p r e t a t i o n and solving functions of a simulation system. This paper describes a new implementation of our previous simulation p a c k a g e , i n w h i c h e a c h p a r t i s done on a m a c h i n e and w i t h a l a n g u a g e w h i c h a r e t h e most e f f e c t i v e and a p p r o p r i a t e . The Bell Laboratories Central Computer Service supports a Cray-1 with Fortran as the primary h i g h - l e v e l language for compute-bound p r o b l e m s . This i s accessed t h r o u g h a number o f front-end m a c h i n e s , m o s t l y Vaxes o p e r a t i n g u n d e r UNIX, w h i c h support several high-level languages for interactive use. B e c a u s e o f t h e number o f d i f f e r e n t t a s k s t h e c h e m i c a l i n t e r p r e t e r is required to perform in addition to elementary string manipulation, we c h o s e C as t h e l a n g u a g e i n w h i c h t o w r i t e i t . T h i s o f f e r s a d e g r e e of p o r t a b i l i t y , as C o r C - l i k e c o m p i l e r s a r e t o be f o u n d on a l a r g e number o f m a c h i n e s and o p e r a t i n g s y s t e m s . Input

Language

C h e m i c a l n o t a t i o n i s m o s t l y t h e r e s u l t o f h i s t o r i c p r e c e d e n t , and was c e r t a i n l y n e v e r i n t e n d e d t o be i n t e r p r e t e d by a computer. However, i n o r d e r t o m a i n t a i n t h e g r e a t e s t e a s e of o p e r a t i o n by a c h e m i s t , t h e i n p u t l a n g u a g e s h o u l d be d e s i g n e d t o be as c l o s e t o the normal n o t a t i o n f o r r e a c t i o n e q u a t i o n s . The basic input record is a chemical equation; reactants on the left are separated from products on the right by an arrow ( — r e a d ' y i e l d s ' ) , and a r e i n t u r n s e p a r a t e d f r o m e a c h o t h e r by p l u s (+) signs. S u b s t i t u t i n g t h e e q u a l s i g n (-) f o r t h e arrow and the ampersand (€) f o r t h e p l u s r e s u l t s i n a m i n i m a l s a c r i f i c e of r e a d a b i l i t y f o r the chemist, but e l i m i n a t e s a m b i g u i t i e s f o r the machine. Subsidiary fields for identification numbers are s e p a r a t e d f r o m t h e r e a c t i o n e x p r e s s i o n by t a b c h a r a c t e r s . Input i s i n f r e e form, w i t h embedded s p a c e s i g n o r e d (except i n t e x t e x p r e s s i o n s , see b e l o w ) . Compounds a r e e x p r e s s e d by t h e i r s y m b o l i c f o r m u l a s . The use of t h e f u l l A S C I I c h a r a c t e r s e t a l l o w s t h e e l e m e n t s t o be e x p r e s s e d by t h e i r u s u a l one o r two c h a r a c t e r names, w i t h t h e u p p e r o r lower case context p r o v i d i n g the c h a r a c t e r count. More e l a b o r a t e d e s i g n a t i o n s f o r atoms ( i n c l u d i n g s u p e r s c r i p t s d e n o t i n g isotope number, f o r example) a r e accommodated by e n c l o s i n g t h e e x p r e s s i o n i n appropriate quotes. U p s h i f t and d o w n s h i f t m e t a c h a r a c t e r s can be u s e d h e r e t o d e n o t e a p p r o p r i a t e c h a r a c t e r p l a c e m e n t on o u t p u t devices (such as p l o t t e r s and typesetters) which allow for p a r t i a l l i n e s p a c i n g s ; l i n e p r i n t e r s would i g n o r e them. U n f o r t u n a t e l y , t e r m i n a l i n p u t does n o t a l l o w f o r t h e s u b s c r i p t s and s u p e r s c r i p t s u s e d by c h e m i s t s . A r i g i d format i s t h e r e f o r e e n f o r c e d t o d i s t i n g u i s h s u b s c r i p t s ( i n d i c a t i n g number o f atoms) from superscripts (indicating valence state or charge) by

In Artificial Intelligence Applications in Chemistry; Pierce, T., et al.; ACS Symposium Series; American Chemical Society: Washington, DC, 1986.

ARTIFICIAL INTELLIGENCE APPLICATIONS IN CHEMISTRY

122

p r e c e d i n g t h e l a t t e r by a + o r - s i g n . C h a r g e i n d i c a t i o n c a n be by appropriate repetition of the sign, o r by a single sign f o l l o w e d by n u m e r i c a l i n d i c a t i o n . Parenthesized expressions are accommodated and expanded i n the usual way, and nesting to several l e v e l s i s allowed. Where i t i s f e l t that c l a r i t y ( f o r the chemist) i s b e t t e r s e r v e d by u s i n g compound names r a t h e r t h a n f o r m u l a s , t e x t i n p u t i s a c c e p t e d by s u r r o u n d i n g i t w i t h q u o t a t i o n m a r k s . This text i s n o t s u b j e c t t o l e x i c a l a n a l y s i s ; s u b s i d i a r y t a s k s s u c h as s y n t a x c h e c k i n g c a n n o t be p e r f o r m e d i n t h i s c a s e . Quoted t e x t can a l s o be a t t a c h e d t o a compound e x p r e s s e d by f o r m u l a ; t h e f o r m u l a i s i n t e r p r e t e d and t h e t e x t p a s s e d t h r o u g h u n c h a n g e d .

Downloaded by UNIV OF PITTSBURGH on May 3, 2015 | http://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch010

Syntax A n a l y s i s As each reaction equation is entered, several checks are performed to c a t c h e r r o r s i n f o r m u l a t i o n or t y p i n g : the c o r r e c t number of tabs, equals, balanced quotes or parentheses, and c o n f o r m a n c e t o t h e s y n t a x r u l e s w h i c h a l l o w s t h e e q u a t i o n t o be s e p a r a t e d i n t o r e a c t a n t s and p r o d u c t s , and t h e s e i n t u r n t o be decomposed into atoms. Each time a new chemical species i s e n c o u n t e r e d i t i s r e p o r t e d t o t h e u s e r , who c a n d e t e r m i n e w h e t h e r a valid name has been e n t e r e d . The equation i s checked f o r b a l a n c e s i n a t o m i c e l e m e n t s and c h a r g e s , and d i s c r e p a n c i e s l i s t e d for corrective action. S p e c i e s names may be e i t h e r f o r m u l a s o r t e x t ; i n t h e l a t t e r c a s e t h e b a l a n c e c h e c k i n g f e a t u r e must be turned o f f to avoid f a l s e errors. When t h e i n p u t l i s t i s f i n i s h e d , the i n t e r p r e t e r checks the e q u a t i o n s a g a i n s t e a c h o t h e r , t o a s c e r t a i n t h a t a r e a c t i o n has not i n a d v e r t e n t l y been entered more than once, even with permutations of the r e a c t a n t s or p r o d u c t s . F i n a l l y , i f a l l input has been error-free, the interpreter continues by lexically s o r t i n g t h e a t o m i c e l e m e n t s and s p e c i e s names, a s s i g n i n g f i n a l i d e n t i f i c a t i o n numbers, and p r o v i d i n g a l i s t f o r t h e u s e r . S h o u l d an e r r o r be e n c o u n t e r e d d u r i n g input, the interpreter w i l l not complete i t s t a s k . However, i t does c o p y a l l i n p u t t o a f i l e f r o m w h i c h i t may be r e t r i e v e d , e d i t e d and r e s u b m i t t e d i n b a t c h mode, m a k i n g i t u n n e c e s s a r y t o r e t y p e a l l t h e e q u a t i o n s . Data

Structures

Scanning of the r e a c t i o n i n p u t l e a d s t o the g e n e r a t i o n of t h r e e t y p e s o f d a t a s t r u c t u r e ( i n t h e C s e n s e ( / / ) ) , one d e a l i n g w i t h r e a c t i o n s , one w i t h c h e m i c a l s p e c i e s , and t h e l a s t w i t h c h e m i c a l elements. Each reaction structure contains the appropriate identification numbers, and a symbolic r e p r e s e n t a t i o n of the reaction itself i n terms of p o i n t e r s t o the c h e m i c a l species s t r u c t u r e s o f t h e r e a c t a n t s and p r o d u c t s . The c h e m i c a l s p e c i e s structures in turn contain pointers to chemical element structures, as w e l l as text strings t o be used in printed, plotted, or typeset output. The chemical element s t r u c t u r e s similarly contain identifying numerical and text information. S t o r a g e f o r t h e s e s t r u c t u r e s i s a l l o c a t e d as n e e d e d , and t h e y a r e c h a i n e d t o e a c h o t h e r by p o i n t e r s . As e a c h p a r t i c i p a n t in a r e a c t i o n i s examined, t h e d a t a b a s e i s s e a r c h e d and a s t r u c t u r e c r e a t e d f o r any n e w l y e n c o u n t e r e d species. S i n c e t h e number and size of these searches may become q u i t e l a r g e f o r e x t e n s i v e r e a c t i o n mechanisms, t h e s p e c i e s s t r u c t u r e s a r e o r d e r e d l e x i c a l l y i n a b i n a r y t r e e t o k e e p t h e s e a r c h t i m e t o a minimum. After i n p u t i s c o m p l e t e , f i n a l i d e n t i f i c a t i o n numbers a r e a s s i g n e d t o t h e e l e m e n t s and s p e c i e s a c c o r d i n g t o a l e x i c a l s o r t . Program

Output

The principal task of the interpreter is to provide two s u b r o u t i n e s f o r use by t h e s i m u l a t i o n program, w h i c h i s a s o l v e r for o r d i n a r y or p a r t i a l d i f f e r e n t i a l e q u a t i o n s . Since chemical s y s t e m s a r e f o r t h e most p a r t " s t i f f " as a r e s u l t o f n e g a t i v e feedback(72) the i n t e r p r e t e r expects the s i m u l a t i o n package t o

In Artificial Intelligence Applications in Chemistry; Pierce, T., et al.; ACS Symposium Series; American Chemical Society: Washington, DC, 1986.

Downloaded by UNIV OF PITTSBURGH on May 3, 2015 | http://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch010

10.

EDELSON

Simulation of Complex Kinetics

123

use an implicit differential equation solver requiring c a l c u l a t i o n o f b o t h t h e f u n c t i o n (i.e. the mass-action expression of the net rate of change o f the species) and its partial d e r i v a t i v e s with respect to a l l species (Jacobian matrix). The f o r m e r i s computed s t e p w i s e : f i r s t the r a t e of each r e a c t i o n i s calculated; then these terms are combined t o g i v e individual f o r m a t i o n and r e m o v a l t e r m s f o r e a c h s p e c i e s , and f i n a l l y these a r e a l g e b r a i c a l l y added t o g i v e t h e d e r i v a t i v e s . This strategy makes a v a i l a b l e t o t h e u s e r a d d i t i o n a l i n f o r m a t i o n t h a t i s o f t e n h e l p f u l i n i n t e r p r e t i n g t h e mechanism. The Jacobian terms are c a l c u l a t e d i n one step. F o r t r a n code f o r t h e s e s u b r o u t i n e s is w r i t t e n u s i n g d i r e c t a d d r e s s e s f o r e a c h member o f t h e a p p r o p r i a t e a r r a y s , i t b e i n g assumed t h a t t h e s e a r e s t o r e d i n t h e same o r d e r as t h a t p r o v i d e d by t h e l e x i c a l s o r t a b o v e . The F o r t r a n c o m p i l e r is thus burdened with the task of c a l c u l a t i n g the variable addresses, r e l i e v i n g t h e s i m u l a t i o n p r o g r a m o f t h i s t a s k and so i m p r o v i n g t h e r u n - t i m e economy. It i s a l s o p o s s i b l e t o use the information w h i c h has been stored to write programs f o r o t h e r t a s k s . A u s e f u l one, for example, k e e p s t r a c k o f t h e s t o i c h i o m e t r y (i.e. t o t a l atom c o u n t s ) of the system. For a c l o s e d system, s t o i c h i o m e t r y should be a u t o m a t i c a l l y m a i n t a i n e d by linear predictor-corrector solvers, and t h e s t o i c h i o m e t r y p r o g r a m p r o v i d e s a d i a g n o s t i c o f numerical e r r o r s (and o t h e r s ) w h i c h have a c c u m u l a t e d . In o t h e r than c l o s e d s y s t e m s , i t g i v e s an i n d e p e n d e n t c h e c k on t h e s o u r c e s and sinks which are b e i n g modeled. Various d a t a b a s e s c a n a l s o be o u t p u t by t h e i n t e r p r e t e r , e.g. lists of element and species names, t e x t files for labeling p r i n t e d and p l o t t e d o u t p u t , and a s y m b o l i c r e a c t i o n m a t r i x . This i n f o r m a t i o n i s d i s t r i b u t e d t o i n d i v i d u a l ASCII f i l e s , from which t h e y may be r e a d by s u b s e q u e n t p a r t s o f t h e s i m u l a t i o n p a c k a g e f o r use i n t h e a p p r o p r i a t e t a s k . Adaptability The i n t e r p r e t e r was d e s i g n e d t o be i n d e p e n d e n t o f t h e s i m u l a t i o n program for which i t eventually will serve. A structured programming l a n g u a g e s u c h as C i s t h e r e f o r e i d e a l f o r c o d i n g i t s i n c e i t i s s i m p l e t o add code t o p e r f o r m a d d i t i o n a l t a s k s (as f o r example w r i t i n g t h e v a r i a b l e d i m e n s i o n s p e c i f i c a t i o n s ) w h i c h m i g h t be s p e c i f i c t o t h e a p p l i c a t i o n . The use o f s t r u c t u r e d a t a types also allows the expansion of the t y p e of supplementary information carried along with each variable with little additional coding effort and with no danger of breaking the already e x i s t i n g code. Communication of information from the i n t e r p r e t e r t o the s i m u l a t i o n program i s through i n d i v i d u a l f i l e s o f i n f o r m a t i o n , w h i c h can be i n p u t t o s u b s e q u e n t programs and s t o r e d t o be u s e d as n e e d e d . The s i m u l a t i o n s y s t e m i s t h u s f r e e d f r o m d e p e n d e n c i e s on t h e o p e r a t i n g s y s t e m e n v i r o n m e n t . Conclusion The interactive interpretation of chemical equations in c o n j u n c t i o n w i t h t h e s i m u l a t i o n o f c h e m i c a l r e a c t i o n s y s t e m s has b e e n i m p l e m e n t e d by a C - l a n g u a g e p r o g r a m w h i c h c a n be r u n on a s m a l l m a c h i n e t h a t i s i n d e p e n d e n t o f t h e m a c h i n e on w h i c h t h e s i m u l a t i o n program r e s i d e s . The f l e x i b l e s t r i n g and character m a n i p u l a t i o n c a p a b i l i t i e s of t h i s environment e n a b l e s the chemist t o use an input language s i m i l a r to the n a t u r a l language of c h e m i c a l k i n e t i c s , and c h e c k s s y n t a x and c o n s i s t e n c y o f t h e i n p u t as well. The interpreter provides verified code for any s i m u l a t i o n program u s i n g s t a n d a r d d i f f e r e n t i a l e q u a t i o n s o l v e r s , and also facilitates the d i s p l a y of the results in chemical notation. T h e s e i n t e r p r e t e r s have been u s e d s u c c e s s f u l l y f o r many y e a r s and have f o s t e r e d t h e g r o w t h o f s i m u l a t i o n techniques i n many a r e a s o f c h e m i s t r y and c h e m i c a l engineering.

In Artificial Intelligence Applications in Chemistry; Pierce, T., et al.; ACS Symposium Series; American Chemical Society: Washington, DC, 1986.

124

ARTIFICIAL INTELLIGENCE APPLICATIONS IN CHEMISTRY

Literature Cited

Downloaded by UNIV OF PITTSBURGH on May 3, 2015 | http://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch010

1. 2.

D . E d e l s o n , Science, 2 1 4 , 981 (1981). H . G . B o o k e r , et al., Environmental Impact of Stratospheric Flight, N a t i o n a l Academy o f S c i e n c e s , W a s h i n g t o n D . C., 1975. 3 . H . S. Gutowsky et al., Halocarbons: Effects on Stratospheric Ozone, National Academy o f S c i e n c e s , W a s h i n g t o n D . C . 1976. 4. J. H . Seinfeld, Air Pollution; Physical and Chemical Fundamentals, McGrawHill, New Y o r k , 1975. 5. D . D . W a r n e r , J. Phys. Chem., 81, 2329 (1977). 6. N . L. S c h r y e r , J. Phys. Chem., 81, 2335 (1977); and r e f e r e n c e s cited therein. 7. D . E d e l s o n and N . L. S c h r y e r , Computers and Chemistry, 2, 71 (1978); 8 . G . A . N i k o l a k o p o u l o u , D . E d e l s o n and N. L. S c h r y e r , Computers and Chemistry, 6 , 93 (1982). 9 . D . McIntyre, in A Technique for Solving the General Reaction-Rate Equations in the Atmosphere, Appendix B. ( T . J. K e n e s h e a , a u t h o r ) ; AFCRL-67-0221, April 1967. 10. D . E d e l s o n , Computers and Chemistry, 1, 29 (1976). 11. Β . W. K e r n i g h a n and D . M . Ritchie, The C Programming Language, C h a p t . 6; Prentice-Hall, Englewood Cliffs, N.J. 1978. 12. C . F . Curtiss and J. O. Hirschfelder, Proc. Natl. Acad. Set. U. S. A. 3 8 , 235 ( 1 9 5 2 ) . RECEIVED

December 17, 1985

In Artificial Intelligence Applications in Chemistry; Pierce, T., et al.; ACS Symposium Series; American Chemical Society: Washington, DC, 1986.