From: Rainer M. <ra...@tb...> - 2006-08-29 17:43:52
|
A short update: Ok, I have found one error in SOSlib, which however wasn't the cause for the problem Eryk reported. We never did any CVodeSensFree. I must have overlooked the need for this. However, this should not be called in the current situation anyways, because the dimension of sensitivity analysis (data-> and solver->nsens) stays the same between iterations, i.e. for s.a. for ALL parameterst nconst. In this case CVodeSensReInit can be used. And this still doesn't work! However, if I free the sens structures between iterations (i.e. by _reset function), we get better results but still strange although small deviations between the runs: The first 4 sensitivities in MAPK.xml at time 3: 1st run: 0.0323545 -0.0323545 0.00119977 -0.000683849 2nd run: 0.0322987 -0.0330522 0.0101251 -0.00341986 3rd run: 0.0322956 -0.0330456 0.0101108 -0.00343846 ... 10th run: 0.0322956 -0.0330456 0.0101108 -0.00343846 Note that the sensitivities change a bit during the first three runs, and then stay the same until the 10th run. Very strange !!?? The initial problem, that the ReInit (as used by the current CVS version) produces errors is still there, however. Radu Serban has answered on the sundials list and cannot reproduce the problem. One good thing: we got rid of memory leaks in sens.analysis because CVodeSensFree is now called in the final freeing of solver structures :) Rainer On Tue, 29 Aug 2006, Rainer Machne wrote: > > I have sent below email to the sundials list and forgot to cc it to our > list. I will forward the responses. > > r > > ---------- Forwarded message ---------- > Date: Tue, 29 Aug 2006 17:20:25 +0200 (CEST) > From: Rainer Machne <ra...@me...> > To: sun...@ll... > Subject: sensitivity in iterative runs > > Dear Sundials users/developers, > > > In our software we use the ReInit functions of both CVode and CVodeSens > (version 2.1.1) to run arbitrary numbers of integration runs. > > We get however different sensitivities s(x(t)) with each run, even if we don't > change any parameters or initial conditions, i.e. with exactly the same model, > for which CVode also returns the same results x(t). > > I have tried different combinations of using either ReInit or a completely new > creation of cvode solver structures. > > Both, > a) freeing and recreating the sensitivity structures with > N_VNewVectorArray_Serial and CVodeSensMalloc or > b) reinitializing these structures with CVodeSensReInit > produce wrong results. The results are different from each other, though. > > In the CVodeSensReInit case, the results look somehow `more correct': > e.g. two variables with exactly opposite sensitivities (x/-) to one parameter > stay this way for iterative runs, although with different values. > > Here some results for the same output time (3.0) and different iterations, > sensitivities of two variables to the same parameter: > > both cases: > 1st run: 0.0323545 -0.0323545 > > a) destroying and recreating CVodeSens structures: > 2nd run: 0.0386666 -2.81625 > 10th run: 0.0228166 -14.0761 > > b) using CVodeSensReInit: > 2nd run: 0.0640767 -0.0640767 > 10th run: 0.294778 -0.294778 > > The results x(t) are the same for all cases, i.e. 87.2221 and 12.7779. > The parameter towards which sensitivity is tested has the value 10. > > Note, that the symmetry is kept when using ReInit, while one sensitivity is > growing much bigger for the destroy/create case. > > > The only way to get consistent results is to destroy and recreate the whole > CVode solver structures with CVodeCreate. > > Could this be a bug in SUNDIALS or do you see any hints what we might do wrong > in our software from above results?? > If it's a bug in Sundials, I guess it must be some structure in the CVode > forward solver that is important for CVodeSens but created independently of the > latter. ?? > > Sorry, if this has been brought up and discussed before, I didn't find the > email archives online. > > Thanks, > Rainer Machne > > > Theoretical Biochemistry Group > Department for Theoretical Chemistry > University of Vienna > Austria/Europe > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > sbmlsolver-devel mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-devel > |