energy(what, vars, vals, lims, T=get("thermo")$opt$Tr, P="Psat", IS=0,
sout=NULL, exceed.Ttr=FALSE, transect = FALSE)
energy.args(args)
A.ionization(iprotein, vars, vals, T=get("thermo")$opt$Tr,
P="Psat", pH=7, transect=FALSE)
thermo$opt$Tr
, which corresponds to 25 $^{\circ}$Cwater
)thermo$protein
energy
, a list the first element of which is sout
(the results from subcrt
) and the second element of which is a
, which contains the calculated properties. The latter itself is a list, one element for each species of interest, which have dimensions that are the number of var
iables passed to the function. For energy.args
, a list with elements what
, vars
, vals
, lims
, T
, P
, IS
that are appropriate for the corresponding arguments in energy
.
energy
is the engine for the calculations of chemical affinity. Given $n$ (which can be zero, one, or more) names of basis species and/or T, P, or IS as the var
s, it calculates the property given in what
on an $n$-dimensional grid or transect for each of the values (vals
) of the corresponding variable. The limits for each variable given in lims
indicate the minimum and maximum value and, if a third value is supplied, the resolution, or number of points in the given dimension. If T, P, and/or IS are not among the var
s, their constant values can be supplied in T
(in Kelvin), P
(in bar, or Psat), and IS
(in mol kg$^{-1}$). sout
, if provided, replaces the call to subcrt
which can greatly speed up the calculations if this intermediate step is stored by other functions (e.g., transfer
). exceed.Ttr
is passed to subcrt
so that the properties of mineral phases beyond their transition temperatures can optionally be calculated. The what
argument of energy
is analogous to the property
argument of affinity
.
energy.args
is used by affinity
to generate the argument list for energy
. energy.args
also has the job of converting Eh to pe as a function of temperature (see convert
), and converting pe and pH to logarithms of activities of the electron and protein, respectively (i.e., negating the values).
In CHNOSZ version 0.9, energy
gained a new argument transect which is set to TRUE by energy.args
when the length(s) of the variables is(are) greater than three. In this mode of operation, instead of performing the calculations on an $n$-dimensional grid, the affinities are calculated on an $n$-dimensional transect through chemical potential (possibly including T and/or P) space.
A.ionization
builds a list of values of A/2.303RT of the ionization reactions of proteins that are a function of T
, P
and pH
but are expanded to as many dimensions as defined in vars
in order to be included by the calculations by energy
. These calculations are invoked if proteins are in the species definition, and the basis species contain H+.
affinity
is used interactively instead of these functions.data(thermo)
basis("CHNOS")
species("acetic acid")
eargs <- energy.args(list(O2=c(-90, -60, 5), T=c(0, 100, 5)))
ea <- do.call(energy, eargs)
Run the code above in your browser using DataLab