From: Eric F. <efe...@ph...> - 2008-10-25 18:46:06
|
Hi, I think I have solved an issue using integratorInstance_setVariableValue(). In one of my simulations, I was "injecting" at every step of an integration (at each loop of the while(!IntegratorInstance_timeCourseCompleted(engine){IntegratorInstance_integrateOneStep(engine)}) of a program similar to the odeSolver) the value of one parameter of my model, to simulate the timecourse of a drug injected in a cell, which was read from an external file, as a map<double, double> representing <time, drug_concentration>. The first simulations leaded to many integration solving errors such as "At t = 5.01293 and h = 5.14192e-08, the error test failed repeatedly or with |h| = hmin.", etc... I had the idea to use the same technique than for the ResetCvodeOnEvent, using engine->valid = 0; at each step of the integration, because after all the effect of setVariableValue is equivalent to an event: forcing arbitrarily the change of a model variable value. And then it worked wonderfully with no error at all! I would suggest that this Reset should therefore be performed after each use of integratorInstance_setVariableValue(). Otherwise, is there any reason not to do it ? I did not notice significant slowdown. Rainer, what do you think ? I did not want to do any change to the CVS before you could review this "trick" as I was unsure if there may be some collateral damage (can it lead to undetected false integration values ?) forcing a reset in this case. Regards, Eric |