#include <FuncRateTerm.h>
Public Member Functions | |
FuncReac (double k, vector< unsigned int > v) | |
double | operator() (const double *S) const |
Computes the rate. The argument is the molecule array. | |
unsigned int | getReactants (vector< unsigned int > &molIndex) const |
void | setReactants (const vector< unsigned int > &molIndex) |
void | rescaleVolume (short comptIndex, const vector< short > &compartmentLookup, double ratio) |
RateTerm * | copyWithVolScaling (double vol, double sub, double prd) const |
This FuncReac manages a one-way NOrder reaction whose rate is determined by a Function, but which also has regular substrates and products.
dproduct/dt = func( x0, x1, x2..., t ) * [sub0] * [sub1] * ....
The values x0, x1, x2 are expected to be concentrations so that they do not depend on volume. The substrates sub0, sub1, ... are # of molecules. The term k_ is scaled so that it is unity at vol = 1/NA m^3. k_ = (NA * vol)^(numSub-1) The copyWithVolScaling operation scales it up and down from there.
FuncReac::FuncReac | ( | double | k, | |
vector< unsigned int > | v | |||
) | [inline] |
Referenced by copyWithVolScaling().
RateTerm* FuncReac::copyWithVolScaling | ( | double | vol, | |
double | sub, | |||
double | prd | |||
) | const [inline, virtual] |
Duplicates rate term and then applies volume scaling. Arguments are volume of reference voxel, product of vol/refVol for all substrates: applied to R1 product of vol/refVol for all products: applied to R2
Note that unless the reaction is cross-compartment, the vol/refVol will be one.
Reimplemented from FuncRate.
References FuncRate::func_, FuncReac(), FuncRate::funcVolPower_, FuncRate::k_, and NA.
unsigned int FuncReac::getReactants | ( | vector< unsigned int > & | molIndex | ) | const [inline, virtual] |
This function finds the reactant indices in the vector S. It returns the number of substrates found, which are the first entries in molIndex. The products are the remaining ones. Note that it does NOT find products for unidirectional reactions, which is a bit of a problem.
Reimplemented from FuncRate.
double FuncReac::operator() | ( | const double * | S | ) | const [inline, virtual] |
Computes the rate. The argument is the molecule array.
Reimplemented from FuncRate.
References FuncRate::func_.
void FuncReac::rescaleVolume | ( | short | comptIndex, | |
const vector< short > & | compartmentLookup, | |||
double | ratio | |||
) | [inline, virtual] |
This is used to rescale the RateTerm kinetics when the compartment volume changes. This is needed because the kinetics are in extensive units, that is, mol numbers, rather than in intensive units like concentration. So when the volume changes the rate terms change. Each Rate term checks if any of its reactant molecules are affected, and if so, rescales. Ratio is newVol / oldVol
Reimplemented from ExternReac.
References FuncRate::k_.
void FuncReac::setReactants | ( | const vector< unsigned int > & | molIndex | ) | [inline] |
Reimplemented from FuncRate.