Monday, August 27, 2018

How to do a simple parameter scan using Tellurium

Originally Posted on  by hsauro

A common task in modeling is to see how a parameter influences a model’s dynamics. For example, consider a simple two reaction pathway:

-> S1 ->

where the first reaction has a fixed input of vo and the second reaction a first-order rate laws k1*S1. The task is to investigate how the time course of S1 is influenced by vo.

The script below defines the model, then changes vo in increments and plots the effect on the pathway via a time course simulation. To do the parameter scan we exploit plotArray. This initially prevents the plots from being shown using show=False. We make sure that each plot gets a different color using resetColorCycle=False, finally, we show the plot using show(). To make things more interesting we also add a legend entry for each plot.

Note we call reset each time we run a simulation to ensure that S1 is reset back to its initial condition.

The following figure shows the resulting plot:



Thanks to Kiri Choi for pointing out how to use plotArray in this way.


Wednesday, August 22, 2018

How to plot a grid of phase plots using Tellurium

Originally Posted on  by hsauro

Let’s say we have a chemical network model where the species oscillate and you’d like to plot every combination of these on a grid. If so, then this code might be of help.

This code will generate:



Here is an alternative that has removed the internal ticks and labels and arranges the column and row labels as contiguous. This is probably more than one might expect. This version plots all combinations including the transpose combinations.



The following shows the steady-state oscillations. This was done by simulating the model twice and using the plotting the second set of simulation results.