## KB Gij values

### Quick Start

Once you understand what a KB Integral (KBI) is, as shown via its Gij value, then the whole of KB science becomes clear. Here I guide you through in gentle steps, starting from the most simple case, building up to as complicated as you wish to make it. As long as you have some vague idea about activity coefficients and about densities, you'll get a good idea of how Gij values are calculated. The following apps then explain what Gij values really mean!

### KB Gij values

ρ0
ρ1
ρ2
ρ3
W1
W2
MWt1
MWt2

The calculation of KB values is straightforward but involves a number of steps that can be rather confusing. The graphs in this app are a quick way to build up your intuition about what it means when two components like or dislike each other.

Here we take as inputs two imaginary datasets which you can adjust to mimic the cases you might be interested in. The assumption is that you have some idea of activity coefficients such that large (positive) values mean that the two components don't like each other, that values of ~1 mean that they are neutral about each other, and negative values mean a positive attraction between them.

1. Create a plot of your desired shape of activity coefficients γ1 and γ2 versus mole fraction x1 using the two W (Wilson) parameters.
2. Create a plot of density of your mixture versus mole fraction x1 using the 4 components of a 3rd-order polynomial. For simplicity the default is for the first value to be 1 and the others set to 0. This mimics an "ideal" situation for the calculations of partial molar volumes
3. Calculate the Apparent MVol VA1 and VA2 from the densities and mole fractions. These are not the true molar volumes. For example, strongly interacting solutes can make the density higher, and the volume lower giving an apparent molar volume for the solute of less than its real value. In an extreme case the apparent molar volume can be negative.
4. Calculate the Partial MVol, i.e. the actual molar volume of each component in the given environment. If a component is forced to cluster tightly by the other component, its effective density is higher so the partial MVol is lower; if it is made less compact its density is lower so the partial MVol is higher. In many cases, just assuming that partial MVol is the same as the pure MVol is good enough, but there are plenty of cases where this assumption leads you astray.
5. The three KB values G11, G12 and G22 are calculated using the derivative, δln(γ)/δx1 and the partial MVols.
6. The three "ideal" KB values are calculated, G11i, G12i and G22i, using the assumption of no interactions between components, i.e. γ=1 for both components
7. This means that the excess numbers N11, N22, N12, and N21 can be calculated from Nij=ci(Gij-Giji). This gives an idea of whether the individual components prefer to be self-clustering or whether there are preferred 1-2 clusters. Although G12 is by definition equal to G21, N12 at a given x1 is not the same as N21.