| GasComponents | R Documentation |
R6 class for natural gas composition input
R6 class for natural gas composition input
GasComponents holds the mole fractions, their standard uncertainties,
and the inter-component correlation matrix for a natural gas mixture.
All three quantities are required as input to calculateProperties.
Components are identified either by their integer index (1–60, matching
ISO 6976:2016 Table A.2) or by English name (see componentNames).
fractionsNumeric vector (length 60) of mole fractions [mol/mol].
uncertaintiesNumeric vector (length 60) of standard uncertainties.
correlations60x60 correlation matrix (default: identity matrix).
new()Create a new GasComponents object. Initialises fractions and uncertainties to zero and correlations to the 60x60 identity matrix.
GasComponents$new()
getFraction()Get the mole fraction of a single component.
GasComponents$getFraction(name)
nameComponent name (English) or integer index 1–60.
Numeric scalar.
getUncertainty()Get the standard uncertainty of a single component.
GasComponents$getUncertainty(name)
nameComponent name (English) or integer index 1–60.
Numeric scalar.
getCorrelation()Get the correlation between two components.
GasComponents$getCorrelation(name1, name2)
name1First component name or index.
name2Second component name or index.
Numeric scalar in \[-1, 1\].
setFraction()Set the mole fraction of a single component.
GasComponents$setFraction(name, value)
nameComponent name or index.
valueMole fraction [mol/mol].
setUncertainty()Set the standard uncertainty of a single component.
GasComponents$setUncertainty(name, value)
nameComponent name or index.
valueStandard uncertainty.
setCorrelation()Set the correlation between two components.
GasComponents$setCorrelation(name1, name2, value)
name1First component name or index.
name2Second component name or index.
valueCorrelation coefficient in \[-1, 1\].
setFractionArray()Set all mole fractions at once.
GasComponents$setFractionArray(x)
xNumeric vector of length 60.
setUncertaintyArray()Set all uncertainties at once.
GasComponents$setUncertaintyArray(u)
uNumeric vector of length 60.
setCorrelationMatrix()Set the full correlation matrix.
GasComponents$setCorrelationMatrix(r)
r60x60 numeric matrix; values must lie in \[-1, 1\].
clone()The objects of this class are cloneable with this method.
GasComponents$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.