# rmgpy.solver.SimpleReactor¶

class rmgpy.solver.SimpleReactor(T, P, initialMoleFractions, termination, sensitiveSpecies=None, sensitivityThreshold=0.001)

A reaction system consisting of a homogeneous, isothermal, isobaric batch reactor. These assumptions allow for a number of optimizations that enable this solver to complete very rapidly, even for large kinetic models.

Keq

Keq: numpy.ndarray

P

P: rmgpy.quantity.ScalarQuantity

T

T: rmgpy.quantity.ScalarQuantity

V

V: ‘double’

addReactionsToSurface(self, list newSurfaceReactions, list newSurfaceReactionInds, list surfaceSpecies, list surfaceReactions, list edgeSpecies)

moves new surface reactions to the surface done after the while loop before the simulate call ends

advance()

Simulate from the current value of the independent variable to a specified value tout, taking as many steps as necessary. The resulting values of $$t$$, $$\mathbf{y}$$, and $$\frac{d \mathbf{y}}{dt}$$ can then be accessed via the t, y, and dydt attributes.

atol_array

atol_array: numpy.ndarray

bimolecularThreshold

bimolecularThreshold: numpy.ndarray

calculate_effective_pressure(self, rxn)
Computes the effective pressure for a reaction as:
Peff = P * sum(yi * effi / sum(y))
with:
• P the pressure of the reactor,
• y the array of initial moles of the core species
or as:
Peff = P * y_specificCollider / sum(y)

System Message: WARNING/2 (docstring of rmgpy.solver.SimpleReactor.calculate_effective_pressure, line 8)

Definition list ends without a blank line; unexpected unindent.

if a secificCollider is mentioned

colliderEfficiencies

colliderEfficiencies: numpy.ndarray

computeRateDerivative(self)

Returns derivative vector df/dk_j where dy/dt = f(y, t, k) and k_j is the rate parameter for the jth core reaction.

compute_network_variables(self, pdepNetworks=None)

Initialize the arrays containing network information:

• NetworkLeakCoefficients is a n x 1 array with
n the number of pressure-dependent networks.
• NetworkIndices is a n x 3 matrix with
n the number of pressure-dependent networks and 3 the maximum number of molecules allowed in either the reactant or product side of a reaction.
constantVolume

constantVolume: ‘bool’

convertInitialKeysToSpeciesObjects(self, speciesDict)

Convert the initialMoleFractions dictionary from species names into species objects, using the given dictionary of species.

coreReactionRates

coreReactionRates: numpy.ndarray

coreSpeciesConcentrations

coreSpeciesConcentrations: numpy.ndarray

coreSpeciesConsumptionRates

coreSpeciesConsumptionRates: numpy.ndarray

coreSpeciesProductionRates

coreSpeciesProductionRates: numpy.ndarray

coreSpeciesRates

coreSpeciesRates: numpy.ndarray

dydt0

dydt0: numpy.ndarray

edgeReactionRates

edgeReactionRates: numpy.ndarray

edgeSpeciesRates

edgeSpeciesRates: numpy.ndarray

generate_rate_coefficients(self, coreReactions, edgeReactions)

Populates the forward rate coefficients (kf), reverse rate coefficients (kb) and equilibrium constants (Keq) arrays with the values computed at the temperature and (effective) pressure of the reaction system.

generate_reactant_product_indices(self, coreReactions, edgeReactions)

Creates a matrix for the reactants and products.

generate_reaction_indices(self, coreReactions, edgeReactions)

Assign an index to each reaction (core first, then edge) and store the (reaction, index) pair in a dictionary.

generate_species_indices(self, coreSpecies, edgeSpecies)

Assign an index to each species (core first, then edge) and store the (species, index) pair in a dictionary.

get_species_index(self, spc)

Retrieves the index that is associated with the parameter species from the species index dictionary.

initialMoleFractions

initialMoleFractions: dict

initialize()

Initialize the DASPK solver by setting the initial values of the independent variable t0, dependent variables y0, and first derivatives dydt0. If provided, the derivatives must be consistent with the other initial conditions; if not provided, DASPK will attempt to estimate a consistent set of initial values for the derivatives. You can also set the absolute and relative tolerances atol and rtol, respectively, either as single values for all dependent variables or individual values for each dependent variable.

initializeModel(self, list coreSpecies, list coreReactions, list edgeSpecies, list edgeReactions, list surfaceSpecies=None, list surfaceReactions=None, list pdepNetworks=None, atol=1e-16, rtol=1e-08, sensitivity=False, sens_atol=1e-06, sens_rtol=0.0001, filterReactions=False)

Initialize a simulation of the simple reactor using the provided kinetic model.

initialize_solver(self)
initialize_surface(self, list coreSpecies, list coreReactions, list surfaceSpecies, list surfaceReactions)
removes surfaceSpecies and surfaceReactions from until they are self consistent:
1. every reaction has one species in the surface
2. every species participates in a surface reaction
initiate_tolerances(self, atol=1e-16, rtol=1e-08, sensitivity=False, sens_atol=1e-06, sens_rtol=0.0001)

