From: Rainer M. <ra...@tb...> - 2008-10-20 14:25:06
|
Hi Eva, Eric's hints are correct. SOSlib can handle SBML events, it is however not fully SBML-conformant. Here some more background: SOSlib does NOT detect the exact time an event trigger fires. This would in principle be possible using CVODES' root finding capabilities - which however would also significantly slow down the solver. We plan to implement root finding first for the new SBML 'constraints', and later extend this to implement exact event trigger detection. However, I can't give a time-frame for that development. setHaltOnEvent option: Currently, setting the option setHaltOnEvent to 0 (-n in the command-line tool) activates trigger firing and execution of event assignments between the requested solver steps (--printstep on command-line, and CvodeSettings_setPrintstep(set, int i). For many event models and purposes this is enough, but the user/application has to set printsteps accordingly to obtain the desired accuracy and to avoid missing of events. For example, SOSlib solves the event models in the official (but outdated) semantic-testsuite correctly when the appropriate printstep is chosen. Also I am not aware of any model in Biomodels where SOSlib event handling would cause real problems (but maybe Lukas can give some examples, if he's reading :) ). The default for this option is to STOP the solver when events are triggered, as we can't guarantee the results. Thus the user/application is required to specifically activate it. setResetCvodeOnEvent option: When an event assignment resets variables Y of the ODE system f(Y,p,t) = dY/dt, then the CVODES solver must be reinitialized in any case, and this is always done. If the event assignment only changes the right-hand-side of the ODE system, it is recommended to also reinitialize the solver, as such discontinuities screw up CVODES' error estimations (as far as i understand it). Thus, it is recommended to activate the setResetCvodeOnEvent option, but for simple cases this is also not necessary - the solver is faster if not reset on such event assignments. For the next release, also this option will be active on default! new options in next release: For the immediate next release, it is planned to introduce a simple new option, 'timeStepResolution', which activates internal integration steps between the then only external printstep. This will allow a finer resolution of event trigger detection without having all the values in the output. So e.g. in a simulation to time 1000 seconds, with printstep 50, the event triggers are only checked every 20 seconds. You would need printstep 1000 to detect at every second, but you would also get 1000 result lines. With the new option one will be able to e.g. set StepResolution to 20 and Printstep to 50 to get the same result, but with only 50 lines of results. If your application uses the IntegratorInstance_integrateOneStep and reads results between steps itself (rather then using storage of results with option StoreResults), you can easily implement higher detection resolution without overloading the output yourself. And one more thing to note: The new lack of (assignment) rule ordering restrictions in L2V3 would make it necessary to also account for correct order of rule evaluation in event trigger and assignment handling (see my recent email and responses to the sbml-discuss list). I hope, but I am not sure if I have time, to implement the possibility of such complex dependency trees (or DAGs actually) of event triggers, event assignments, and normal assignment rules also for the next release. Please keep asking, if you have any more questions or suggestions on SOSlib's event handling. Rainer Eric Fernandez wrote: > Dear Eva, > > I am coming back to you. I have checked the options you need to activate > to enable the event evaluation during an integration. You must use: > - cvodeSettings_setHaltOnEvent(cvodeSettings_t *set, int i) -> i=0 > (default is 1) to continue after an event, otherwise it halts, which is > the default! > - cvodeSettings_setResetCvodeOnEvent(cvodeSettings_t *set, int i) -> i=1 > recommended, free and restart integrator after an event. > > Hope this helps, > Eric > > ------------------------------------------------------------------------ > *From:* Eva Sciacca [mailto:sc...@mi...] > *Sent:* 17 October 2008 20:37 > *To:* sbm...@li... > *Subject:* [SOSlib-discuss] Problem on simulating models with > triggers andevents[Scanned] > > Dear all, > > While I was trying to do some testing using SOSlib I had this errors > on running one model from BioModels DataBase. > > Warning 10001 The model contains events. The SBML_odeSolver > implementation of events is not fully SBML conformant. > Results will depend on the simulation duration and the number of > output steps. > Error 20001 Event Trigger 1 (leq(UbE, 0.1)) fired at time 16. > Aborting simulation. > > So, the current version 1.6.0 does not support the triggers? What > about the newer version? Are you going to solve this problem? When > it will be available??? > > Eva. > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > sbmlsolver-discuss mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-discuss |