Hey all,
I ran into a behaviour of the getCurrentSBML() method, which surprised me: In the return sbml string the concentrations are multiplied by the volume, but when re-loaded the concentration is set to the saved concentration value, i.e. if one wants to store the sbml somewhere and loads it again, the initial values changed. Here an example:
import tellurium as te
model = """
model test
compartment C1;
C1 = 2.0;
species S1, S2;
S1 = 10.0;
S2 = 0.0;
S1 in C1; S2 in C1;
J1: S1 -> S2; k1*S1;
k1 = 1.0;
end
"""
# load models
r = te.loada(model)
print(r.S1) --> 10
sbml = r.getCurrentSBML()
new = te.loadSBMLModel(sbml)
print(new.S1) --> 20
sbml = new.getCurrentSBML()
newer = te.loadSBMLModel(sbml)
print(newer.S1) --> 40
The value of S1 is multiplied by C1 each time I call the getCurrentSBML method. This doesn't happen for getSBML.
I was wondering if there is a specific reason for this behaviour.
Thanks,
Jorin