From: Rainer M. <ra...@tb...> - 2008-10-06 14:57:04
|
Eric Fernandez wrote: > Hi, > > That seems fine for me. However would that affect event evaluation ? No, it behaves exactly the same as before: only those rules are evaluated that are required for event evaluation. Additional rules are only evaluated if the assigned value is specifically requested. However, we identified one problem for the current event implementation, or more general the current handling of setting new parameter values during integration. We previously assumed that CVODES doesn't care about discontinuities in the right-hand-side functions of the ODE model, and only discontinuities in the left-hand-side, i.e. resetting of ODE variables, would require re-initialization of the solver. Unfortunately, that is not entirely true. While for most cases it doesn't cause big problems, in general their should be no discontinuities also in the r.h.s. Especially the requested error tolerances won't be correct. That means that we might need to reinitialize the CVODES solver structures for ALL EVENTS, not only those which reset ODE variables! Maybe, we can introduce an option, or use the existing option "opt->ResetCvodeOnEvent" (of which I suspect Andrew introduced it only for testing purposes) to test the two cases, and how it affects performance if we only reset the solver for new ODE variables (l.h.s discont. as currently) OR for all new parameters (r.h.s discont.). Rainer > > Eric > >> -----Original Message----- >> From: Rainer Machne [mailto:ra...@tb...] >> Sent: 06 October 2008 14:38 >> To: sbm...@li... >> Subject: Re: [SOSlib-discuss] ODEModel_createWithObservables[Scanned] >> >> Hi, >> >> I think we can get rid of the "observables" all together. I >> have moved update of all assignment rules - even those which >> are not required to solve the system - to the two cases were required: >> >> a) with option StoreResults: all values are stored, so all >> rules need to be updated anyways >> >> b) IntegratorInstance_getVariableValue: if an assigned value >> is requested specifically, then assignment rules are updated >> (but only once, if the function is used several times at the >> same integration step!). >> >> So if you solve without the StoreResults option, and don't >> use getVariableValue for assigned values (rate laws, values >> only in the model for observation purposes), the solver will >> always only update the required rules. >> >> At a later point also the complete rule evaluation for above >> cases could be optimized by storing the dependency graph >> between assignments and use a recursive evaluation through >> this graph ONLY for the requested values. >> >> As a conclusion, "observables" to optimize solver performance >> is not required anymore, and I will remove this functionality >> completely. >> >> Any objections? >> >> Rainer |