## An Overview - Kinetic Modeling and Stochastic Simulations

This section introduces you to basic concepts underlying Kinetiscope. It briefly describes the models for chemical reaction kinetics and the fundamentals of stochastic simulation.

### Modelling Chemical Reaction Kinetics

Studies of reacting systems - whether small scale reactions in a laboratory or large scale processes in factories - all focus on obtaining a basic description of the individual steps involved in the reaction, and the characteristic rate of each step. In most studies, this information is obtained by an iterative, inductive process. After carrying out an experiments and analyzing the results, a mechanism is written down and a model is derived from it. New experiments are then performed to test and refine the mechanism. The optimum model can be used not only to describe the experimental results, but also to predict behavior of the system under conditions which have not been studied explicitly.

Understanding the mechanism of a chemical reaction also allows you to compare different systems to gain deeper insight into their reactivity and the underlying processes which control the outcome of a reaction. This approach is so powerful that, over the years, great effort has been put into both gaining mechanistic information for reacting systems, and developing mathematical models for them.

The models in use today fall into two general categories: algebraic expressions, or rate laws, derived from the mechanistic steps describing the reaction, and numerical simulation of a mechanism using a computer.

### Algebraic Methods

A rate law is an equation obtained by analyzing a reaction mechanism. In general, coupled differential equations are written for the time dependence of each chemical species, and approximations are made to combine and simplify them. Ideally, the final expression involves only measurable or controllable concentrations for comparison with experimental data.

The most common method used to obtain a rate law is to apply the steady state approximation to the coupled differential equations obtained from the reaction mechanism. Transient reaction intermediates are assumed to have very small, stable concentrations. This allows the time derivative of their concentrations to be set equal to zero, and the concentrations of those species are expressed in terms of stable reactants and products only. Use of the steady-state approximation can place restrictions on the experimental conditions used to study a particular chemical reaction. For example, a vast excess of a reagent may be necessary, or only a small extent of reaction might be allowed. For many chemical reactions such limitations do not present difficulties, and, if steady-state conditions truly exist, allow valuable mechanistic information to be obtained.

There are, however, numerous classes of reactions which cannot be treated analytically. They include reactions whose mechanisms are too complicated to yield a rate law; those whose rate laws are too unwieldy to be tested experimentally; reactions which never attain steady-state under the experimental conditions of interest; reactions in which limitations like excess reagents or small extent of reaction are inconvenient or result in throwing away information; and those in which physical conditions such as temperature and volume are not constant. For such systems, kinetic modeling is best done by a computer.

### Computer Simulations

Numerical simulation of chemical reactions is a powerful tool to complement experiments. Unlike algebraic rate laws, which are often highly simplified, simulations allow detailed models to be developed and tested as data accumulate. They also provide a means of evaluating various hypotheses for further experimental investigation. The ability to carry out reliable "what if" simulations can be particularly valuable in studies of very complex systems. It allows you to prioritize and target experimental work when necessary: in manufacturing process development, for example, when time and resources are limited.

Two very different computational methods are available for simulations. The most commonly used is the deterministic approach, in which the time-dependence of species concentrations is written as a set of coupled differential equations which are then integrated. A deterministic model presumes that a reaction is sufficiently well understood that the complete time-dependent behavior of a system is contained in the solution to the differential equations.This method works well and is adequate for many systems, as long as chemical instabilities (such as nucleation and explosion) are unimportant, the dynamic range of rates and concentrations involved in the system is not too large, and boundary conditions required for integrability are physically realistic.

The stochastic method is a computationally simpler alternative to deterministic simulations for many types of chemical systems. For chemical reactions whose complex sets of differential equations are difficult to solve - e.g. explosions, nucleation, large ranges of rates or concentrations - it is the method of choice. The stochastic simulation method, which is used in Kinetiscope and described in more detail in the references in the bibliography, is entirely different from the deterministic one. Rather than finding a solution which describes the state of the system at all points in time, changes in a system are modeled by randomly selecting among probability-weighted reaction steps. This illustration shows the basic simulation loop used in the program.

In Kinetiscope, each compartment in the reacting system is represented as a volume containing an adequate number of particles. The particles are apportioned among reactants present at the beginning of the simulation according to their initial concentrations. Thus, each particle represents an ensemble of molecules of the same type. The reacting system is simulated by allowing this collection of particles to evolve according to the mechanism you defined using your rate constants for reaction and transport. The chemical and physical state of the system - concentrations, pressure, temperature, volume and spatial distribution of species - may vary as the reaction proceeds. Each of these is allowed to change or be held constant, as you specify, in physically meaningful combinations. Kinetiscope calculates these properties using materials data (heats of formation, heat capacities, molar densities) for the chemical components of the system.

