From: Rainer M. <ra...@tb...> - 2006-06-21 15:17:13
|
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 ...) 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? 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 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? 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 or B) use above approach. Is that it? Rainer |