from roadrunnerlib import rrPython from pkg_resources import resource_string import numpy import matplotlib.pyplot as plot model = resource_string('roadrunnerlib','data/feedback.xml') rrPython.loadSBML(model) timeStart = 0.0 timeEnd = 10.0 numPoints = 50 results = rrPython.simulateEx(timeStart, timeEnd, numPoints) print results S1 = results[:,2] S2 = results[:,3] S3 = results[:,4] x = numpy.arange(timeStart, timeEnd, (timeEnd - timeStart)/numPoints) plot.plot(x, S1, label="S1") plot.plot(x, S2, label="S2") plot.plot(x, S3, label="S3") plot.legend(bbox_to_anchor=(1.05, 1), loc=5, borderaxespad=0.) plot.ylabel('Concentration (moles/L)') plot.xlabel('time (s)') plot.show()
from roadrunnerlib import rrPython from pkg_resources import resource_filename model = resource_filename('roadrunnerlib','data/simple.xml') rrPython.loadSBMLFromFile(model) rrPython.setSteadyStateSelectionList('time S1 S2') results = rrPython.simulateEx(0.0,2.0,20) print results