def spark_work(model_with_parameters): import tellurium as te if(antimony == "antimony"): model_roadrunner = te.loada(model_with_parameters[0]) else: model_roadrunner = te.loadSBMLModel(model_with_parameters[0]) parameter_scan_initilisation = te.ParameterScan(model_roadrunner,**model_with_parameters[1]) simulator = getattr(parameter_scan_initilisation, function_name) return(simulator())
""" Create a colormap. """ from __future__ import print_function, division import tellurium as te model = ''' $Xo -> S1; vo; S1 -> S2; k1*S1 - k2*S2; S2 -> $X1; k3*S2; vo = 1 k1 = 2; k2 = 0; k3 = 3; ''' # load model rr = te.loada(model) # perform parameter scan colormap = te.ParameterScan.createColormap([.86, .08, .23], [.12, .56, 1]) p = te.ParameterScan(rr, endTime=3, colormap=colormap) p.createColorPoints() p.plotSurface()
""" Plot array. """ from __future__ import print_function, division import tellurium as te model = ''' $Xo -> S1; vo; S1 -> S2; k1*S1 - k2*S2; S2 -> $X1; k3*S2; vo = 1 k1 = 2; k2 = 0; k3 = 3; ''' rr = te.loada(model) p = te.ParameterScan(rr, startTime=0, endTime=20, numberOfPoints=50, width=2, xlabel='Time', ylabel='Concentration', title='Cell') p.plotArray()
as a surface plot. """ import tellurium as te model = ''' $Xo -> S1; vo; S1 -> S2; k1*S1 - k2*S2; S2 -> $X1; k3*S2; vo = 1 k1 = 2; k2 = 0; k3 = 3; Xo = 0; S1 = 0; S2 = 0; X1 = 0; ''' rr = te.loada(model) p = te.ParameterScan(rr) p.startTime = 0 p.endTime = 6 p.numberOfPoints = 50 p.startValue = 1 p.endValue = 5 p.independent = ["Time", "k1"] p.dependent = "S1" p.xlabel = "Time" p.ylabel = r"$k_{1}$" p.zlabel = r"$S_{1}$" p.plotSurface()
k1 = 0.9; k2 = 0.3; k3 = 0.7; x = 0; ''') # parameter scan p = te.ParameterScan( r, # settings startTime=0, endTime=15, numberOfPoints=50, polyNumber=10, endValue=1.8, alpha=0.8, value="x", selection="x", color=[ '#0F0F3D', '#141452', '#1A1A66', '#1F1F7A', '#24248F', '#2929A3', '#2E2EB8', '#3333CC', '#4747D1', '#5C5CD6' ]) # plot p.plotPolyArray() # In[2]: r = te.loada(''' $Xo -> S1; vo; S1 -> S2; k1*S1 - k2*S2;