Total time of SBML run between each MCS
6 months ago by
To be more clear, I have 1 MCS = 6 min. I update the state of the cell every MCS. Does that mean the total time for SBML model is 6 min with the same step size , 0.2 = 1.2 min ? So should the states at the end of 6 min for COPASI match the state of the cell given out by CompuCell at the end of MCS ?
6 months ago by
How have you set the time step for the SBML in the CC3D code and what is the time step specified in the SBML?
A well done SBML file should include a time unit such as second or hour.
<unitDefinition id="time" name="minute">
When you load the SBML in CC3D you specify the time step for the SBML in the units the SBML file has.
If you are using 1 MCS = 6 minutes in CC3D, and you are updating the SBML every MCS, and the time unit in the SBML is minutes, then when you load the SBML you need to tell it _stepSize=6;
However, if you want time steps of 6 minutes but the SBML file time unit is hour then you’ll need;
Every time you step the SBML with self.timestepSBML() the SBML will move forward in time by _stepSize*<whatever the SBML files internal time unit is>
You can also call the SBML more or less often than every MCS and adjust the setting to account for that. Often in a CC3D model the time scale represented by the spin flips is much faster than you need to run the SBML. So, you might only update the SBML every 10 MCS and you set the "_stepSize” to match that.
In your case though, if 1 MCS is 6 minutes then the SBML time scale is probably faster than the spin flip time scale and updating only once every 6 minutes might not be enough.
If you are sure of your time units and stepping, then the next possibility is that the time is off between CC3D and the SBML. It is possible that the time is off by one time step. I've played around with the SBML simple demo SBMLSolver (C:\CompuCell3D\Demos\SBMLSolverExamples folder) and it looks to me like that is the case; CC3D is one time step ahead of the SBML.
Please login to add an answer/comment or follow this question.