Problem session 5

We have seen how to implement the Gillespie algorithm. However, writing down the update and propensity functions is tedious and error prone. Let's use a tool that does this for us.

In this lecture we chose to go with basico - a slim and powerful simulation tool for reactions based on Copasi. Let's load some libraries first.

Hello world: $A + B \rightarrow C$

Now let's create our first model and simulate it. We are using pandas to plot the data, but could also transform it into a numpy/list to plot is with matplotlib.

A word of warning

Be careful since basico calls by design have side effects. It may be that you created a model and later changed species names, but the model still has the old species in it. If such things happen, restart the kernel.

More reactions

Try to modify the code above: introduce more reactions and play around with plotting several stochastic traces. Once you are comfortable with running simulations, you are ready for your first dsitributed algorithm.

Distributed oscillation among bacteria

Check out the next homework. It is based on a paper that proposes an algorithm that leads to oscillation of bacterial concentrations. The design makes use of communication among the bacteria via a small diffusible signaling molecule AHL.

We propose to start reading the homework assignment with the following questions in mind: