In [2]:
    
# python 3 compatibility
from __future__ import print_function
from __future__ import division
import tellurium as te
import matplotlib.pyplot as plt
%matplotlib inline
    
In [3]:
    
antimony_model = """
S1 -> S2; k1*S1;
# Initialize values
S1 = 10; 
S2 = 0;
# parameters
k1 = 1;
"""
# create a roadrunner instance using the model defined above
rr = te.loada(antimony_model)
# Carry out a time course simulation results returned in array result.
# Arguments are: time start, time end, number of points
result = rr.simulate (0, 10, 100)
# Plot the results
rr.plot (result)
    
    
    Out[3]:
In [4]:
    
rr.draw()
    
    
In [5]:
    
print(rr.getSBML())
    
    
In [6]:
    
rr = te.loada(antimony_model)
# simulate the model 2 times for 5 seconds each
for k in range(2):
    result = rr.simulate(0, 5, 100) #, reset=True)
    rr.plot(result)
    
    
    
In [7]:
    
k1_values = [0.001, 0.01, 0.1, 1]
# simulate the model for all different k1 values and plot the result
for k1 in k1_values:
    rr.k1 = k1
    result = rr.simulate(0, 2, 100, reset=True)
    rr.plot(result)
    
    
    
    
    
In [8]:
    
rr = te.loadSBMLModel("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000010")
result = rr.simulate(0, 2000, 100)
rr.plot(result)
    
    
    Out[8]:
In [10]:
    
# how does the model structure look like?
rr.draw()
    
    
In [13]:
    
rr.setIntegrator('gillespie')
result = rr.simulate(0, 2000, 100, reset=True)
rr.plot(result)
    
    
    Out[13]:
In [11]:
    
# some useful methods
rr.getFullStoichiometryMatrix()
rr.getConservationMatrix()
rr.getFullEigenValues()
    
    Out[11]:
In [ ]: