SimSoup: News

Trackers and Cycle Detection in SimSoup

22 October 2006

I am extending SimSoup to include features that enable cyclic flows of material in the Reactor to be detected. The basic concept is to include 'Trackers' in the Reactor and monitor their path.

A Tracker is an object that can be attached to a Molecule when it first enters the Reactor as part of the 'food supply'. When the Molecule takes place in an Interaction, the Tracker is passed on to one of the Interaction's Product Molecules chosen according to an arbitrary rule (if the Interaction is a Fission), or to the single Product Molecule (if the Interaction is a Transformation or Construction).

This process goes on so that as Interactions take place the Tracker is continually passed from Reactant to Product and traces a path from Molecule Type to Molecule Type. Eventually the Tracker will either stop at a particular Molecule Type that takes place in no further Interactions, or will return to a Molecule Type it has previously visited. When this happens, a Cycle has occurred. SimSoup detects Cycle Occurrences and identifies each as an instance of a particular Cycle Type.

The plot below shows initial output from SimSoup using Trackers. The scenario setup was as follows:-

The plot shows the following:-

More runs are needed, but the following observations can be made:-

An Approach to Modelling Energy and Thermodynamics in SimSoup

1 May 2006

The current version of SimSoup does not include any concept of energy and thermodynamics. A SimSoup network can therefore have behaviour that would not be possible in real chemistry.

I have been thinking for some while about how to represent these factors in SimSoup, and this article outlines some initial thoughts on this topic.

1 Background Concepts

This section itemises some concepts that are relevant to a discussion of energy and thermodynamics in chemical systems:-

2 The Arrenhius Parameters and their Physical Interpretation

It is found experimentally that many chemical reactions have a rate constant that varies with temperature according an equation of the following form:-

k = Ae-Ea/RT

where T is temperature, and R is the gas constant.

The relationship holds for both unimolecular reactions and bimolecular reactions, and for reactions taking place both in gases and in solutions.

We can interpret the exponential factor e-Ea/RT as the fraction of potential reaction events in which sufficient kinetic energy is available to overcome the activation energy, Ea.

In the case of a reaction taking place between two molecules in the gas phase, e-Ea/RT is given by the Boltzmann distribution as the fraction of collisions with a kinetic energy in excess of Ea. This kinetic energy would be derived from the thermal motion of the two reactant molecules. In the case of a liquid phase reaction taking place in a solution, some or all of the kinetic energy would be derived from kinetic energy of the solvent molecules.

The 'pre-exponential' factor, A, can be interpreted as the frequency of potential reaction events. In the case of a gas phase reaction between two colliding molecules, two factors affect this frequency:-

In the liquid phase, reactants may approach one another as a result of diffusing through a solution. Migration through diffusion is much slower than the motion of molecules in a gas, and so encounters in a liquid may be rarer. However, the encounter may last longer due to the slower migration, and as a result of the cage effect in which the surrounding solvent molecules can hinder migration.

3 The Arrenhius Equation and Thermodynamics

The behaviour of a chemical network is determined by the possible reactions that can take place, and by the rate constants for these reactions. The discussion of the Arrenhius Equation above shows that rate constants are not arbitrary; they depend on the following factors:- Consider a reversible unimolecular reaction:-

X <--> Y

Suppose that the activation energy for the reverse reaction is greater than for the forward reaction (as is the case in the reaction profile diagram above, in which the potential energy of the products is less than that of the reactants).

In this situation, the exponential factor e-Ea/RT will be larger for the forward reaction than for the reverse reaction. If the conditions determining the pre-exponential factor, A, are such that A has the same value for both the forward and reverse reactions, then the rate constant for the forward reaction will be greater than that for the reverse reaction.

This reflects the fact that it is easier for a molecule of X to acquire the activation energy for the forward reaction than for a molecule of Y to acquire the higher activation energy required for the reverse reaction.

It is not necessarily the case that a reversible reaction always prefers the direction that results in lower potential energy. For example, consider the following bimolecular reaction:-

C + D <--> E

Suppose that there is a very stringent steric requirement for the forward reaction such that the C and D molecules must approach each other with a very specific orientation, but that there is no similar requirement for the reverse reaction. This would lead to a situation in which the pre-exponential factor for the forward reaction is very low. As a result of this, the rate constant for the reverse reaction can be higher than that for the forward reaction, even if the activation energy for the reverse reaction is higher.

This can be understood in terms of an activation entropy component in the pre-exponential part of the Arrenhuis equation. In the bimolecular example above, the requirement for two previously separated molecules to combine (with a stringent steric requirement) into a single molecule means that the single E molecule has a lower entropy than the two separated C and D molecules. This can outweigh the exponential factor e-Ea/RT that would favour the forward reaction.

We can conclude therefore that the rate constants of reactions between molecular species in chemical networks are determined by thermodynamic factors including the activation energy and activation entropy, and that the Arrenhius equation is a reflection of the operation of these factors.

4 Energy and Rate Constants in SimSoup

In the current version of SimSoup, there are no constraints on the way that Molecule Types can be connected by Interaction Types, or on the way rate constants are set. SimSoup networks therefore ignore the thermodynamic principles that are embodied in the Arrenhius equation.

To incorporate thermodynamic principles into SimSoup, the following enhancements are planned:-

It is anticipated that these extensions to SimSoup will bring it into qualitative consistency with thermodynamic principles.

SimSoup Network shows Oscillating Behaviour

16 April 2006

The new version of SimSoup released earlier today includes a built-in scenario that shows oscillating behaviour in the Reactor as the simulation runs. The plot below shows the number of Molecules, the total Interaction Rate, and the number of Molecule Types existing in the Reactor plotted against time for the Oscillator scenario.It can be seen that peaks in the indicators are occurring at intervals of (roughly) 200,000 timeteps.



The Manhattan Plot below shows the variability in the Reactor Composition at different times. The Reactor Composition is defined by the number of Molecules of each type present in the Reactor. In other words, the Reactor Composition represents the 'mix' of Molecule Types present.

The most straightforward way to read the Manhattan Plot is horizontally from left to right. The point at the far right of each 'row' corresponds to the Reactor Composition at a particular time (the 'Base Time'). Points to the left correspond to the Reactor Composition at earlier times, with the darkness of each point indicating the degree of difference from the Reactor Composition at the Base Time. A light coloured point therefore indicates a time at which the Reactor Composition was close to that at the (later) Base Time.

The striking diagonal pattern indicates that the Reactor Composition is behaving cyclically. Following any horizontal line across the plot, we see that most of the path is black, but that it turns white for a short period at intervals of approximately 200,000 timesteps. The white sections along the line indicate periods during which the system had (almost) the same Reactor Composition.

In short, the Reactor Composition is constantly changing, but the system returns periodically to the same Reactor Composition. In other words, the system has an oscillating behaviour.

The two plots below show details of the behaviour in the Reactor. The first of the two shows rates of specific Interaction Types, and the second shows the numbers of specific Molecule Types in the Reactor as the simulation proceeds. It can be seen that there are large variations, with 'spikes' occurring in the Interation Rates.

SimSoup 0.3 Released: Includes ' Manhattan Plot' Providing Visibility of the Overall Variability of Reactor Composition

16 April 2006

Version 0.3 of SimSoup has been released today. The main additional features are :-