From: Rainer M. <ra...@tb...> - 2006-06-13 13:10:35
|
hi Stefan On Tue, 13 Jun 2006, Stefan Mueller wrote: > i don't know how compartments are implemented exactly, > but it is definitely not enough to devide the odes for the amounts by the size > of the compartment. each amount has to be sclaed by the comportment. > only then the rate rules for the concentrations can be used. > i suppose a "doube bookkeeping" of amounts and concs will be necessary... > cheers, stefan. Yes, that is what i meant with >> So we actually should use an ODE system in amount/time instead of >> concentration/time, and have a second data->value array for concentrations >> to be used in formula evaluation. Currently, we construct ODEs and then divide them by the compartment size in Species_odeFromReactions. So this last division will be removed from the ODE. cvodeSolver then calculates in amount/time (or substance/time). However, in the ODE expressions, the species are written in concentrations, i.e. amount/volume. Thus the variables x(t) as calculated by sundials need to be divided by volume again for formula evaluation by evaluateAST. You're right, we need a `double bookkeeping'. data->value should be divided in data->amount which can be used to initialize sundials and should always correspond to N_Vector y. and data->concentrations is data->amount / volume and used by evaluateAST and to store and print results. One question is what units are used for species with an assignment rule? Is the one declared in the SBML, i.e. either initialAmount or initialConcentration, or is it always concentration? r > > > Am Dienstag 13 Juni 2006 12:42 schrieb Rainer Machne: >> Folks >> >> Lukas has identified another serious bug! >> >> SOSlib doesn't support variable compartments. >> >> We initialize sundials with ODEs for concentrations d[A]/dt, and sundials >> calculates [A] + (d[A]/dt)*h, where h is a small time step and [A] is the >> initial condition or the current value. >> >> If we have a variable, e.g time-dependent compartment, then d[A]/dt will >> change with changing compartment because the compartment size is part of >> the right hand side. >> >> However, not only d[A]/dt is dependent on the volume, but also [A], i.e. >> the current value in data->value! >> >> The attached example file exemplifies this. >> >> So we actually should use an ODE system in amount/time instead of >> concentration/time, and have a second data->value array for concentrations >> to be used in formula evaluation. >> >> Didn't we discuss this once? I remember that I had started to do this >> (ODEs in amount/time), but then it got more complicated then I >> thought and something else came up. >> >> Can you think of any problems we will run into? Andrew, how about the >> compiling version? >> >> Rainer > > > _______________________________________________ > sbmlsolver-devel mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-devel > |