equilibrate provides an interface to calculate the chemical activities of species in metastable equilibrium, in an open system at constant temperature and pressure and chemical activities of basis species, and with linear balancing constraints on transformations.It takes as input aout, the output from affinity, which may be calculated from a multidimensional grid of conditions.
The equilibrium chemical activities of species are calculated using either the equil.reaction or equil.boltzmann functions, the latter only if the balance is on one mole of species.
As aout contains the chemical affinities of formation reactions of each species of interest, equilibrate in order to function needs to be provided constraints on how to balance the reactions representing transformations between the species.
balance returns the balancing coefficients, where balance indicates the balancing constraints, according to the following scheme:
ll{
      NULL 	autoselect using which.balance
name of basis species 	balance on this basis species
length 	balance on length of proteins
1 	balance on one mole of species
numeric vector 	user-defined constraints
}
The default value of NULL for balance indicates to select the first shared basis species in all formation reactions identified using which.balance, or if that fails, to set the balance to 1.
However, if all the species (as listed in code aout$species) are proteins (have an underscore character in their names), the default value of NULL for balance indicates to use length as the balance.
NOTE: the summation of activities assumes an ideal system, so molality is implied by activity in the following.
loga.balance gives the logarithm of the total activity of balance (which is total activity of species for 1 or total activity of amino acid residue-equivalents for length).
If loga.balance is missing, its value is taken from the activities of species listed in aout; this default is usually the desired operation.
normalize if TRUE indicates to normalize the molar formulas of species by the balance coefficients.
This operation is intended for systems of polymers, such as proteins, whose conventional formulas are much larger than the basis speices.
The normalization also applies to the balancing coefficients, which as a result consist of 1s.
normalize has the same effect as did diagram(..., residue=TRUE) in versions of CHNOSZ before 0.9-9.
ispecies can be supplied to identify a subset of the species to include in the calculation.
equil.boltzmann is used to calculation the equilibrium activities if balance is 1 (including the normalized result when normalize is TRUE), otherwise equil.reaction is called.