Trajectory Continuation

From BioNetWiki

Jump to: navigation, search

Starting with distribution 2.1.7, BioNetGen includes a simple feature for "continuing" a simulation trajectory. To use the feature, run the first stage of the simulation as usual. Following the first stage, reset concentrations as desired. Then call the simulator a second time with the parameter continue=>1. For subsequent stages, the 't_end' parameter should be greater than the 't_end' in the previous stage (otherwise BNG returns an error). The parameter 't_start' can be used to make the continuation start time explicit (in this case, t_start must match the previous t_end). The results of all stages are output to a single .GDAT file. (Warning: If you change the 'suffix' parameter between stages, the results will be split into separate files and the second file will not have a header.)

Here's an example using the Egfr_net model. First we simulate 60 seconds with Ligand stimulation, then the ligand is washed out and the simulation continues another 60 seconds. Replace the actions following generate_network with the following:

# Kinetics
setConcentration("egf(r)","egf_0");
simulate_ode({suffix=>ode,t_start=>0,t_end=>60,n_steps=>60,atol=>1e-8,rtol=>1e-8,sparse=>1});
setConcentration("egf(r)",0);
simulate_ode({suffix=>ode,continue=>1,t_start=>60,t_end=>120,n_steps=>60,atol=>1e-8,rtol=>1e-8,sparse=>1});
Personal tools