Computes the number of differential equations and initializes the tolerance arrays.

jacobian(self, double t, ndarray y, ndarray dydt, double cj, ndarray senpar=<???>)

Return the analytical Jacobian for the reaction system.

jacobianMatrix

jacobianMatrix: numpy.ndarray

kb

kb: numpy.ndarray

kf

kf: numpy.ndarray

logConversions(self, speciesIndex, y0)

logRates(self, double charRate, species, double speciesRate, double maxDifLnAccumNum, network, double networkRate)

maxCoreSpeciesRates

maxCoreSpeciesRates: numpy.ndarray

maxEdgeSpeciesRateRatios

maxEdgeSpeciesRateRatios: numpy.ndarray

maxEdgeSpeciesRates

maxEdgeSpeciesRates: numpy.ndarray

maxIndUnderSurfaceLayeringConstraint(self, ndarray arr, ndarray surfSpeciesIndices)

determines the “surface index” maximizing arr value under the surface layering constraint, all of the reactants or all of the products must be in the bulk core (in the core, but not in the surface)

maxNetworkLeakRateRatios

maxNetworkLeakRateRatios: numpy.ndarray

maxNetworkLeakRates

maxNetworkLeakRates: numpy.ndarray

neq

neq: ‘int’

networkIndices

networkIndices: numpy.ndarray

networkLeakCoefficients

networkLeakCoefficients: numpy.ndarray

networkLeakRates

networkLeakRates: numpy.ndarray

numCoreReactions

numCoreReactions: ‘int’

numCoreSpecies

numCoreSpecies: ‘int’

numEdgeReactions

numEdgeReactions: ‘int’

numEdgeSpecies

numEdgeSpecies: ‘int’

numPdepNetworks

numPdepNetworks: ‘int’

pdepColliderKinetics

pdepColliderKinetics: list

pdepColliderReactionIndices

pdepColliderReactionIndices: numpy.ndarray

pdepSpecificColliderKinetics

pdepSpecificColliderKinetics: list

pdepSpecificColliderReactionIndices

pdepSpecificColliderReactionIndices: numpy.ndarray

productIndices

productIndices: numpy.ndarray

reactantIndices

reactantIndices: numpy.ndarray

reactionIndex

reactionIndex: dict

residual(self, double t, ndarray y, ndarray dydt, ndarray senpar=<???>)

Return the residual function for the governing DAE system for the simple reaction system.

rtol_array

rtol_array: numpy.ndarray

sensitiveSpecies

sensitiveSpecies: list

sensitivityCoefficients

sensitivityCoefficients: numpy.ndarray

sensitivityThreshold

sensitivityThreshold: ‘double’

set_colliders(self, coreReactions, edgeReactions, coreSpecies)

Store collider efficiencies and reaction indices for pdep reactions that have collider efficiencies, and store specific collider indices

set_initial_conditions(self)

Sets the initial conditions of the rate equations that represent the current reactor model.

The volume is set to the value derived from the ideal gas law, using the user-defined pressure, temperature, and the number of moles of initial species.

The species moles array (y0) is set to the values stored in the initial mole fractions dictionary.

The initial species concentration is computed and stored in the coreSpeciesConcentrations array.

set_initial_derivative(self)

Sets the derivative of the species moles with respect to the independent variable (time) equal to the residual.

set_initial_reaction_thresholds(self)
simulate(self, list coreSpecies, list coreReactions, list edgeSpecies, list edgeReactions, list surfaceSpecies, list surfaceReactions, list pdepNetworks=None, bool prune=False, bool sensitivity=False, list sensWorksheet=None, modelSettings=None, simulatorSettings=None)

Simulate the reaction system with the provided reaction model, consisting of lists of core species, core reactions, edge species, and edge reactions. As the simulation proceeds the system is monitored for validity. If the model becomes invalid (e.g. due to an excessively large edge flux), the simulation is interrupted and the object causing the model to be invalid is returned. If the simulation completes to the desired termination criteria and the model remains valid throughout, None is returned.

snapshots

snapshots: list

speciesIndex

speciesIndex: dict

specificColliderSpecies

specificColliderSpecies: list

step()

Perform one simulation step from the current value of the independent variable toward (but not past) a specified value tout. The resulting values of $$t$$, $$\mathbf{y}$$, and $$\frac{d \mathbf{y}}{dt}$$ can then be accessed via the t, y, and dydt attributes.

surfaceReactionIndices

surfaceReactionIndices: numpy.ndarray

surfaceSpeciesIndices

surfaceSpeciesIndices: numpy.ndarray

t0

t0: ‘float’

termination

termination: list

unimolecularThreshold

unimolecularThreshold: numpy.ndarray

y0

y0: numpy.ndarray