From: Andrew F. <af...@ph...> - 2006-06-23 11:09:14
|
Folks So what your suggesting is pretty simple: for any SBML system always transform the system to create ODEs of rates of substance change and assignment rules that derive concentrations from substance. That's pretty straightforward I think. I'm happy. Note: I don't think you need to actually substitute the x.amount/volume into the ODEs if you have the assignment rules. In SOSlib x2 =3D x2.amount/volume dx1.amount/dt =3D k * x2 dx2.amount/dt =3D ??? should be equivalent to: dx1.amount/dt =3D k * (x2.amount/volume) dx2.amount/dt =3D ??? This works because the relevant assignment rules are evaluated in the CVODE rhs function before evaluating the ODEs themselves. Or am I missing something? An issue with the jacobian??? If the above isn't true then the way assignment rules work in the general case is wrong too. yours Andrew > -----Original Message----- > From: sbm...@li...=20 > [mailto:sbm...@li...] On=20 > Behalf Of Stefan Mueller > Sent: 21 June 2006 16:51 > To: sbm...@li... > Subject: Re: [SOSlib-devel] implementing variable=20 > compartments[Scanned] >=20 > rainer >=20 > > Stefan, thanks for the clarification in your last email. > > > > i think i got it now :) > > > > you wrote: > > > the ode for conc can be derived by differentiating x=3DX/V: > > > dx/dt =3D (dX/dt)/V - x*(dV/dt)/V > > > where dX/dt is given by the kinetic law above. > > > > dX/dt is just the sum of the +/- (stoichiometry*kineticLaw)=20 > > expressions for all reactions where X is a=20 > product/reactant, i.e. it=20 > > is a function of concentrations x, y, z ... > > > > Right? (If not forget, the rest ...) >=20 > right. >=20 > > So actually, the first part of this equation (dX/dt)/V is=20 > the current=20 > > form of ODEs in SOSlib! > > > > Could the implementation of variable compartments in SOSlib=20 > would be=20 > > as easy as: > > > > 1) add the expression " - x*(dV/dt)/V " > > to the concentration ODEs for species in a variable compartment? >=20 > yes. >=20 > > 2a) if the compartment is defined by a rate rule, this rate=20 > rule could=20 > > be appended to all ODEs directly, i.e. > > > > newODE =3D currentODE - (x/V) * rateRule >=20 > yes. >=20 > > 2b) if the compartment is defined by an assignment rule, we=20 > would have=20 > > differentiate it towards time? For this we need to convert the=20 > > assignment rule to a form, where differentiateAST recognizes time=20 > > dependent variables that are in the assignment rule, e.g.=20 > x(t), which=20 > > appears only as ASTNode "x". Is this possible/easy? >=20 > possible. > easy? differentiateAST has to extended. > there must be differentiation with respect to time, but only=20 > variables for which there is an ode are differentiated. > (and the rhs of the ode is the result.) > the chain rule does the rest of the work... >=20 > > 2c) if the compartment is changed by events, we don't need=20 > to append=20 > > anything but just recalculate concentrations and re-initialize the=20 > > solver, just as we do now for events. > > > > > > If above is right - but i guess it might just not be that easy - we=20 > > would have extracted two alternatives: > > > > A) use ODEs in substance/time, write assignment rules for=20 > x.amount =3D x=20 > > / volume and replace all x by x.amount in ODEs, as Andrew suggested >=20 > you mean: x =3D x.amount / volume !? >=20 > > or > > > > B) use above approach. > > > > Is that it? >=20 > yes. > i vote for alternative A :) >=20 > reason: > (i) in alternative B you have to do point 1 and 2a, the=20 > volume correction, for each ode. > (ii) in alternative B you have to do point 2b, the additional=20 > differentiation. > (iii) the use of assignment rules x =3D x.amount / volume are=20 > not a criterion. > they can be used in both alternatives. >=20 > cheers, s >=20 >=20 > > Rainer > > _______________________________________________ > > sbmlsolver-devel mailing list > > sbm...@li... > > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-devel >=20 >=20 > _______________________________________________ > sbmlsolver-devel mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-devel >=20 |