The main idea here is to set up Change Balance Restraints in GSAS which can either i) be enabled and actively applied in the refinement or ii) just used as a guide to "easily" check that the structure is "charge neutral". (Other Rietveld software that can perform Charge Balance restraints: Profil Rietveld)
In GSAS, this is done via the chemical composition restraints. GSAS does not care if the value is an "occupancy value" or a "charge value", it will just crunch the numbers as required.
(Note that you can still use neutral atom scattering factors (or approximate scattering factors). Scattering factors are independent of the ionization states defined in the charge balance restraint.)
In the following case, there is only a neutral Sulphur atom scattering factor in GSAS. But in the charge balance restraint, the ionization state of the Sulphur can be given any value we wish it to have.
This tutorial also makes use of the PFE freeware text editor for Windows.
PFE for MS Windows (Programmers File Editor) - Alan Phillips
Charge Balance restraints on a trivial example
Following is a trivial example involving Lead Sulphate to show how this is done. Obviously, more complex examples with mixed sites could be performed (e.g., Ba+2 vs Fe+3; Ca+2 vs Nb+5).
A more complicated example would be that you could define two Fe atoms
on a single site, one (Fe1) defined as Fe+3 and the other (Fe2) as Fe+4. While no
scattering factor for Fe+4 exists, you define the ionization states in the restraints menu
as shown below.
If on multiple sites, combined with the chemistry information (or total chemistry restraints),
you could then refine the amount of Fe+3 vs Fe+4 to achieve charge balance for a particular
structure. (providing you have enough information in the restraints and powder diffraction pattern
to refine the number of unknowns)
If on multiple sites, combined with the chemistry information (or total chemistry restraints), you could then refine the amount of Fe+3 vs Fe+4 to achieve charge balance for a particular structure. (providing you have enough information in the restraints and powder diffraction pattern to refine the number of unknowns)
In this case, using Brian Toby's EXPGUI interface into GSAS, note down the atoms numbers and the ionisation states that you will need to assign in the charge balance restraints macro.
Creating a Charge Balance Macro File for GSAS Using EXCEL and PFE text editor for Windows
While this example is so simple it may not justify using EXCEL; it is done as a general example. The advantage of creating GSAS macros in Excel is it becomes very easy to chop and change them if you discover extra complexity during the coarse of the refinement.
Following is a screen dump of the GSAS Macro for setting up the input and the explanation of this. (This is included with the above ZIP file of data) When inputting ionization state values for cations and anions, they should sum to zero - otherwise the composition you have refined, or inputted does not charge balance.
Cut and paste the Macro into a text Editor (in this case the freeware PFE editor for Windows). Excel will put tabs between commands which have to be replaced with spaces. In PFE, select the first tab using the mouse, then press F3 to do a replace and input a space as the replacement. Perform the replace on all the tabs. Done as per below.
Tabs replaced by spaces
Macro follows in ASCII format:
k l s c i 0 0.1 1 1 2 1 2 6 1 3 -2 1 4 -2 1 5 -2 0
Now paste the macro into GSAS's EXPEDT. Done! (In Windows, after peforming the Edit, Paste command, you may have to wiggle the mouse to paste all the text into the DOS box - a Windows nuance)
By default, the Charge Balance restraints will be "On". To turn them off, but still use them for diagnostic purposes; go back one menu option (x) to the Restraints menu, then do L (list) to list the available histograms. From the listed histograms, find out which histogram is the Chemical composition restraints histogram. Then type U (Use histogram) and when prompted with the Chemical composition restraints histogram, turn it "off" by saying you do not want to use them.
Now do L to list (keep pressing enter until you scroll through the inputted restraints) and check that the observed and calculated give what is expected
Observed charge balance is the target value that you want to achieve (in the case of Change Balance - this is zero (0))
Calculated charge balance should be zero - if not - you have a problem that you need to sort out before the completion of your refinement (either occupancies are wrong - or the ionization states have been incorrectly assigned).
An example of an imbalance in the Charge Balance is given below where the Pb has been given +4 as the ionization state (instead of Pb+2) with the result that there are an excess of 8 in the "charge balance" - which is not physically reasonable.
Change balance can be achieve by setting the Charge on the Pb to +2 ; or keeping the ionization state of the Pb at +4 - but halving the atom occupancy. In real refinements, it is up to you to decide what is physically reasonable.