sys-bio / roadrunner

libRoadRunner: A high-performance SBML simulator
http://libroadrunner.org/
Other
37 stars 24 forks source link

r.getScaledFluxControlCoefficientMatrix() if there are events #293

Open hsauro opened 8 years ago

hsauro commented 8 years ago

Calling

r.getScaledFluxControlCoefficientMatrix() or getScaledConcentrationControlCoefficientMatrix()

give the error message:

Metabolic control analysis only valid for primitive reaction kinetics models. This model has events

However at steady state the events are not active so if should be possible to compute the matrix of control coefficients. In fact getCC does allow the control coefficients to be computed.

r = te.loada(""" J1: $A -> B; k1_A; J2: B -> $C; k2_B;

at time > 4: k1 = k1*8

A = 10; B = 0; C = 0; k1 = 0.1; k2 = 0.14; """)

m = r.simulate(0, 25, 100) r.plot()

print "Closeness to steady state: ", r.steadyState()

print r.getFullStoichiometryMatrix() print r.getConservationMatrix(); print r.getReducedJacobian()

print r.getCC ("J1", "k1") print r.getCC ("J1", "k2")

r.getScaledFluxControlCoefficientMatrix() # <-- Doesn't work

0u812 commented 8 years ago

I think I know why this is failing. NLEQ often has difficulty finding the steady state from initial conditions so roadrunner simulates the system before handing it off to NLEQ. This increases the chances of finding a steady state. If you have events then they may be triggered by the simulate call.

0u812 commented 8 years ago

I can either provide a flag to disable the pre-simulate or I can temporarily disable events. I would prefer the former because the model is stateful.