From: Rainer M. <ra...@tb...> - 2006-06-26 10:52:31
|
Yes you are right. my mistake. We only need the * additional assignment rules for all species x = x.amount, * formulate ODEs for new variables x.amount and leave away the ... / volume from current ODEs and everything, incl. the jacobian, should be fine ( i hope ). of course we haven't considered the `hasSubstanceUnits-species' ... wow :) such an easy conclusion for such a long and confusing discussion. i am really not a `formula-person' :) rainer > I don't think you need to actually substitute the x.amount/volume into > the > ODEs if you have the assignment rules. In SOSlib On Fri, 23 Jun 2006, Andrew Finney wrote: > 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 = x2.amount/volume > dx1.amount/dt = k * x2 > dx2.amount/dt = ??? > > should be equivalent to: > > dx1.amount/dt = k * (x2.amount/volume) > dx2.amount/dt = ??? > > 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... >> [mailto:sbm...@li...] On >> Behalf Of Stefan Mueller >> Sent: 21 June 2006 16:51 >> To: sbm...@li... >> Subject: Re: [SOSlib-devel] implementing variable >> compartments[Scanned] >> >> rainer >> >>> 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=X/V: >>>> dx/dt = (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) >>> expressions for all reactions where X is a >> product/reactant, i.e. it >>> is a function of concentrations x, y, z ... >>> >>> Right? (If not forget, the rest ...) >> >> right. >> >>> So actually, the first part of this equation (dX/dt)/V is >> the current >>> form of ODEs in SOSlib! >>> >>> Could the implementation of variable compartments in SOSlib >> would be >>> as easy as: >>> >>> 1) add the expression " - x*(dV/dt)/V " >>> to the concentration ODEs for species in a variable compartment? >> >> yes. >> >>> 2a) if the compartment is defined by a rate rule, this rate >> rule could >>> be appended to all ODEs directly, i.e. >>> >>> newODE = currentODE - (x/V) * rateRule >> >> yes. >> >>> 2b) if the compartment is defined by an assignment rule, we >> would have >>> differentiate it towards time? For this we need to convert the >>> assignment rule to a form, where differentiateAST recognizes time >>> dependent variables that are in the assignment rule, e.g. >> x(t), which >>> appears only as ASTNode "x". Is this possible/easy? >> >> possible. >> easy? differentiateAST has to extended. >> there must be differentiation with respect to time, but only >> 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... >> >>> 2c) if the compartment is changed by events, we don't need >> to append >>> anything but just recalculate concentrations and re-initialize the >>> solver, just as we do now for events. >>> >>> >>> If above is right - but i guess it might just not be that easy - we >>> would have extracted two alternatives: >>> >>> A) use ODEs in substance/time, write assignment rules for >> x.amount = x >>> / volume and replace all x by x.amount in ODEs, as Andrew suggested >> >> you mean: x = x.amount / volume !? >> >>> or >>> >>> B) use above approach. >>> >>> Is that it? >> >> yes. >> i vote for alternative A :) >> >> reason: >> (i) in alternative B you have to do point 1 and 2a, the >> volume correction, for each ode. >> (ii) in alternative B you have to do point 2b, the additional >> differentiation. >> (iii) the use of assignment rules x = x.amount / volume are >> not a criterion. >> they can be used in both alternatives. >> >> cheers, s >> >> >>> Rainer >>> _______________________________________________ >>> sbmlsolver-devel mailing list >>> sbm...@li... >>> https://lists.sourceforge.net/lists/listinfo/sbmlsolver-devel >> >> >> _______________________________________________ >> sbmlsolver-devel mailing list >> sbm...@li... >> https://lists.sourceforge.net/lists/listinfo/sbmlsolver-devel >> > |