Implementation of simulation solvers.
Class diagram for steps.solver namespace.
Each solver is a partial or full implementation of the STEPS solver API. At the moment STEPS implements three different solvers.
steps.solver.Wmrk4 implements a well-mixed, deterministic solver based on the Runge–Kutta method.
steps.solver.Wmdirect implements a stochastic, well-mixed solver based on Gillespie’s Direct SSA Method.
steps.solver.Tetexact implements a stochastic reaction-diffusion solver, based on Gillespie’s Direct SSA Method extended for diffusive fluxes between tetrahedral elements in complex geometries.
Construction:
sim = steps.solver.Wmrk4(model, geom, rng)
Create a well-mixed RK4 simulation solver.
Solver Information
Returns a string of the solver’s name.
Syntax:
getSolverName()
Returns a string giving a short description of the solver.
Syntax:
getSolverDesc()
Returns a string of the solver authors names.
Syntax:
getSolverAuthors()
Returns a string giving the author’s email address.
Syntax:
getSolverEmail()
Solver Control
Reset the simulation to the state the solver was initialised to. Typically, this resets all concentrations of all chemical species in all elements (whether compartments and patches in a well-mixed solver or tetrahedrons and triangles in a mesh-based solver) to zero, resets the simulation time to zero and resets reaction (and diffusion) rates to the default values described in the steps.model objects. All reaction (and diffusion) rules are reset to active and all compartment volumes and patch areas are reset to default values described in steps.geom objects (for well-mixed solvers). Usually, this method should be called before starting each simulation iteration.
Syntax:
reset()
Advance the simulation until endtime (given in seconds) is reached. The endtime must be larger or equal to the current simulation time.
Syntax:
run(endtime)
Advance the simulation for secs seconds.
Syntax:
advance(adv)
Advance the simulation for one ‘step’. In stochastic solvers this is one ‘realization’ of the Gillespie SSA (one reaction ‘event’). In numerical solvers (currently Wmrk4) this is one time-step, with the stepsize defined with the setDT method.
Syntax:
step()
Set the stepsize for numerical solvers. Must be called before running a simulation with these solvers (currently Wmrk4) since there is no default stepsize. The deterministic solver Wmrk4 implements a fixed stepsize (i.e. not adaptive), although the stepsize can be altered at any point during the simulation with this method.
Syntax:
setDT(dt)
Returns the stepsize for numerical solvers.
Syntax:
getDT()
Returns the current simulation time in seconds.
Syntax:
getTime()
Set the current simulation time.
Syntax:
setTime(time)
Compartment Data Access
Returns the volume of compartment with identifier string comp (in m^3).
Syntax:
getCompVol(comp)
Set the volume of compartment with identifier string comp (in m^3).
Syntax:
setCompVol(comp, vol)
Returns the number of molecules of a species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined count from all tetrahedral elements in the compartment.
Syntax:
getCompCount(comp, spec)
Set the number of molecules of a species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined count from all tetrahedral elements in the compartment.
Syntax:
setCompCount(comp, spec, nspec)
Returns the amount (in mols) of species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined amount from all tetrahedral elements in the compartment.
Syntax:
getCompAmount(comp, spec)
Set the amount (in mols) of species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined amount from all tetrahedral elements in the compartment.
Syntax:
setCompAmount(comp, spec, amount)
Returns the concentration (in Molar units) of species with identifier string spec in compartment with identifier string comp.
Note: in a mesh-based simulation (i.e. Tetexact) this is calculated from the combined number of molecules from all tetrahedral elements in the compartment and the total volume of the tetrahedrons.
Syntax:
getCompConc(comp, spec)
Sets the concentration (in Molar units) of species with identifier string spec in compartment with identifier string comp to conc. In a discrete solver the continuous concentration is converted to a discrete number of molecules.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all tetrahedral elements in the compartment (i.e. a uniform distribution).
Syntax:
setCompConc(comp, spec, conc)
Returns True if species with identifier string spec in compartment with identifier string comp is clamped (buffered), which means the concentration remains the same regardless of reactions that consume or produce molecules of this species. Returns False if not.
Note: in a mesh-based simulation (i.e. Tetexact) it returns True only if the species is clamped in all tetrahedral elements of the compartment.
Syntax:
getCompClamped(comp, spec)
Sets whether the concentration of species with identifier string spec in compartment with identifier string comp is clamped (clamped = True) or not (clamped = False). If a species is clamped the concentration stays the same regardless of reactions that consume or produce molecules of the species.
Note: in a mesh-based simulation (i.e. Tetexact) this will set the species to be clamped or not in all tetrahedral elements of the compartment.
Syntax:
setCompClamped(comp, spec, clamped)
Returns the macroscopic reaction constant of reaction with identifier string reac in compartment with identifier string comp. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) the value for the compartment is returned, although individual tetrahedral elements may have different values (set with setTetReacK).
Syntax:
getCompReacK(comp, reac)
Sets the macroscopic reaction constant of reaction with identifier string reac in compartment with identifier string comp to kf. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) this method sets the reaction constant in all tetrahedral elements of the compartment to kf
Note: The default value still comes from the steps.model description, so calling reset() will return the reaction constant to that value.
Syntax:
setCompReacK(comp, reac, kf)
Returns whether a reaction with identifier string reac in compartment with identifier string comp is active (True) or not (False). If it’s not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this method will return True only if the reaction is active in all tetrahedral elements in the compartment.
Syntax:
getCompReacActive(comp, reac)
Activate (active = True) or deactivate (active = False) a reaction with identifier string reac in compartment with identifier string comp. If a reaction is not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this will activate/deactivate the reaction in all tetrahedral elements in the compartment.
Syntax:
setCompReacActive(comp, reac, active)
Patch Data Access
Returns the area of patch with identifier string pat (in m^2).
Syntax:
getPatchArea(pat)
Sets the area of patch with identifier string pat to area a (in m^2).
Syntax:
setPatchArea(pat, area)
Returns the number of molecules of species with identifier string spec in patch with identifier string pat.Note: in a mesh-based simulation (i.e. Tetexact) this is the combined count from all triangular elements in the patch.
Syntax:
getPatchCount(pat, spec)
Sets the number of molecules of species with identifier string spec in patch with identifier string pat to n. Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
setPatchCount(pat, spec, n)
Returns the amount (in mols) of species with identifier string spec in patch with identifier string pat.
Note: in a mesh-based simulation (i.e. Tetexact) this is the combined amount from all triangular elements in the patch.
Syntax:
getPatchAmount(pat, spec)
Sets the amount (in mols) of species with identifier string spec in patch with identifier string pat to a. In a discrete solver, such as Wmdirect and Tetexact, this continuous value is converted internally into a discrete number of molecules by multiplication with Avogadro’s number.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
setPatchAmount(pat, spec, a)
Sets the amount (in mols) of species with identifier string spec in patch with identifier string pat to a. In a discrete solver, such as Wmdirect and Tetexact, this continuous value is converted internally into a discrete number of molecules by multiplication with Avogadro’s number.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
getPatchClamped(pat, spec)
Sets whether the species with identifier string spec in patch with identifier string pat is clamped (clamped = True) or not (clamped = False). If a species is clamped the number of molecules stays the same regardless of surface reactions that consume or produce molecules of the species.
Note: in a mesh-based simulation this will set the species to be clamped in all triangular elements of the patch.
Syntax:
setPatchClamped(pat, spec, clamped)
Returns the macroscopic reaction constant of surface reaction with identifier string sreac in patch with identifier string pat. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based solver (i.e. Tetexact) the value for the patch is returned, although individual triangle elements may have different values (set with setTriSReacK).
Syntax:
getPatchSReacK(pat, reac)
Sets the macroscopic reaction constant of surface reaction with identifier string sreac in patch with identifier string pat to kf. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) this method sets the surface reaction constant in all triangular elements of the patch to kf.
Note: The default value still comes from the steps.model description, so calling reset() will return the surface reaction constant to that value.
Syntax:
setPatchSReacK(pat, reac, kf)
Returns whether a surface reaction with identifier string sreac in patch with identifier string pat is active (True) or not (False). If it’s not active this means that a surface reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this method will return True only if the surface reaction is active in all triangular elements in the patch.
Syntax:
getPatchSReacActive(pat, reac)
Activate (active = True) or deactivate (active = False) a surface reaction with identifier string sreac in patch with identifier string pat. If a surface reaction is not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this will activate/ deactivate the reaction in all triangular elements in the patch.
Syntax:
setPatchSReacActive(pat, reac, active)
Construction:
sim = steps.solver.Wmdirect(model, geom, rng)
Create a well-mixed Direct SSA simulation solver.
Solver Information
Returns a string of the solver’s name.
Syntax:
getSolverName()
Returns a string giving a short description of the solver.
Syntax:
getSolverDesc()
Returns a string of the solver authors names.
Syntax:
getSolverAuthors()
Returns a string giving the author’s email address.
Syntax:
getSolverEmail()
Solver Control
Reset the simulation to the state the solver was initialised to. Typically, this resets all concentrations of all chemical species in all elements (whether compartments and patches in a well-mixed solver or tetrahedrons and triangles in a mesh-based solver) to zero, resets the simulation time to zero and resets reaction (and diffusion) rates to the default values described in the steps.model objects. All reaction (and diffusion) rules are reset to active and all compartment volumes and patch areas are reset to default values described in steps.geom objects (for well-mixed solvers). Usually, this method should be called before starting each simulation iteration.
Syntax:
reset()
Advance the simulation for one ‘step’. In stochastic solvers this is one ‘realization’ of the Gillespie SSA (one reaction ‘event’). In numerical solvers (currently Wmrk4) this is one time-step, with the stepsize defined with the setDT method.
Syntax:
step()
Returns the current simulation time in seconds.
Syntax:
getTime()
Set the current simulation time.
Syntax:
setTime(time)
Returns the total propensity of the current simulation state (the total propensity multiplied by an infinitesimally small time dt gives the probability that a reaction will occur in that dt). For Tetexact this includes the propensity from the extension of the SSA for diffusive flux between tetrahedral elements in the mesh.
Syntax:
getA0()
Return the number of ‘realizations’ of the SSA, the number of reaction (and diffusion) events in stochastic solvers.
Syntax:
getNSteps()
Set the number of ‘realizations’ of the SSA, the number of reaction (and diffusion) events in stochastic solvers.
Syntax:
setNSteps(nsteps)
Compartment Data Access
Returns the volume of compartment with identifier string comp (in m^3).
Syntax:
getCompVol(comp)
Set the volume of compartment with identifier string comp (in m^3).
Syntax:
setCompVol(comp, vol)
Returns the number of molecules of a species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined count from all tetrahedral elements in the compartment.
Syntax:
getCompCount(comp, spec)
Set the number of molecules of a species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined count from all tetrahedral elements in the compartment.
Syntax:
setCompCount(comp, spec, nspec)
Returns the amount (in mols) of species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined amount from all tetrahedral elements in the compartment.
Syntax:
getCompAmount(comp, spec)
Set the amount (in mols) of species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined amount from all tetrahedral elements in the compartment.
Syntax:
setCompAmount(comp, spec, amount)
Returns the concentration (in Molar units) of species with identifier string spec in compartment with identifier string comp.
Note: in a mesh-based simulation (i.e. Tetexact) this is calculated from the combined number of molecules from all tetrahedral elements in the compartment and the total volume of the tetrahedrons.
Syntax:
getCompConc(comp, spec)
Sets the concentration (in Molar units) of species with identifier string spec in compartment with identifier string comp to conc. In a discrete solver the continuous concentration is converted to a discrete number of molecules.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all tetrahedral elements in the compartment (i.e. a uniform distribution).
Syntax:
setCompConc(comp, spec, conc)
Returns True if species with identifier string spec in compartment with identifier string comp is clamped (buffered), which means the concentration remains the same regardless of reactions that consume or produce molecules of this species. Returns False if not.
Note: in a mesh-based simulation (i.e. Tetexact) it returns True only if the species is clamped in all tetrahedral elements of the compartment.
Syntax:
getCompClamped(comp, spec)
Sets whether the concentration of species with identifier string spec in compartment with identifier string comp is clamped (clamped = True) or not (clamped = False). If a species is clamped the concentration stays the same regardless of reactions that consume or produce molecules of the species.
Note: in a mesh-based simulation (i.e. Tetexact) this will set the species to be clamped or not in all tetrahedral elements of the compartment.
Syntax:
setCompClamped(comp, spec, clamped)
Returns the macroscopic reaction constant of reaction with identifier string reac in compartment with identifier string comp. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) the value for the compartment is returned, although individual tetrahedral elements may have different values (set with setTetReacK).
Syntax:
getCompReacK(comp, reac)
Sets the macroscopic reaction constant of reaction with identifier string reac in compartment with identifier string comp to kf. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) this method sets the reaction constant in all tetrahedral elements of the compartment to kf
Note: The default value still comes from the steps.model description, so calling reset() will return the reaction constant to that value.
Syntax:
setCompReacK(comp, reac, kf)
Returns whether a reaction with identifier string reac in compartment with identifier string comp is active (True) or not (False). If it’s not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this method will return True only if the reaction is active in all tetrahedral elements in the compartment.
Syntax:
getCompReacActive(comp, reac)
Activate (active = True) or deactivate (active = False) a reaction with identifier string reac in compartment with identifier string comp. If a reaction is not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this will activate/deactivate the reaction in all tetrahedral elements in the compartment.
Syntax:
setCompReacActive(comp, reac, active)
Returns the ‘stochastic reaction constant’ (or ‘specific probability rate constant’) of reaction with identifier string reac in compartment with identifier string comp.
The ‘stochastic reaction constant’ multiplied by infinitesimal time interval dt gives the average probability that one reaction channel of this reaction type will react accordingly in dt.
Note: in a mesh-based simulation (i.e. Tetexact), the stochastic reaction constant is computed as the weighted mean of the stochastic reaction constants in all tetrahedral elements of the compartment.
Syntax:
getCompReacC(comp, reac)
Returns h_mu, the distinct number of ways in which reaction with identifier string reac can occur in compartment with identifier string comp, by computing the product of its reactants. Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the h_mu’s over all tetrahedral elements in the compartment.
Syntax:
getCompReacH(comp, reac)
Returns the propensity of reaction with identifier string reac in compartment with identifier string comp.
The propensity of a reaction is a function of state and is defined as the function whose product with infinitesimal time dt gives the probability that the reaction will occur in the next dt. It is the ‘stochastic reaction constant’ multiplied by ‘h_mu’.
Note: in a mesh-based simulation (i.e. Tetexact), the propensity of a reaction in a compartment is computed as the sum of the propensities in all tetrahedral elements of the compartment.
Syntax:
getCompReacA(comp, reac)
Return the extent of reaction with identifier string reac in compartment with identifier string comp, that is the number of times the reaction has occurred up to the current simulation time.
Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the reaction extents in all tetrahedral elements of the compartment.
Syntax:
getCompReacExtent(comp, reac)
Resets the extent of reaction with identifier string reac in compartment with identifier string comp to zero.
Note: in a mesh-based simulation (i.e. Tetexact), resets the extents of the reaction in all tetrahedral elements of the compartment.
Syntax:
resetCompReacExtent(comp, reac)
Patch Data Access
Returns the area of patch with identifier string pat (in m^2).
Syntax:
getPatchArea(pat)
Sets the area of patch with identifier string pat to area a (in m^2).
Syntax:
setPatchArea(pat, area)
Returns the number of molecules of species with identifier string spec in patch with identifier string pat.Note: in a mesh-based simulation (i.e. Tetexact) this is the combined count from all triangular elements in the patch.
Syntax:
getPatchCount(pat, spec)
Sets the number of molecules of species with identifier string spec in patch with identifier string pat to n. Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
setPatchCount(pat, spec, n)
Returns the amount (in mols) of species with identifier string spec in patch with identifier string pat.
Note: in a mesh-based simulation (i.e. Tetexact) this is the combined amount from all triangular elements in the patch.
Syntax:
getPatchAmount(pat, spec)
Sets the amount (in mols) of species with identifier string spec in patch with identifier string pat to a. In a discrete solver, such as Wmdirect and Tetexact, this continuous value is converted internally into a discrete number of molecules by multiplication with Avogadro’s number.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
setPatchAmount(pat, spec, a)
Sets the amount (in mols) of species with identifier string spec in patch with identifier string pat to a. In a discrete solver, such as Wmdirect and Tetexact, this continuous value is converted internally into a discrete number of molecules by multiplication with Avogadro’s number.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
getPatchClamped(pat, spec)
Sets whether the species with identifier string spec in patch with identifier string pat is clamped (clamped = True) or not (clamped = False). If a species is clamped the number of molecules stays the same regardless of surface reactions that consume or produce molecules of the species.
Note: in a mesh-based simulation this will set the species to be clamped in all triangular elements of the patch.
Syntax:
setPatchClamped(pat, spec, clamped)
Returns the macroscopic reaction constant of surface reaction with identifier string sreac in patch with identifier string pat. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based solver (i.e. Tetexact) the value for the patch is returned, although individual triangle elements may have different values (set with setTriSReacK).
Syntax:
getPatchSReacK(pat, reac)
Sets the macroscopic reaction constant of surface reaction with identifier string sreac in patch with identifier string pat to kf. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) this method sets the surface reaction constant in all triangular elements of the patch to kf.
Note: The default value still comes from the steps.model description, so calling reset() will return the surface reaction constant to that value.
Syntax:
setPatchSReacK(pat, reac, kf)
Returns whether a surface reaction with identifier string sreac in patch with identifier string pat is active (True) or not (False). If it’s not active this means that a surface reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this method will return True only if the surface reaction is active in all triangular elements in the patch.
Syntax:
getPatchSReacActive(pat, reac)
Activate (active = True) or deactivate (active = False) a surface reaction with identifier string sreac in patch with identifier string pat. If a surface reaction is not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this will activate/ deactivate the reaction in all triangular elements in the patch.
Syntax:
setPatchSReacActive(pat, reac, active)
Returns the ‘stochastic reaction constant’ (or ‘specific probability rate constant’) of surface reaction with identifier string sreac in patch with identifier string pat.
Note: in a mesh-based simulation (i.e. Tetexact), the stochastic reaction constant is computed as the weighted mean of the stochastic reaction constants in all triangular elements of the patch.
Syntax:
getPatchSReacC(pat, reac)
Returns h_mu, the distinct number of ways in which surface reaction with identifier string sreac can occur in patch with identifier string pat, by computing the product of its reactants. Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the h_mu’s over all triangular elements in the patch.
Syntax:
getPatchSReacH(pat, reac)
Returns the propensity of surface reaction with identifier string sreac in patch with identifier string pat. Note: in a mesh-based simulation (i.e. Tetexact), the propensity of a surface reaction in a patch is computed as the sum of the propensities in all triangular elements of the patch.
Syntax:
getPatchSReacA(pat, reac)
Returns the extent of surface reaction with identifier string sreac in patch with identifier string pat, that is the number of times the surface reaction has occurred up to the current simulation time.
Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the reaction extents in all triangular elements of the patch.
Syntax:
getPatchSReacExtent(pat,reac)
Resets the extent of reaction with identifier string sreac in patch with identifier string pat to zero.
Note: in a mesh-based simulation (i.e. Tetexact), resets the extents of the reaction in all triangular elements of the patch.
Syntax:
resetPatchSReacExtent(pat, reac)
Construction:
sim = steps.solver.Tetexact(model, mesh, rng)
Create a tetrahedral mesh-based Direct SSA simulation solver.
Solver Information
Returns a string of the solver’s name.
Syntax:
getSolverName()
Returns a string giving a short description of the solver.
Syntax:
getSolverDesc()
Returns a string of the solver authors names.
Syntax:
getSolverAuthors()
Returns a string giving the author’s email address.
Syntax:
getSolverEmail()
Solver Control
Reset the simulation to the state the solver was initialised to. Typically, this resets all concentrations of all chemical species in all elements (whether compartments and patches in a well-mixed solver or tetrahedrons and triangles in a mesh-based solver) to zero, resets the simulation time to zero and resets reaction (and diffusion) rates to the default values described in the steps.model objects. All reaction (and diffusion) rules are reset to active and all compartment volumes and patch areas are reset to default values described in steps.geom objects (for well-mixed solvers). Usually, this method should be called before starting each simulation iteration.
Syntax:
reset()
Advance the simulation for one ‘step’. In stochastic solvers this is one ‘realization’ of the Gillespie SSA (one reaction ‘event’). In numerical solvers (currently Wmrk4) this is one time-step, with the stepsize defined with the setDT method.
Syntax:
step()
Returns the current simulation time in seconds.
Syntax:
getTime()
Set the current simulation time.
Syntax:
setTime(time)
Returns the total propensity of the current simulation state (the total propensity multiplied by an infinitesimally small time dt gives the probability that a reaction will occur in that dt). For Tetexact this includes the propensity from the extension of the SSA for diffusive flux between tetrahedral elements in the mesh.
Syntax:
getA0()
Return the number of ‘realizations’ of the SSA, the number of reaction (and diffusion) events in stochastic solvers.
Syntax:
getNSteps()
Set the number of ‘realizations’ of the SSA, the number of reaction (and diffusion) events in stochastic solvers.
Syntax:
setNSteps(nsteps)
Compartment Data Access
Returns the volume of compartment with identifier string comp (in m^3).
Syntax:
getCompVol(comp)
Returns the number of molecules of a species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined count from all tetrahedral elements in the compartment.
Syntax:
getCompCount(comp, spec)
Set the number of molecules of a species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined count from all tetrahedral elements in the compartment.
Syntax:
setCompCount(comp, spec, nspec)
Returns the amount (in mols) of species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined amount from all tetrahedral elements in the compartment.
Syntax:
getCompAmount(comp, spec)
Set the amount (in mols) of species with identifier string spec in compartment with identifier string comp.
In a mesh-based simulation (i.e. Tetexact) this is the combined amount from all tetrahedral elements in the compartment.
Syntax:
setCompAmount(comp, spec, amount)
Returns the concentration (in Molar units) of species with identifier string spec in compartment with identifier string comp.
Note: in a mesh-based simulation (i.e. Tetexact) this is calculated from the combined number of molecules from all tetrahedral elements in the compartment and the total volume of the tetrahedrons.
Syntax:
getCompConc(comp, spec)
Sets the concentration (in Molar units) of species with identifier string spec in compartment with identifier string comp to conc. In a discrete solver the continuous concentration is converted to a discrete number of molecules.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all tetrahedral elements in the compartment (i.e. a uniform distribution).
Syntax:
setCompConc(comp, spec, conc)
Returns True if species with identifier string spec in compartment with identifier string comp is clamped (buffered), which means the concentration remains the same regardless of reactions that consume or produce molecules of this species. Returns False if not.
Note: in a mesh-based simulation (i.e. Tetexact) it returns True only if the species is clamped in all tetrahedral elements of the compartment.
Syntax:
getCompClamped(comp, spec)
Sets whether the concentration of species with identifier string spec in compartment with identifier string comp is clamped (clamped = True) or not (clamped = False). If a species is clamped the concentration stays the same regardless of reactions that consume or produce molecules of the species.
Note: in a mesh-based simulation (i.e. Tetexact) this will set the species to be clamped or not in all tetrahedral elements of the compartment.
Syntax:
setCompClamped(comp, spec, clamped)
Returns the macroscopic reaction constant of reaction with identifier string reac in compartment with identifier string comp. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) the value for the compartment is returned, although individual tetrahedral elements may have different values (set with setTetReacK).
Syntax:
getCompReacK(comp, reac)
Sets the macroscopic reaction constant of reaction with identifier string reac in compartment with identifier string comp to kf. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) this method sets the reaction constant in all tetrahedral elements of the compartment to kf
Note: The default value still comes from the steps.model description, so calling reset() will return the reaction constant to that value.
Syntax:
setCompReacK(comp, reac, kf)
Returns whether a reaction with identifier string reac in compartment with identifier string comp is active (True) or not (False). If it’s not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this method will return True only if the reaction is active in all tetrahedral elements in the compartment.
Syntax:
getCompReacActive(comp, reac)
Activate (active = True) or deactivate (active = False) a reaction with identifier string reac in compartment with identifier string comp. If a reaction is not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this will activate/deactivate the reaction in all tetrahedral elements in the compartment.
Syntax:
setCompReacActive(comp, reac, active)
Returns the diffusion constant of diffusion rule with identifier string diff in compartment with identifier string comp. This constant is in units m^2/s.
Note: In a mesh-based solver (i.e. Tetexact) the value for the compartment is returned, although individual or groups of tetrahedral elements may have different values (set with setTetDiffD).
Syntax:
getCompDiffD(comp, diff)
Sets the diffusion constant of diffusion rule with identifier string diff in compartment with identifier string comp to dcst (in m^2/s).
Note: This method will set the diffusion constant in all tetrahedral elements in the compartment.
Note: The default value still comes from the steps.model description, so calling reset() will return the diffusion constants to that value.
Syntax:
setCompDiffD(comp, diff, dcst)
Returns whether a diffusion rule with identifier string diff in compartment with identifier string comp is active (True) or not (False). If diffusion of a species is inactive this means the molecules will remain in place and has the same effect as a diffusion constant of zero.
Syntax:
getCompDiffActive(comp, diff)
Activate (active = True) or deactivate (active = False) a diffusion rule with identifier string diff in compartment with identifier string comp. If diffusion of a species is inactive this means the molecules will remain in place and is effectively the same as setting the diffusion constant to zero
Syntax:
setCompDiffActive(comp, diff, active)
Returns the ‘stochastic reaction constant’ (or ‘specific probability rate constant’) of reaction with identifier string reac in compartment with identifier string comp.
The ‘stochastic reaction constant’ multiplied by infinitesimal time interval dt gives the average probability that one reaction channel of this reaction type will react accordingly in dt.
Note: in a mesh-based simulation (i.e. Tetexact), the stochastic reaction constant is computed as the weighted mean of the stochastic reaction constants in all tetrahedral elements of the compartment.
Syntax:
getCompReacC(comp, reac)
Returns h_mu, the distinct number of ways in which reaction with identifier string reac can occur in compartment with identifier string comp, by computing the product of its reactants. Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the h_mu’s over all tetrahedral elements in the compartment.
Syntax:
getCompReacH(comp, reac)
Returns the propensity of reaction with identifier string reac in compartment with identifier string comp.
The propensity of a reaction is a function of state and is defined as the function whose product with infinitesimal time dt gives the probability that the reaction will occur in the next dt. It is the ‘stochastic reaction constant’ multiplied by ‘h_mu’.
Note: in a mesh-based simulation (i.e. Tetexact), the propensity of a reaction in a compartment is computed as the sum of the propensities in all tetrahedral elements of the compartment.
Syntax:
getCompReacA(comp, reac)
Return the extent of reaction with identifier string reac in compartment with identifier string comp, that is the number of times the reaction has occurred up to the current simulation time.
Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the reaction extents in all tetrahedral elements of the compartment.
Syntax:
getCompReacExtent(comp, reac)
Resets the extent of reaction with identifier string reac in compartment with identifier string comp to zero.
Note: in a mesh-based simulation (i.e. Tetexact), resets the extents of the reaction in all tetrahedral elements of the compartment.
Syntax:
resetCompReacExtent(comp, reac)
Patch Data Access
Returns the area of patch with identifier string pat (in m^2).
Syntax:
getPatchArea(pat)
Returns the number of molecules of species with identifier string spec in patch with identifier string pat.Note: in a mesh-based simulation (i.e. Tetexact) this is the combined count from all triangular elements in the patch.
Syntax:
getPatchCount(pat, spec)
Sets the number of molecules of species with identifier string spec in patch with identifier string pat to n. Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
setPatchCount(pat, spec, n)
Returns the amount (in mols) of species with identifier string spec in patch with identifier string pat.
Note: in a mesh-based simulation (i.e. Tetexact) this is the combined amount from all triangular elements in the patch.
Syntax:
getPatchAmount(pat, spec)
Sets the amount (in mols) of species with identifier string spec in patch with identifier string pat to a. In a discrete solver, such as Wmdirect and Tetexact, this continuous value is converted internally into a discrete number of molecules by multiplication with Avogadro’s number.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
setPatchAmount(pat, spec, a)
Sets the amount (in mols) of species with identifier string spec in patch with identifier string pat to a. In a discrete solver, such as Wmdirect and Tetexact, this continuous value is converted internally into a discrete number of molecules by multiplication with Avogadro’s number.
Note: in a mesh-based simulation (i.e. Tetexact) the molecules are divided as equally as possible over all triangular elements in the patch (i.e. a uniform distribution).
Syntax:
getPatchClamped(pat, spec)
Sets whether the species with identifier string spec in patch with identifier string pat is clamped (clamped = True) or not (clamped = False). If a species is clamped the number of molecules stays the same regardless of surface reactions that consume or produce molecules of the species.
Note: in a mesh-based simulation this will set the species to be clamped in all triangular elements of the patch.
Syntax:
setPatchClamped(pat, spec, clamped)
Returns the macroscopic reaction constant of surface reaction with identifier string sreac in patch with identifier string pat. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based solver (i.e. Tetexact) the value for the patch is returned, although individual triangle elements may have different values (set with setTriSReacK).
Syntax:
getPatchSReacK(pat, reac)
Sets the macroscopic reaction constant of surface reaction with identifier string sreac in patch with identifier string pat to kf. The unit of the reaction constant depends on the order of the reaction.
Note: In a mesh-based simulation (i.e. Tetexact) this method sets the surface reaction constant in all triangular elements of the patch to kf.
Note: The default value still comes from the steps.model description, so calling reset() will return the surface reaction constant to that value.
Syntax:
setPatchSReacK(pat, reac, kf)
Returns whether a surface reaction with identifier string sreac in patch with identifier string pat is active (True) or not (False). If it’s not active this means that a surface reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this method will return True only if the surface reaction is active in all triangular elements in the patch.
Syntax:
getPatchSReacActive(pat, reac)
Activate (active = True) or deactivate (active = False) a surface reaction with identifier string sreac in patch with identifier string pat. If a surface reaction is not active this means that a reaction will never occur regardless of whether the reactants are present in sufficient numbers or not.
Note: In a mesh-based simulation (i.e. Tetexact) this will activate/ deactivate the reaction in all triangular elements in the patch.
Syntax:
setPatchSReacActive(pat, reac, active)
Returns the ‘stochastic reaction constant’ (or ‘specific probability rate constant’) of surface reaction with identifier string sreac in patch with identifier string pat.
Note: in a mesh-based simulation (i.e. Tetexact), the stochastic reaction constant is computed as the weighted mean of the stochastic reaction constants in all triangular elements of the patch.
Syntax:
getPatchSReacC(pat, reac)
Returns h_mu, the distinct number of ways in which surface reaction with identifier string sreac can occur in patch with identifier string pat, by computing the product of its reactants. Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the h_mu’s over all triangular elements in the patch.
Syntax:
getPatchSReacH(pat, reac)
Returns the propensity of surface reaction with identifier string sreac in patch with identifier string pat. Note: in a mesh-based simulation (i.e. Tetexact), the propensity of a surface reaction in a patch is computed as the sum of the propensities in all triangular elements of the patch.
Syntax:
getPatchSReacA(pat, reac)
Returns the extent of surface reaction with identifier string sreac in patch with identifier string pat, that is the number of times the surface reaction has occurred up to the current simulation time.
Note: in a mesh-based simulation (i.e. Tetexact), returns the sum of the reaction extents in all triangular elements of the patch.
Syntax:
getPatchSReacExtent(pat,reac)
Resets the extent of reaction with identifier string sreac in patch with identifier string pat to zero.
Note: in a mesh-based simulation (i.e. Tetexact), resets the extents of the reaction in all triangular elements of the patch.
Syntax:
resetPatchSReacExtent(pat, reac)
Tetrahedral Data Access
Returns the volume (in m^3) of the tetrahedral element with index idx.
Syntax:
getTetVol(idx)
Returns the number of molecules of species with identifier string spec in the tetrahedral element with index idx.
Syntax:
getTetCount(idx, spec)
Sets the number of molecules of species with identifier string spec in tetrahedral element with index idx to n.
Syntax:
setTetCount(idx, spec, n)
Returns the amount (in mols) of species with identifier string spec in tetrahedral element with index idx.
Syntax:
getTetAmount(idx, spec)
Sets the amount (in mols) of species with identifier string spec in tetrahedral element with index idx to a. This continuous value must be converted internally to a discrete number of molecules by multiplication with Avogadro’s number.
Due to the small volumes of tetrahedral elements the difference between ‘rounding up’ and ‘rounding down’ can be a significant difference in concentration.
Syntax:
setTetAmount(idx, spec, a)
Returns the concentration (in Molar units) of species with identifier string spec in a tetrahedral element with index idx.
Syntax:
getTetConc(idx, spec)
Sets the concentration (in Molar units) of species with identifier string spec in a tetrahedral element with index idx to conc.This continuous value must be converted internally to a discrete number of molecules.
Due to the small volumes of tetrahedral elements the difference between ‘rounding up’ and ‘rounding down’ can be a large difference in concentration.
Syntax:
setTetConc(idx, spec, conc)
Returns True if concentration of species with identifier string spec in tetrahedral element with index idx is clamped (buffered), which means the concentration stays the same regardless of reactions that consume or produce molecules of this species or diffusion of this species into or out of the tetrahedral element. Returns False if not.
Syntax:
getTetClamped(idx, spec)
Sets whether the concentration of species spec in tetrahedral element with index idx is clamped (clamped = True) or not (clamped = False). If a species is clamped the concentration stays the same regardless of reactions that consume or produce molecules of the species or diffusion of the species into or out of the tetrahedral element.
Syntax:
setTetClamped(idx, spec, clamped)
Returns the macroscopic reaction constant of reaction with identifier string reac in tetrahedral element with index idx. The unit of the reaction constant depends on the order of the reaction.
Syntax:
getTetReacK(idx, reac)
Sets the macroscopic reaction constant of reaction with identifier string reac in tetrahedral element with index idx to kf. The units of the reaction constant depends on the order of the reaction.
Syntax:
setTetReacK(idx, reac, kf)
Returns whether reaction with identifier string reac in tetrahedral element with index idx is active (True) or not (False). If it’s not active this means that the reaction will never occur regardless of whether reactants are present in sufficient numbers or not.
Syntax:
getTetReacActive(idx, reac)
Activate (active = True) or deactivate (active = False) a reaction with identifier string reac in tetrahedral element with index idx. If it’s not active this means that the reaction will never occur regardless of whether reactants are present in sufficient numbers or not.
Syntax:
setTetReacActive(idx, reac, active)
Returns the diffusion constant of diffusion rule with identifier string diff in tetrahedral element with index idx. This constant is in units m^2/s.
Syntax:
getTetDiffD(idx, diff)
Sets the diffusion constant of diffusion rule with identifier string diff in tetrahedral element with index idx to dcst (in m^2/s).
Syntax:
setTetDiffD(idx, diff, dcst)
Returns whether diffusion with identifier string diff in tetrahedral element with index idx is active (True) or not (False). If diffusion of a species is inactive this means the molecules will never diffuse out of the tetrahedron and has the same effect as a diffusion constant of zero.
Syntax:
getTetDiffActive(idx, diff)
Activate (active = True) or deactivate (active = False) diffusion rule with identifier string diff in tetrahedral element with index idx. If diffusion of a species is inactive this means the molecules will never diffuse out of the tetrahedron and has the same effect as a diffusion constant of zero.
Syntax:
setTetDiffActive(idx, diff, active)
Returns the ‘stochastic reaction constant’ (or ‘specific probability rate constant’) of reaction with identifier string reac in tetrahedral element with index idx.
Syntax:
getTetReacC(idx, reac)
Returns h_mu, the distinct number of ways in which reaction with identifier string reac can occur in tetrahedral element with index idx, by computing the product of its reactants.
Syntax:
getTetReacH(idx, reac)
Returns the propensity of reaction with identifier string reac in tetrahedral element with index idx.
Syntax:
getTetReacA(idx, reac)
Returns the propensityof diffusion rule with identifier string diff in tetrahedral element with index idx.
Syntax:
getTetDiffA(idx, reac)
Triangular Data Access
Returns the area (in m^2) of the triangular element with index idx.
Syntax:
getTriArea(idx)
Returns the number of molecules of species with identifier string spec in the triangular element with index idx.
Syntax:
getTriCount(idx, spec)
Sets the number of molecules of species with identifier string spec in triangular element with index idx to n.
Syntax:
setTriCount(idx, spec, n)
Returns the amount (in mols) of species with identifier string spec in triangular element with index idx.
Syntax:
getTriAmount(idx, spec)
Sets the amount (in mols) of species with identifier string spec in triangular element with index idx to a. This continuous value must be converted internally to a discrete number of molecules by multiplication with Avogadro’s number.
Syntax:
setTriAmount(idx, spec, a)
Returns True if the species with identifier string spec in triangular element with index idx is clamped (buffered), which means the number of molecules stays the same regardless of reactions that consume or produce molecules of this species. Returns False if not.
Syntax:
getTriClamped(idx, spec)
Sets whether the concentration of species spec in triangular element with index idx is clamped (clamped = True) or not (clamped = False). If a species is clamped the concentration stays the same regardless of reactions that consume or produce molecules of the species.
Syntax:
setTriClamped(idx, spec, clamped)
Returns the macroscopic reaction constant of surface reaction with identifier string sreac in triangular element with index idx. The units of the reaction constant depends on the order of the reaction.
Syntax:
getTriSReacK(idx, reac)
Sets the macroscopic reaction constant of surface reaction with identifier string sreac in triangular element with index idx to kf. The units of the reaction constant depends on the order of the reaction.
Syntax:
setTriSReacK(idx, reac, kf)
Returns whether surface reaction with identifier string sreac in triangular element with index idx is active (True) or not (False). If it’s not active this means that the surface reaction will never occur regardless of whether reactants are present in sufficient numbers or not.
Syntax:
getTriSReacActive(idx, reac)
Activate (active = True) or deactivate (active = False) a surface reaction with identifier string sreac in triangular element with index idx. If it’s not active this means that the surface reaction will never occur regardless of whether reactants are present in sufficient numbers or not.
Syntax:
setTriSReacActive(idx, reac, active)
Returns the ‘stochastic reaction constant’ (or ‘specific probability rate constant’) of surface reaction with identifier string sreac in triangular element with index idx.
Syntax:
getTriSReacC(idx, reac)
Returns h_mu, the distinct number of ways in which surface reaction with identifier string sreac can occur in triangular element with index idx, by computing the product of its reactants.
Syntax:
getTriSReacH(idx, reac)
Returns the propensity of surface reaction with identifier string sreac in triangular element with index idx.
Syntax:
getTriSReacA(idx, reac)