From: Rainer M. <ra...@tb...> - 2006-06-13 14:50:49
|
Andrew > Intuitively I can't see why this formulae is wrong > but hey what do I know! > > My calculus really isn't up to figuring this out! > sorry I'm a software engineer. I guess I should know for SBML and all=20 that b$ > I'm a biologist, so i really don't know much about this either :) luckily we have lukas (chemist) and stefan (physicist) to help out. > I don't have problem in changing SOS to using amount units for the > species variables. However you will still have a problem when a model > contains a rate rule in concentration units. What happens then? Mhm ... we will try to figure out on Friday if we can represent variable=20 compartments at all ... i'm quite confused now :( Rainer On Tue, 13 Jun 2006, Andrew Finney wrote: > Rainer > > I think I understand your English argument > > my last email was really just a comment on > how you expressed your argument :-) > > I don't exactly understand why the math doesn't work. > CVODE solves any correctly defined ODE system > if CVODE produces the wrong results then we've got the formulae wrong. = (I'm just restating the issue slightly differently) > > given > > d[s]/dt =3D f([S])/C [1] > > when > > dC/dt =3D g([S]) [2] > > Either [1] is the correct formulae or it isn't > when > C is varying volume and > f is a function returning substance/time units and > g is a function returning volume/time units and > [S] is the set of all concentrations. > > Intuitively I can't see why this formulae is wrong > but hey what do I know! > > My calculus really isn't up to figuring this out! > sorry I'm a software engineer. I guess I should know for SBML and all = that but I don't. > > Have we got it wrong? > Perhaps we have. > > I don't have problem in changing SOS to using amount units for the=20 species variables. However you will still have a problem when a model=20 contains a rate rule in concentration units. What happens then?=20 > (in that case as na=EFve softy I would multiply by the volume!) > > yours Andrew > > > >> -----Original Message----- >> From: Rainer Machne [mailto:ra...@tb...] >> Sent: 13 June 2006 15:09 >> To: Andrew Finney >> Cc: SOSlib Development >> Subject: RE: [SOSlib-devel] variable compartment bug[Scanned] >> >> Andrew >> >> >> I have added a corrected and more clear version of the example file. >> >> >>> All you need to do is ensure that the initialAmount values >> are used to >>> calculate the initialConcentration values again by dividing by the >>> volume. Have we implemented that? >> >> Yes, the internal SBML ode model only contains >> initialConcentrations; initialAmounts from the input model >> have all been converted by dividing by compartment size. >> >> >>> if S1 is in a compartment with volume C then >>> >>> d[S1]/dt =3D (f1() + f2() + ... fn()) / C >>> >>> f1..fn are the reaction rates which are >>> expressions that have units substance/time >>> >>> f1...fn are functions of the concentrations of the >>> species [S1]..[Sn] >>> >>> I thought that's what we'd implemented. >> >> Yes, that is what we have. >> >> >>> Why do you need two sets of values? >> >> Ok, I'll try to explain in more detail. >> >> I change the notation to >> S ... amount of molecule S >> s ... concentration, [S] =3D S/v >> v ... volume >> >> >> Imagine we start with initialConcentration s(0) =3D 1, >> and integrate from 0 to time 1. >> >> What cvode does is to add the concentration increase ds to >> the initial >> concentration: >> >> s(t) =3D s(0) + ds >> >> if the volume is doubled during that time e.g. by a rate >> rule, ds should >> correctly include the changing volume because its part of the ODE. >> >> However, s(0)=3D1 has never been corrected for the changing volume! >> >> If the ODE ds/dt was 0 during this time, e.g. because of a missing >> activator of the reaction, s(t) would still change to 0.5, >> because the >> volume has doubled. >> >> This is not reflected in SOSlib! >> >> To the example XML: >> >>> Note the initial volume of the compartment is not specified >> in the xml. >> >> Sorry, I tried the model with old version which still had the >> `missing >> parameter bug' from last week. >> See the attached corrected file. >> >> The compartment volume increases to 11 because of its rate rule >> d(volume)/dt =3D + 0.1 >> >> Substance s1 starts with concentration 1 and is totally >> consumed by the >> irreversible reaction >> >> S1 -> S2; kineticLaw =3D k+S1 >> >> which moves all molecules to S2. >> >> Substance S2 would have a final concentration of 1, if the >> compartment >> still had volume 1, but not for a final volume of 11. >> >> The final concentration should be 1/11. >> >> The totalConcentration in the example file should also >> decrease to 1/11. >> >> >> SOSlib and the ODE division by volume only corrects the change of >> concentration but not the initial concentration, or generally >> spoken, the >> concentration of the last time step, which also has decreased. >> >> The only solution i can think of, is to define ODEs in >> substance/time and >> do the division independently of the ODE system. >> >> Rainer >> >> >> >> >> >> >> >> >> >> >> On Tue, 13 Jun 2006, Andrew Finney wrote: >> >>> Rainer >>> >>> Slow down!! >>> >>> I don't actually understand the argument: >>> why can't you have the ODEs as ODEs of concentrations: >>> >>> if S1 is in a compartment with volume C then >>> >>> d[S1]/dt =3D (f1() + f2() + ... fn()) / C >>> >>> f1..fn are the reaction rates which are >>> expressions that have units substance/time >>> >>> f1...fn are functions of the concentrations of the >>> species [S1]..[Sn] >>> >>> I thought that's what we'd implemented. >>> >>> Why do you need two sets of values? >>> >>> I would strongly urge we go for the approach is having >>> one set of values and carefully converting the units as is >> appropriate. >>> >>> fundamentally what's the problem? >>> >>> In the SBML you sent the only fly in the ointment >>> is that the initial value for the species is >>> expressed in substance units via the initialAmount >> attribute rather than >>> the initialConcentration >>> attribute which is in concentration units. >>> >>> All you need to do is ensure that the initialAmount >>> values are used to calculate the initialConcentration >> values again by >>> dividing by the volume. Have >>> we implemented that? >>> >>> Note the initial volume of the compartment is not specified >> in the xml. >>> >>> yours Andrew >>> >>>> -----Original Message----- >>>> From: sbm...@li... >>>> [mailto:sbm...@li...] On >>>> Behalf Of Rainer Machne >>>> Sent: 13 June 2006 11:42 >>>> To: SOSlib Development >>>> Subject: [SOSlib-devel] variable compartment bug[Scanned] >>>> >>>> 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 > |