In a previous post, I (not so) briefly showed how to load the SimBiology file, select from it the model and simulation configuration settings, and evaluate the model with SimBiology’s simulation engine.
That’s great if you only needed the results for one model with one configuration. I’m guessing that won’t be the case for most use cases, though. In my own research, I am more often interested in how a system’s evolution changes across different initial configurations. For a specie or parameter of interest, I create a range of values to explore, and re-simulate my model for each parameter value in that range. Then I can compare the model outputs to analyze how the variations impacted the system.
SimBiology has a feature for performing these sort of studies, which it calls parameter scanning. However, these parameter scans run painfully slow through SimBio’s graphical interface (surprise, surprise), worsening with increases to model size or complexity. And this is just scanning over a single parameter. SimBiology often becomes unstable for scans of two or more parameters.
This frustration is almost wholly avoidable if we handle our SimBiology models programmatically instead. Today, I’ll demonstrate a simple way to replicate SimBio’s parameter scan process from a MATLAB script. Basically, we will decide on a parameter to vary, and a range of values we want to explore. We setup an array of values spanning that range, loop through that array, and run a simulation for each iteration.
The Model
Okay, let’s get started! This example assumes a very simple chemical reaction network A ⇀ B ⇀ C where k1 and k2 are kinetic rate constants for the chemical reactions where A becomes B, and B becomes C, respectively. Let’s say that we are interested in how k1 impacts levels of species C ultimately..… Read More