Skip to content

SimBio

  • Example
    from simbio import *
    from simbio.reactions import *
    import numpy as np
    
    class Water(Compartment):
        H2: Species = initial(default=1)
        O2: Species = initial(default=1)
        H2O: Species = initial(default=0)
    
        creation = Synthesis(A=2 * H2, B=O2, AB=2 * H2O, rate=1)
        electrolysis = Dissociation(AB=2 * H2O, A=2 * H2, B=O2, rate=0.5)
    
    sim = Simulator(Water)
    sim.solve(save_at=np.linspace(0, 30, 1000)).plot()
    
Water synthesis andelectrolysis implemeneted in SimBio.

SimBio is a Python-based package for simulation of Chemical Reaction Networks (CRNs). It extends poincare, a package for modelling dynamical systems, to add functionality for CRNs. It's designed around:

  • Modularity: SimBio is intended to create a layer to separate the actual declaration and simulation of models, allowing to easily switch between methods and compile to different backends (including NumPy Numba and JAX). The same model can be compiled for either ODE or stochastic simulation by changing a single line of code.
  • Composability: models are composable, allowing for the combination of smaller systems to create larger ones; complex models can be broken up into more manageable parts.
  • Reproducibility: it intends to be a centralized place for all information concerning models, making it easy to extract data about information and parameters and encouraging consistency between analytical formulations and numerical implementations. Models can also be imported directly from the SMBL format.

Installation

Using pixi, install from PyPI with:

pixi add --pypi simbio

or install the latest development version from GitHub with:

pixi add --pypi simbio@https://github.com/dyscolab/simbio.git

Otherwise, use pip or your pip-compatible package manager:

pip install simbio  # from PyPI
pip install git+https://github.com/dyscolab/simbio.git  # from GitHub

Documentation

SimBios documentation is structured as a series of notebooks. For more information, see Pioncare's documentation.

Basics

Topic guides