If one wants not to get lost with solid solutions is better to start from definitions (I am copying here the notes from the course of James Connolly). The most fundamental equation is the gibbs energy of a (non-ideal) mixture (in units of J/mol, here is mol of the solid solution as given in the arbitrarily defined structural formulae,)
The real complication here (and source of confusion) is the configuration energy. It is confusing because ideal mixing is far from being obvious as it is not known a priori if you are mixing in crystallographic sites or you are mixing molecules (where the original definition of activity and classic thermodynamics is coming). In the case that the pure endmembers do not have configuration entropy themselves (this happens in albite), the configuration energy is defined as,
where
For olivine, if you assumed that there is only one type of octahedral site (
Then the excess energy is defined for a 2-compoenent end member (note that in this definition the Margules term is defined in terms of fayalite and forsterite endmember not Fe and Mg in atoms)
So the gibbs energy of the solution is
Before getting to the derivation of activity you need to solve for the gibbs energy of the end member, for instances forsterite
Once you know
I wrote a python script to do the symbolic calculation in Jupyter (see link in the previous page), the activity is
That can be simplified as usual as,
Which is the same as in the classical papers (please note that sometimes people use W for the exchange per atom, but in the above definition it is taken per mole of atoms exchanged in the structural formula, therefore 2 in olivine)