The stochastic method places no constraints on the chemical processes occurring during the reaction and is highly accurate. The algorithm also has additional advantages: it uses only simple arithmetic, is general-purpose and does not require programming by the user, and is compact and fast enough that even very complicated mechanisms can be simulated on a personal computer. These features make numerical simulation methods a practical and valuable tool for all scientists and engineers, novices and experts alike.

Note: While computer simulation can be a powerful adjunct to experiment, its use does not reduce or eliminate the need to use good judgment in the chemical laboratory. Always keep safety uppermost in mind when using simulation to assist experimental design. Many handbooks provide guidance on chemical safety - see, for example, "Prudent Practices in the Laboratory," The National Academies Press, Washington, D.C., 2011, and "Bretherick's Handbook of Reactive Chemical Hazards," 7th Ed., P.G. Urben, ed., Elsevier, Oxford, UK 2007

### Characteristics of Stochastic Simulations

Because of the nature of a stochastic calculation and Kinetiscope's design, simulations using Kinetiscope have the following characteristic features:

Reactants and products in the reaction scheme do not need to be real molecules.
Meaningful calculations can be performed even if the chemical identity of various species is unknown. Moreover, unique information can be gained in a reaction simulation if pseudo-species are used to track some of the system characteristics. Several applications of pseudo-species are demonstrated in the example simulations.
Steps can be added and deleted at will as a reaction scheme is developed.
No constraints on this are imposed by the simulator. A mechanism is easily built up and tested in stages. This enables truly inductive modelling as the characteristics of a chemical system are explored.
A dynamic range of concentrations and rates is available.
The only constraints on the dynamic range of concentrations and relative rates used for the simulation are that the computer time available is sufficient to carry out the calculation desired, and that the computer's maximum integer size is not exceeded. Kinetiscope uses 64-bit integers for its calculations (even when operating on a 32-bit computer), and the maximum concentration range in direct simulations where concentrations of all species in the system are explicitly tracked is approximately 1018. In many cases, the concentration limitation is easily overcome by holding concentrations of abundant species constant, and combining those concentrations with the rate constants of the appropriate mechanism steps.
Simulation size is limited only by computer memory.
The size of a simulation (i.e. number of reaction steps and number of chemical species) is limited by the memory available in the computer, since the array space necessary for a particular simulation is reserved when the reaction scheme is defined.
Reactions in diverse systems can be simulated.
There is essentially no limitation on ways that species can be defined to track reactions in gas-liquid-solid mixtures. This allows straightforward treatment of reactions in such diverse systems as flowing and static gases or liquids, decomposition of a solid into a second solid and a gas, gas-solid or liquid-solid interfaces, and so on.
Time does not advance in uniform steps.
Data points are close together in time whenever reaction rates are high, and farther apart when they are low. The magnitude of the time step at a particular stage of a reaction is also linked to the total number of particles used in the simulation. If the total is large, the time steps will be proportionately smaller, and more events will be required to reach a particular time in the reaction.
Concentration versus time curves output by the simulator have random statistical noise.
This effect is due to the relatively small number of particles used to represent chemical species in the system. The signal-to-noise ratio can be increased by increasing the number of particles; the price is paid in more computer time to carry out the simulation. Simulation of realistic noise can be an advantage at time - as a teaching tool, for example, or when studying the effects of small populations of molecules.
The discrete nature of the simulation can lead to pronounced small-system fluctuation effects.
For example, this may occur in the initiation of explosions, nucleation, and polymerization reactions. Variations in the timebase with different random number seeds are the manifestation of these fluctuations. You may increase the number of particles used in the simulation, thereby increasing the numbers of initiating species in the system, or average the results of different runs initiated with different random numbers in order to overcome these effects.
Kinetiscope can emulate equilibria.
The event selection process used by Kinetiscope can lead to inefficient direct simulation of partial equilibria, should they arise during a reaction. Most of the computer time would be spent maintaining the equilibrium, with only occasional selection of other steps. The Equilibrium Detect option's detection and emulation routines make simulation of equilibria more efficient. Their use is illustrated in the example simulations.
Termination is probability- and user-controlled.
The simulation is terminated whenever reaction probabilities for all steps in the mechanism fall to zero. It may also be stopped at earlier times by several user-controlled mechanisms. This ensures that all the results of the calculation, no matter how long it is allowed to run, are meaningful.