i2A
returns a stoichiometric matrix representing the elemental composition of the formula
s.
Each column corresponds to an element that is present in at least one of the formulas; some element counts will be zero if not all formula have the same elements.
If a matrix is passed to i2A
it is returned unchanged.
as.chemical.formula
makes a character string representing a chemical formula from a vector of coefficients with names corresponding to the elements (e.g., the output of makeup
) or from a stoichiometric matrix (output of i2A
).
Each elemental symbol is written followed by its coefficient; negative coefficients are signed.
Any coefficients equal to 1 are not explicitly written, and any charge (indicated by makeup
as Z) is shown as a signed number at the end of the formula.
If the formula is uncharged, and the last element has a negative coefficient, +0 is shown at the end of the formula to indicate a charge of zero.
The remaining functions documented here accept vectors of chemical formulas, species indices, or a mixture of both, or stoichiometric matrices with elements on the columns.
mass
and entropy
return the sums of masses or entropies of elements in each of the formula
s.
The masses are calculated using the masses of the elements in their natural isotopic distribution, and the entropies, in cal K\(^{-1}\) mol\(^{-1}\), are calculated using the entropies of the compounds of the pure elements in their stable states at 25 C and 1 bar.
The properties of the elements used by this function are taken from thermo$element
.
GHS
computes one of the standard molal Gibbs energy or enthalpy of formation from the elements, or standard molal entropy, from values of the other two.
The formula
, G
, H
and S
arguments must all have the same length.
The entropies of the elements (Se
) in each formula
are calculated using entropy
, which gives values in calories.
If E_units
is J, the values are converted to Joules.
The equation in effect can be written as \({\Delta}G^{\circ}={\Delta}H^{\circ}-T{\Delta}S^{\circ}\), where \({\Delta}S^{\circ}=S-S_e\) and \(T\) is the temperature given in T
(defaults to 298.15 K) (note that G
and H
in the arguments correspond respectively to \({\Delta}G^{\circ}\) and \({\Delta}H^{\circ}\) in the equation).
For each formula, if one of G
, H
, or S
is NA, its value is calculated from the other two.
Otherwise, the values are returned unchanged.
ZC
returns the average oxidation state of carbon (\(Z_{\mathrm{C}}\)) calculated from ratios of the elements in the chemical formula
s.
The equation used is
\(Z_{\mathrm{C}}=\frac{Z-n_{\mathrm{H}}+2\left(n_{\mathrm{O}}+n_{\mathrm{S}}\right)+3n_{\mathrm{N}}}{n_{\mathrm{C}}}\), where the \(n\) refer to the number of the indicated element in the formula and \(Z\) is the charge (Dick and Shock, 2011).
The result is NaN
for any formula that does not contain carbon. Elements other than those shown in the equation are not included in the calculation, and produce a warning.