Spatial Stochastic Simulations

← Back
Example: Annihilation of two species in a cylinder
The spatial stochastic simulation capabilities in StochSS are based on
PyURDME [8]. PyURDME is a general software framework for modeling and simulation of stochastic reaction-diffusion processes on unstructured, tetrahedral (3D) and triangular (2D) meshes. The current core simulation algorithm is based on the mesoscopic reaction-diffusion master equation (RDME) model. The default solver is an efficient implementation of the next subvolume method (NSM) [7].

Example: Annihilation of two species in a cylinder

We will build a simple annihilation model based on an cylinder geometry. At each end of the cylinder, different chemicals will be produced. When they diffuse and meet at the center, they will annihilate each other.

  1. Navigate to the main Model editor.
  2. Add a new model. Select Population, spatial in the dropdown menu.
  3. Click Mesh and select Cylinder. The cylindrical mesh is divided into three subdomains which can be visualized with the controls below the wireframe view.
  4. Add two species, $A$ and $B$, both with diffusion constant 1.
  5. Click Initial Condition, select scatter, and add 500 molecules of species $A$ in subdomain 1 and 500 molecules of species $B$ in subdomain 3.
  6. Add two parameters, $k0$ and $k1$, and set their values to 1 and 100, respectively.
  7. Add three reactions:
    \textrm{R1}:&\quad \emptyset\overset{k_1}{\rightarrow} A\\
    \textrm{R2}:&\quad \emptyset\overset{k_1}{\rightarrow} B\\
    \textrm{R3}:&\quad A+B\overset{k_0}{\rightarrow}\emptyset
  8. Reaction $R1$ should be restricted to subdomain 1 and reaction $R2$ to subdomain 3. Reaction $R3$ should be allowed throughout the whole domain.
  9. The model is now complete and ready to be simulated.
  10. Navigate to the Simulation manager page.
  11. Select the spatial model you just created and click Next.
  12. Setup the simulation parameters: name, time, data storage frequency, and number of realizations.
  13. You can specify a random seed for the random number generator under Advanced Settings.
  14. Click Run locally.
  15. In a few seconds you will be directed to the Job Status page where you can check the status of your simulation.
  16. Once your simulation is complete, click View results to open the Job summary page, where you can visualize the diffusion of the two species over time within the cylindrical container and download the output files of the simulation.

← Back