From: Witold W. <wew...@gm...> - 2006-05-10 15:17:21
Attachments:
test.c
|
Hello, Depending if I apply globalise parameter or not I am getting different outputs in the sensitivity analysis. Given the MAPK.xml Namely the output of the functions (see attachment) IntegratorInstance_dumpPSensitivities(integratorInstance,p1); IntegratorInstance_dumpYSensitivities(integratorInstance,y1); differs depedning if globalizeParameter(model,"V2","J1"); was called. If I do not call it the output reads: CVode-- At t = 0 and h = 1.12418e-06, the corrector convergence failed repeatedly or with |h| = hmin. 1.12418e-06 0 0 0 0 0 0 0 0 1.12418e-06 10 0 0 0 0 I am working on a very recent cvs checkout. cheers Eryk |
From: Rainer M. <ra...@tb...> - 2006-05-10 15:53:49
|
> If I do not call it the output reads: > > CVode-- At t = 0 and h = 1.12418e-06, the corrector > convergence failed repeatedly or with |h| = hmin. > > 1.12418e-06 0 0 0 0 0 0 0 0 > 1.12418e-06 10 0 0 0 0 The first two lines mean that cvodes has failed for integration with sensitivity analysis. Thus results and sensitivities were not calculated. IntegratorInstance_dumpY/PSensitivities print first the current time, then the current value of the variable/parameter, and then the sensitivities to all constants of the model. I have never noticed however that upon failure the current time seems to be the h, which is cvodes' internal timestep. So the sensitivities for this time h are wrong and the output should look different. Maybe upon failure cvodeData the time should be reset to the last valid time. Rainer On Wed, 10 May 2006, Witold Wolski wrote: > Hello, > > Depending if I apply globalise parameter or not I am getting different > outputs in the sensitivity analysis. > > Given the MAPK.xml > > Namely the output of the functions (see attachment) > > IntegratorInstance_dumpPSensitivities(integratorInstance,p1); > IntegratorInstance_dumpYSensitivities(integratorInstance,y1); > > differs depedning if > > globalizeParameter(model,"V2","J1"); > > was called. > > If I do not call it the output reads: > > CVode-- At t = 0 and h = 1.12418e-06, the corrector > convergence failed repeatedly or with |h| = hmin. > > 1.12418e-06 0 0 0 0 0 0 0 0 > 1.12418e-06 10 0 0 0 0 > > I am working on a very recent cvs checkout. > > cheers > > Eryk > |
From: Witold W. <wew...@gm...> - 2006-05-11 09:32:17
|
Hi Rainer, The point I wanted to make is that I am wondering why depending if I use th= e function globalizeParameter or not prior to integration I am getting different results. cheers Eryk On 5/10/06, Rainer Machne <ra...@tb...> wrote: > > > > > If I do not call it the output reads: > > > > CVode-- At t =3D 0 and h =3D 1.12418e-06, the corrector > > convergence failed repeatedly or with |h| =3D hmin. > > > > 1.12418e-06 0 0 0 0 0 0 0 0 > > 1.12418e-06 10 0 0 0 0 > > > The first two lines mean that cvodes has failed for integration with > sensitivity analysis. Thus results and sensitivities were not calculated. > > IntegratorInstance_dumpY/PSensitivities > > print first the current time, then the current value of the > variable/parameter, and then the sensitivities to all constants of the > model. > > I have never noticed however that upon failure the current time seems to > be the h, which is cvodes' internal timestep. So the sensitivities for > this time h are wrong and the output should look different. Maybe upon > failure cvodeData the time should be reset to the last valid time. > > > Rainer > > On Wed, 10 May 2006, Witold Wolski wrote: > > > Hello, > > > > Depending if I apply globalise parameter or not I am getting different > > outputs in the sensitivity analysis. > > > > Given the MAPK.xml > > > > Namely the output of the functions (see attachment) > > > > IntegratorInstance_dumpPSensitivities(integratorInstance,p1); > > IntegratorInstance_dumpYSensitivities(integratorInstance,y1); > > > > differs depedning if > > > > globalizeParameter(model,"V2","J1"); > > > > was called. > > > > If I do not call it the output reads: > > > > CVode-- At t =3D 0 and h =3D 1.12418e-06, the corrector > > convergence failed repeatedly or with |h| =3D hmin. > > > > 1.12418e-06 0 0 0 0 0 0 0 0 > > 1.12418e-06 10 0 0 0 0 > > > > I am working on a very recent cvs checkout. > > > > cheers > > > > Eryk > > > |
From: Rainer M. <ra...@tb...> - 2006-05-11 11:05:59
|
Hi Eryk, On Thu, 11 May 2006, Witold Wolski wrote: > Hi Rainer, > > The point I wanted to make is that I am wondering why depending if I use the > function globalizeParameter or not prior to integration I am getting > different results. Sorry, I really didn't answer that question! >> > globalizeParameter(model,"V2","J1"); By globalizing two parameters you add them to the cvodeData constants (nvalues and nconst increase by two) and thereby request more sensitivities from CVODES. Calculating many sensitivities at the same time can in some cases significantly decrease the performance or even get too much for CVODES and it quits. `convergence failed' is the usual message when CVODES cannot calculate results (timecourses and/or sensitivities) within the requested error tolerance. Unfortunately, the sensitivity error tolerance currently cannot be set, but you can try to play with the general tolerances (--error and --rerror) and with the maximum number of internal steps option (--mxstep) or with external steps (--printstep). To solve this, we need to a) implement a way to select specific parameters for which sensitivities are calculated; a quick hack could be a function localizeParameterExcept that works on the SBML input model and localizes all global parameters except the ones that you want sensititities for. b) implement error settings for sensitivities Furthermore, we need to write documentation on performance relevant settings, such as errors, mxstep etc. Ok? Rainer > > cheers > Eryk > > > On 5/10/06, Rainer Machne <ra...@tb...> wrote: >> >> >> >> > If I do not call it the output reads: >> > >> > CVode-- At t = 0 and h = 1.12418e-06, the corrector >> > convergence failed repeatedly or with |h| = hmin. >> > >> > 1.12418e-06 0 0 0 0 0 0 0 0 >> > 1.12418e-06 10 0 0 0 0 >> >> >> The first two lines mean that cvodes has failed for integration with >> sensitivity analysis. Thus results and sensitivities were not calculated. >> >> IntegratorInstance_dumpY/PSensitivities >> >> print first the current time, then the current value of the >> variable/parameter, and then the sensitivities to all constants of the >> model. >> >> I have never noticed however that upon failure the current time seems to >> be the h, which is cvodes' internal timestep. So the sensitivities for >> this time h are wrong and the output should look different. Maybe upon >> failure cvodeData the time should be reset to the last valid time. >> >> >> Rainer >> >> On Wed, 10 May 2006, Witold Wolski wrote: >> >> > Hello, >> > >> > Depending if I apply globalise parameter or not I am getting different >> > outputs in the sensitivity analysis. >> > >> > Given the MAPK.xml >> > >> > Namely the output of the functions (see attachment) >> > >> > IntegratorInstance_dumpPSensitivities(integratorInstance,p1); >> > IntegratorInstance_dumpYSensitivities(integratorInstance,y1); >> > >> > differs depedning if >> > >> > globalizeParameter(model,"V2","J1"); >> > >> > was called. >> > >> > If I do not call it the output reads: >> > >> > CVode-- At t = 0 and h = 1.12418e-06, the corrector >> > convergence failed repeatedly or with |h| = hmin. >> > >> > 1.12418e-06 0 0 0 0 0 0 0 0 >> > 1.12418e-06 10 0 0 0 0 >> > >> > I am working on a very recent cvs checkout. >> > >> > cheers >> > >> > Eryk >> > >> > |
From: Witold W. <wew...@gm...> - 2006-05-11 13:47:14
|
Reiner, The meassage: CVode-- At t =3D 0 and h =3D 1.12418e-06, the corrector convergence failed repeatedly or with |h| =3D hmin. 1.12418e-06 0 0 0 0 0 0 0 0 1.12418e-06 10 0 0 0 0 I got with only 3 global parameters while with 4 global parmaters (after th= e call of the function globalize), but with all other settings the same, everything is working fine. Not sure what to think about it because it seem= s to contradict what you have said before. The cvodeSettings I am using are: CvodeSettings_setTime(settings, 300, 10); CvodeSettings_setErrors(settings, 1e-9, 1e-4, 1000); CvodeSettings_setStoreResults(settings, 1); CvodeSettings_setSensitivity(settings,1); However, after changing: CvodeSettings_setTime(settings, 300, 10); to: CvodeSettings_setTime(settings, 7.5*200, 200); And I am just not getting my head around this. Eryk Eryk On 5/11/06, Rainer Machne <ra...@tb...> wrote: > > Hi Eryk, > > On Thu, 11 May 2006, Witold Wolski wrote: > > > Hi Rainer, > > > > The point I wanted to make is that I am wondering why depending if I us= e > the > > function globalizeParameter or not prior to integration I am getting > > different results. > > Sorry, I really didn't answer that question! > > >> > globalizeParameter(model,"V2","J1"); > > > By globalizing two parameters you add them to the cvodeData constants > (nvalues and nconst increase by two) and thereby request more > sensitivities from CVODES. Calculating many sensitivities at > the same time can in some cases significantly decrease the performance or > even get too much for CVODES and it quits. `convergence failed' is the usual message when CVODES cannot calculate > results (timecourses and/or sensitivities) within the requested error > tolerance. > > Unfortunately, the sensitivity error tolerance currently cannot be set, > but you can try to play with the general tolerances (--error and --rerror= ) > > and with the maximum number of internal steps option (--mxstep) or with > external steps (--printstep). > > To solve this, we need to > > a) implement a way to select specific parameters for which sensitivities > are calculated; a quick hack could be a function localizeParameterExcept > that works on the SBML input model and localizes all global parameters > except the ones that you want sensititities for. > > b) implement error settings for sensitivities > > > Furthermore, we need to write documentation on performance relevant > settings, such as errors, mxstep etc. > > > Ok? > > Rainer > > > > > > cheers > > Eryk > > > > > > On 5/10/06, Rainer Machne < ra...@tb...> wrote: > >> > >> > >> > >> > If I do not call it the output reads: > >> > > >> > CVode-- At t =3D 0 and h =3D 1.12418e-06, the corrector > >> > convergence failed repeatedly or with |h| =3D hmin. > >> > > >> > 1.12418e-06 0 0 0 0 0 0 0 0 > >> > 1.12418e-06 10 0 0 0 0 > >> > >> > >> The first two lines mean that cvodes has failed for integration with > >> sensitivity analysis. Thus results and sensitivities were not > calculated. > >> > >> IntegratorInstance_dumpY/PSensitivities > >> > >> print first the current time, then the current value of the > >> variable/parameter, and then the sensitivities to all constants of the > >> model. > >> > >> I have never noticed however that upon failure the current time seems > to > >> be the h, which is cvodes' internal timestep. So the sensitivities for > >> this time h are wrong and the output should look different. Maybe upon > >> failure cvodeData the time should be reset to the last valid time. > >> > >> > >> Rainer > >> > >> On Wed, 10 May 2006, Witold Wolski wrote: > >> > >> > Hello, > >> > > >> > Depending if I apply globalise parameter or not I am getting > different > >> > outputs in the sensitivity analysis. > >> > > >> > Given the MAPK.xml > >> > > >> > Namely the output of the functions (see attachment) > >> > > >> > IntegratorInstance_dumpPSensitivities(integratorInstance,p1); > >> > IntegratorInstance_dumpYSensitivities(integratorInstance,y1); > >> > > >> > differs depedning if > >> > > >> > globalizeParameter(model,"V2","J1"); > >> > > >> > was called. > >> > > >> > If I do not call it the output reads: > >> > > >> > CVode-- At t =3D 0 and h =3D 1.12418e-06, the corrector > >> > convergence failed repeatedly or with |h| =3D hmin. > >> > > >> > 1.12418e-06 0 0 0 0 0 0 0 0 > >> > 1.12418e-06 10 0 0 0 0 > >> > > >> > I am working on a very recent cvs checkout. > >> > > >> > cheers > >> > > >> > Eryk > >> > > >> > > > |
From: Witold W. <wew...@gm...> - 2006-05-11 13:55:47
|
Hi, Sorry, I have forgotten a sentence in the last e-mail. However, after changing: CvodeSettings_setTime(settings, 300, 10); to: CvodeSettings_setTime(settings, 7.5*200, 200); The sensitivities are computed .... I am just not getting my head around this. Eryk |
From: Rainer M. <ra...@tb...> - 2006-05-11 14:38:44
|
Hi, > CvodeSettings_setTime(settings, 7.5*200, 200); The success of CVODES integration really depends on the number of printsteps because the error tolerances are used separately for each printstep. Errors can accumulate and cause numerical instabilities that CVODES cannot handle. The behaviour you described in the previous emails, that CVODES convergence fails with less parameters and succeeds with more parameters is really strange. I cannot explain this, but currently couldn't think of any bug that causes this. To find out if it is a SOSlib bug, we could try to change the input file, i.e. localize/globalize the parameters by hand and see what happens. It might be some problem of the algorithm. Maybe you can play with the error tolerances and printsteps. If that succeeds that we could be sure that it's not a SOSlib bug. Rainer On Thu, 11 May 2006, Witold Wolski wrote: > Hi, > > Sorry, I have forgotten a sentence in the last e-mail. > > However, after changing: > > CvodeSettings_setTime(settings, 300, 10); > to: > CvodeSettings_setTime(settings, 7.5*200, 200); > > The sensitivities are computed .... > > I am just not getting my head around this. > > Eryk > |
From: Stefan M. <ste...@oe...> - 2006-05-12 09:37:31
|
hi! i would like to use the SOSlib in a c++ program. using #include <sbmlsolver/odeSolver.h> works fine with the compiler, but not with the linker. Using extern "C" { #include <sbmlsolver/odeSolver.h> } the compiler gives the error: template with C linkage does anybody know what i can do about this? cheers, stefan. p.s. the exact error message: In file included from /usr/include/c++/3.3.5/iosfwd:46, from /usr/local/include/sbml/SBMLDocument.h:62, from /usr/local/include/sbml/SBMLTypes.h:56, from /home/stefan/local/include/sbmlsolver/odeSolver.h:40, from adj_sensitivity.cpp:43: /usr/include/c++/3.3.5/x86_64-suse-linux/bits/c++locale.h:70: error: template with C linkage |
From: Stefan M. <ste...@oe...> - 2006-05-12 11:45:47
|
hi! xtof solved the problem. the extern "C" statement is not necessary in the c++ file. it is already included in the SOSlib headers. in processAST.h there was an error: the definitions of indexAST simplifyAST AST_dump ASTNode_getSymbols ASTNode_containsTime have to be inside the extern "C" statement. thanks, stefan. Am Freitag 12 Mai 2006 11:37 schrieben Sie: > hi! > > i would like to use the SOSlib in a c++ program. using > #include <sbmlsolver/odeSolver.h> > works fine with the compiler, but not with the linker. Using > extern "C" { #include <sbmlsolver/odeSolver.h> } > the compiler gives the error: template with C linkage > > does anybody know what i can do about this? > > cheers, > stefan. > > p.s. the exact error message: > In file included from /usr/include/c++/3.3.5/iosfwd:46, > from /usr/local/include/sbml/SBMLDocument.h:62, > from /usr/local/include/sbml/SBMLTypes.h:56, > from /home/stefan/local/include/sbmlsolver/odeSolver.h:40, > from adj_sensitivity.cpp:43: > /usr/include/c++/3.3.5/x86_64-suse-linux/bits/c++locale.h:70: error: > template with C linkage |