Public Member Functions | |
void | init (Simulator aSimulator, XMLParser xmlRoot) |
Initialise the chemostat: the solute and reaction list, and all variables used by the ODE solvers. More... | |
void | setDilutionAndY0 () |
Set the dilution rate and the initial substrate concentration to those specified in the bulk compartment. More... | |
void | initializeConcentrationFields () |
Initialise the concentration fields within the chemostat, getting concentration of any catalysts and storing this on a grid. More... | |
void | solveDiffusionReaction () |
Use the ODE solver to solve the diffusion reaction and update the bulk. More... | |
void | odeSolver (double t0, double rtol, double hmax) |
ODE solver for calculating the diffusion reactions. More... | |
Matrix | calcdYdT (Matrix S, Matrix sInflow, Matrix dYdT) |
Calculates the derivative of substrate concentration (a function parameter) with respect to time. More... | |
Matrix | calcdFdT (Matrix S, Matrix dFdT, Matrix sInflow, double tdel) |
Provides an estimate of how F (the derivative of S w.r.t. time) is changing (i.e. the second derivative). More... | |
Matrix | calcJacobian (Matrix S, Matrix dFdY) |
Calculate the Jacobian matrix - the partial derivatives of the rate of change of each substrate. More... | |
void | updateBulk () |
Find the connected bulks and update their concentrations. More... | |
Matrix | updateSInflow (Matrix sInflow) |
Check if the Sinflow has changed (solutes may be pulsed) More... | |
![]() | |
void | init (Simulator aSim, XMLParser xmlRoot) |
Initialisation procedure for each diffusion solver specified in the XML protocol file. More... | |
void | register () |
Registers this solver in the simulation solver array for referencing later on. More... | |
void | addAllReactions () |
Small routine to use if you have only one solver instead to add one by one all pathways. More... | |
Boolean | isActive () |
Determine if this solver is actually being used. Set in the protocol file. More... | |
void | initAndSolve () |
Create the solver, initialise the concentration fields, and solve the diffusion reaction equations. More... | |
Protected Attributes | |
int | nSolute |
int | nReaction |
SoluteGrid[] | allSolute |
SoluteGrid[] | allReac |
Domain | _domain |
MultigridSolute[] | _reactiveBiomass |
Boolean[] | isConstSol |
double | d = 1.0 / (2.0 + Math.sqrt(2.0)) |
double | e32 = 6.0 + Math.sqrt(2.0) |
double | power = 1.0/3.0 |
double | sqrtE = Math.sqrt(2.22e-16) |
double | EPS = 2.22e-16 |
double | Dilution |
double | hmax |
double | rtol |
ArrayList< Integer > | solReacInd = new ArrayList<Integer>() |
double[][] | soluteYield |
![]() | |
ArrayList< Reaction > | _reactions = new ArrayList<Reaction>() |
SoluteGrid[] | _soluteList |
ArrayList< Integer > | _soluteIndex = new ArrayList<Integer>() |
double | internTimeStep |
double | minimalTimeStep |
double | internalIteration |
double | maxIteration = 1 |
Boolean | _active = false |
Additional Inherited Members | |
![]() | |
String | solverName |
int | solverIndex |
Simulator | mySim |
Domain | myDomain |
![]() | |
void | addReactionWithSolutes (Reaction aReaction) |
Sets reference to a biochemical pathway this solver has to deal with. More... | |
Matrix simulator.diffusionSolver.Solver_chemostat.calcdFdT | ( | Matrix | S, |
Matrix | dFdT, | ||
Matrix | sInflow, | ||
double | tdel | ||
) |
Provides an estimate of how F (the derivative of S w.r.t. time) is changing (i.e. the second derivative).
Provides an estimate of how F (the derivative of S w.r.t. time) is changing (i.e. the second derivative). Note that calcdYdT is called with the hypothetical S-value of y + dYdT * tdel, so we'll need to recall calcReacRateAndDiffRate(S) with S as just y.
S | Temporary container for solute concentration |
dFdT | Estimation of how the derivative of solutes with regard to time is changing |
sInflow | Matrix of solute flow information (if solutes are pulsed) |
tdel | Mini time-step used for calculating the value of dFdT |
Matrix simulator.diffusionSolver.Solver_chemostat.calcdYdT | ( | Matrix | S, |
Matrix | sInflow, | ||
Matrix | dYdT | ||
) |
Calculates the derivative of substrate concentration (a function parameter) with respect to time.
Calculates the derivative of substrate concentration (a function parameter) with respect to time. As part of this process the allReac and allDiffReac values are set according to the (possibly hypothetical) values at substrate concentration S - you'll probably want to rerun calcReacRateAndDiffRate(y); afterwards to get allReac and allDiffReac to the correct values.
S | Temporary container for solute concentration |
sInflow | Matrix of solute flow information (if solutes are pulsed) |
dYdT | Matrix to store the derivatives of substrate concentration |
Matrix simulator.diffusionSolver.Solver_chemostat.calcJacobian | ( | Matrix | S, |
Matrix | dFdY | ||
) |
Calculate the Jacobian matrix - the partial derivatives of the rate of change of each substrate.
The Jacobian matrix dFdY gives the partial derivatives of the rate of change of each substrate (F = dYdT, or equivalently, dSdT) with respect to each substrate. Rows correspond to substrates being differentiated (first by time to give F, then by other substrate concentrations to give the elements of this matrix) and columns to the substrate with respect to which we are differentiating.
S | Temporary container for solute concentration |
dFdY | Jacobian matrix being calculated |
Initialise the chemostat: the solute and reaction list, and all variables used by the ODE solvers.
Initialise the chemostat: the solute and reaction list, and all variables used by the ODE solvers
aSimulator | The current simulation object |
xmlRoot | Root element of XML tags containing chemostat related parameters |
|
virtual |
Initialise the concentration fields within the chemostat, getting concentration of any catalysts and storing this on a grid.
Initialise the concentration fields within the chemostat, getting concentration of any catalysts and storing this on a grid
Implements simulator.diffusionSolver.DiffusionSolver.
void simulator.diffusionSolver.Solver_chemostat.odeSolver | ( | double | t0, |
double | rtol, | ||
double | hmax | ||
) |
ODE solver for calculating the diffusion reactions.
ODE solver for calculating the diffusion reactions
t0 | Simulation time |
rtol | Relative tolerance of the calculated error |
hmax | Maximum internal step of the solver |
void simulator.diffusionSolver.Solver_chemostat.setDilutionAndY0 | ( | ) |
Set the dilution rate and the initial substrate concentration to those specified in the bulk compartment.
Set the dilution rate and the initial substrate concentration to those specified in the bulk compartment [Rob: one assumption here is that the dilution rate is constant].
|
virtual |
Use the ODE solver to solve the diffusion reaction and update the bulk.
Use the ODE solver to solve the diffusion reaction and update the bulk
Implements simulator.diffusionSolver.DiffusionSolver.
void simulator.diffusionSolver.Solver_chemostat.updateBulk | ( | ) |
Find the connected bulks and update their concentrations.
Find the connected bulks and update their concentrations
Matrix simulator.diffusionSolver.Solver_chemostat.updateSInflow | ( | Matrix | sInflow | ) |
Check if the Sinflow has changed (solutes may be pulsed)
Check if the Sinflow has changed (solutes may be pulsed)
sInflow | Matrix of solutes in flow |
|
protected |
Computational domain that this solver is associated with
|
protected |
Array of reactive biomasses
|
protected |
The solute grid of reaction rates for each solute.
|
protected |
The solute grid of solute concentrations. As we are in a chemostat this has only one grid position (0,0,0). Note that y will be the vector containing the actual concentrations during odeSolver()... here allSolute will be a temporary variable used for calculating potential reaction rates, etc, in calcReacAndDiffReacRates().
|
protected |
Constant used by the ODE solvers
|
protected |
The chemostat dilution rate. This will be set when init() calls setDilutionAndY0()
|
protected |
Constant used by the ODE solvers
|
protected |
The smallest positive floating-point number such that 1.0+EPS > 1.0
|
protected |
Maximum internal step of the solver. Used in the ODE solver
|
protected |
Boolean stating whether the bulk concentration remains constant
|
protected |
Number of reactions in simulation
|
protected |
Number of solutes in simulation
|
protected |
Constant used by the ODE solvers
|
protected |
Relative tolerance of the calculated error. Used in the ODE solver
|
protected |
1D array of arraylists containing the list of reactions in which each of the solutes participates.
|
protected |
For each reaction (first index) this stores the yield of each solute (second index). Used in calculating the Jacobian. The Jacobian matrix: on each row an "F" (the rate of change of a substrate concentration) is differentiated with respect to each of the substrate concentrations (arranged on the columns).
|
protected |
Numerical accuracy for EPS (error per step)