equil.boltz(Astar, nbalance, thisloga)
equil.react(Astar, av, nbalance, thisloga)Astar.diagram are calculated using either the equil.boltz or equil.react functions. The former is used if residue in diagram is set to TRUE, and the latter if residue is set to FALSE. The input values are in a list, Astar, all elements of the list having the same dimensions. Each element contains the chemical affinities of the formation reactions of one of the species of interest at unit activity. The metastable equilibrium activities calculated using either equil.* function satisfy the constraints that 1) the resulting chemical affinities of the formation reactions of the species are all equal and 2) the total activity of the conserved component (thisloga) is unchanged.
In equil.react (the algorithm described in Dick, 2008 and the only one available prior to CHNOSZ-0.8), the calculations of relative abundances of species use the activities in the affinity output as initial guesses, and attempt to solve a system of equations that represent the two constraints stated above. So, if you supply a value for thisloga that is much different from that of the initial guess you may end up with errors from uniroot such as "f() values at end points not of opposite sign".
In equil.boltz (algorithm available beginning with CHNOSZ-0.8), the chemical activities of species are calculated using the Boltzmann distribution. This calculation is faster than the equation-solving approach used above, but is limited to systems where the balance coefficients are all unity. Therefore, this function is only called by diagram for systems of proteins when residue set to TRUE.