Class: ReactionKinetics

ReactionKinetics(species, coefficients)

Constructs a new reaction based off of the given species objects as well as their list of coefficients.

Constructor

new ReactionKinetics(species, coefficients)

Parameters:
Name Type Description
species Array

The species involved in the reaction.

coefficients Array

The coefficients of the species in the species Vector.

Source:

Methods

add(other) → {Reaction}

Adds a Reaction to this reaction. If the sum of these two is a valid reaction (there is both a reactant and a product present) then a new Reaction will be returned. Else, null will be returned.

ASSUMPTION: All reactions are normalized. I.E., there is never the case that the same species is both a reactant and a product.

Parameters:
Name Type Description
other Reaction

the other reaction to be added

Source:
Returns:

if valid, else null

Type
Reaction

cloneCoefficients() → {Array}

Returns a copy, not a reference, of the coefficients in this reaction

Source:
Returns:

coefficient a copy of coefficients in this reaction

Type
Array

cloneSpecies() → {Array}

Returns a copy, not a reference, of the species in this reaction

Source:
Returns:

specie a copy of species in this reaction

Type
Array

equals(other) → {Boolean}

Checks the equality between two reactions. ASSUMPTION: There cannot exist another reaction with the same species, but different coefficients.

Parameters:
Name Type Description
other Object
Source:
Returns:

returnValue

Type
Boolean

evaluateBetweenSolids() → {Boolean}

Evaluates if the reactions includes only solid species

Source:
Returns:

isBetweenSolids

Type
Boolean

getCoefficientAt(index) → {Number}

Returns the coefficient of the species at the specified index.

Parameters:
Name Type Description
index Number
Source:
Returns:
Type
Number

getGo(temp) → {Number}

This returns the standard Gibb's Free energy of the reaction, for use in calculating K.

Parameters:
Name Type Description
temp Number

the temperature

Source:
Returns:
Type
Number

getHeatCapacity() → {Number}

Returns the specific heat for the reaction in J/K/mol.

Source:
Returns:
Type
Number

getHo() → {Number}

Returns the standard Enthalpy for the reaction.

Source:
Returns:
Type
Number

getK(temperature) → {Number}

Returns the K of the reaction for the given temperature.

Parameters:
Name Type Description
temperature
Source:
Returns:
Type
Number

getOverlappingCoefficients(other) → {Array}

Searches for an overlapping species in the other Reaction, and if it finds one, we return the coefficients.

If there is an overlap, we return two Doubles per overlap, the first being the coefficient of our overlapping species, and the second being the coef of the other reaction.

If there is no overlap, null will be returned.

Parameters:
Name Type Description
other Reaction
Source:
Returns:

returnValue

Type
Array

getProducts() → {Array}

Returns the products.

Source:
Returns:
Type
Array

getRateConstant()

Returns the rate constant for a reaction at a given temperature

Source:

getReactants() → {Array}

Returns the reactants.

Source:
Returns:
Type
Array

getSo() → {Number}

Returns the standard Entropy of the reaction.

Source:
Returns:
Type
Number

getSpeciesAt(index) → {Species}

Returns the species specified at the given index.

Parameters:
Name Type Description
index
Source:
Returns:
Type
Species

getSpeciesCount() → {Number}

Returns the number of the species in the Reaction.

Source:
Returns:
Type
Number

getSpeciesIndex(specie) → {Number}

Returns the index of the specified Species. This method will return -1 if the Species is not present in this reaction.

Parameters:
Name Type Description
specie Species

the specie we are looking for

Source:
Returns:
Type
Number

reverseReaction() → {Reaction}

Returns a new reaction that represents the reverse of this reaction, as computed by converting all reactants to products, and all products to reactants.

Source:
Returns:
Type
Reaction

scale(factor) → {Reaction}

Returns a new reaction, scaled by the given factor.

Parameters:
Name Type Description
factor Number
Source:
Returns:

the new scaled reaction

Type
Reaction

setCoefficientAt(coef, index)

Stores the provided coefficient for the species at the given index.

Parameters:
Name Type Description
coef Number
index Number
Source:

setSpeciesAt(specie, index)

Stores the referenced specie at the given index. The previous specie at that index is discarded.

Parameters:
Name Type Description
specie Species
index Number
Source:

toString() → {String}

Returns the String representation of this Reaction.

Source:
Returns:

returnValue

Type
String