Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
simulator.diffusionSolver.Solver_chemostat Class Reference
Inheritance diagram for simulator.diffusionSolver.Solver_chemostat:
simulator.diffusionSolver.DiffusionSolver

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...
 
- Public Member Functions inherited from simulator.diffusionSolver.DiffusionSolver
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
 
- Protected Attributes inherited from simulator.diffusionSolver.DiffusionSolver
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

- Public Attributes inherited from simulator.diffusionSolver.DiffusionSolver
String solverName
 
int solverIndex
 
Simulator mySim
 
Domain myDomain
 
- Protected Member Functions inherited from simulator.diffusionSolver.DiffusionSolver
void addReactionWithSolutes (Reaction aReaction)
 Sets reference to a biochemical pathway this solver has to deal with. More...
 

Member Function Documentation

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.

Parameters
STemporary container for solute concentration
dFdTEstimation of how the derivative of solutes with regard to time is changing
sInflowMatrix of solute flow information (if solutes are pulsed)
tdelMini 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.

Parameters
STemporary container for solute concentration
sInflowMatrix of solute flow information (if solutes are pulsed)
dYdTMatrix to store the derivatives of substrate concentration
Returns
Matrix of 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.

Parameters
STemporary container for solute concentration
dFdYJacobian matrix being calculated
Returns
Matrix containing partial derivatives of rate of change of each substrate
void simulator.diffusionSolver.Solver_chemostat.init ( Simulator  aSimulator,
XMLParser  xmlRoot 
)

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

Parameters
aSimulatorThe current simulation object
xmlRootRoot element of XML tags containing chemostat related parameters
void simulator.diffusionSolver.Solver_chemostat.initializeConcentrationFields ( )
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

Parameters
t0Simulation time
rtolRelative tolerance of the calculated error
hmaxMaximum 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].

void simulator.diffusionSolver.Solver_chemostat.solveDiffusionReaction ( )
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)

Parameters
sInflowMatrix of solutes in flow
Returns
Updated matrix showing solute flow levels

Member Data Documentation

Domain simulator.diffusionSolver.Solver_chemostat._domain
protected

Computational domain that this solver is associated with

MultigridSolute [] simulator.diffusionSolver.Solver_chemostat._reactiveBiomass
protected

Array of reactive biomasses

SoluteGrid [] simulator.diffusionSolver.Solver_chemostat.allReac
protected

The solute grid of reaction rates for each solute.

SoluteGrid [] simulator.diffusionSolver.Solver_chemostat.allSolute
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().

double simulator.diffusionSolver.Solver_chemostat.d = 1.0 / (2.0 + Math.sqrt(2.0))
protected

Constant used by the ODE solvers

double simulator.diffusionSolver.Solver_chemostat.Dilution
protected

The chemostat dilution rate. This will be set when init() calls setDilutionAndY0()

double simulator.diffusionSolver.Solver_chemostat.e32 = 6.0 + Math.sqrt(2.0)
protected

Constant used by the ODE solvers

double simulator.diffusionSolver.Solver_chemostat.EPS = 2.22e-16
protected

The smallest positive floating-point number such that 1.0+EPS > 1.0

double simulator.diffusionSolver.Solver_chemostat.hmax
protected

Maximum internal step of the solver. Used in the ODE solver

Boolean [] simulator.diffusionSolver.Solver_chemostat.isConstSol
protected

Boolean stating whether the bulk concentration remains constant

int simulator.diffusionSolver.Solver_chemostat.nReaction
protected

Number of reactions in simulation

int simulator.diffusionSolver.Solver_chemostat.nSolute
protected

Number of solutes in simulation

double simulator.diffusionSolver.Solver_chemostat.power = 1.0/3.0
protected

Constant used by the ODE solvers

double simulator.diffusionSolver.Solver_chemostat.rtol
protected

Relative tolerance of the calculated error. Used in the ODE solver

ArrayList<Integer> simulator.diffusionSolver.Solver_chemostat.solReacInd = new ArrayList<Integer>()
protected

1D array of arraylists containing the list of reactions in which each of the solutes participates.

double [][] simulator.diffusionSolver.Solver_chemostat.soluteYield
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).

double simulator.diffusionSolver.Solver_chemostat.sqrtE = Math.sqrt(2.22e-16)
protected

Numerical accuracy for EPS (error per step)


The documentation for this class was generated from the following file: