page last updated: 12.12.2011

Tips and Tricks

Need a hint? The Tips and Tricks section of this website is here to help. This page covers some of the most common areas where users need help. For example:

Common Problems

This section outlines the common problems encountered by people using thermocalc including a number of common error messages, sorting out strange output, crashes etc. Three of the most common issues revolving around starting guesses, dealing with solvi and when a calculation fails to produce an answer are dealt with in their own sections below.

This section is currently under construction

back to top

Starting Guesses

This section contains help about what starting guesses to use. Why are starting guesses important?  thermocalc requires starting guesses for each defined variable in an a-x model. The choice of starting guesses generally does not affect the final answer but rather how easily, if at all, a solution is found. The main exception is where solvi occur and two different starting guesses are on opposite sides of a solvi.

Each starting guess is presented as a number typically between 0 and 1, with the exception of some order-disorder parameters which vary between -1 & 1.  The most common reason that a calculation fails is due to starting guesses. This is particularly true when you are just starting a diagram or are calculating an equilibria with a new phase involved.

The starting guesses can be changed either in the a-x file itself (manually) or via a list in the script file (using the printxyz and readxyz scripts). Changing the starting guesses in the script file is the easiest way to go, but if you are considering a new phase you may have to change its starting guesses in the ax file or manually add it to the read xyz list. Using the printxyz and readxyz facility involves using starting guesses that are an exact solution to a particular equilibria from a given P-T point. This has the advantage of ensuring all the starting guess compositions are in the right order (e.g the xFe of each phase is in the correct relative order). The disadvantages to this is that for some minerals (principally chlorite) this causes a crash and for minerals either side of a solvus, things can go wrong. Below are some hints for starting guesses.

For the chlorite problem, simply manually lower the number for Q(chl) by a small amount .

For solvi, it is sometimes best to manually move the appropriate starting guess further away (ie closer to the endmember compositions) from the solvus. For example, when dealing with coexisting ksp and pl make the pl more calcic and the ksp more potassic than the exact solution, that way the starting guesses start on the right side of the solvus rather than within it.

From personal experience, how often you need to change starting guesses depends on the system you are in, the size of the P-T window and the minerals you are dealing with. For example, I have calculated a whole KFMASH pseudosection for 600-900°C 3-10kbar with one set of starting guesses but have had to change starting guesses several times for some nasty equilibria in a mafic composition over a small P-T window.

Near solvus tops can be rather tricky with regard to starting guesses, and may require several changes. Here the equilibria can be calculated for a few points with the compositions the right way around and then some where the phases either side of the solvi give the same composition. You need to keep an eye on the output.

Always look carefully at the output before using that data as starting guesses, I’ve commonly seen students use output that has two phases with identical compositions when they should be separated by a solvus.

When changing starting guesses, do not delete the older starting guesses, simply move them to the “storage” area of the file as you may need them later (say for recalculating something or contouring)

If you are going to change starting guesses using the printxyz and readxyz facility, always go with the nearest LOW VARIANCE assemblage. That way you get starting guesses for the maximum number of phases.

If you are can’t calculate an equilibria that brings in a new phase and you know it must be there, there are several tricks you can use. Firstly, try to work out what other equilibria (involving this new phase) are around the P-T area of interest and try to calculate them. If successful this will give you some new starting guesses. Secondly, you can try to calculate a higher variance relationship (not too much higher though) and any success here will at least give you a reasonable starting guess.  As a last resort, simply manually change the starting guess for the new phase to something that looks sensible.

back to top


Solvi are a fairly common feature in minerals, but in terms of calculations using thermocalc they can be expressed in two ways

  1. a solvus exists in nature, but the thermocalc a-x coding for the minerals either side of the solvus are different. Here the solvus can not be modelled per se and the coexistence of the phases is effectively superimposed by the user. Some older models for amphibole were like this.

  2. the thermocalc coding for the phases separated by a solvus are identical but involve different starting guesses. Here, we can actually caclulate the solvus as it is a consequence of the a-x model and endmember thermodynamics

In this section I deal exclusively with the second case where two phases have identical a-x coding. Here the key to staying out of trouble is to keep a close eye on the output, in particular the composition output of the phases with the same coding. To make this easier there is a script you can use called "samecoding" that prints the phases of interest all lined up for quick visual comparison. E.g. the output below where the y and a variables for the amphiboles highlight the solvus.

 P(kbar)     T(°C)   x(act)   y(act)   z(act)   a(act)   c(act)   f(act)  Q1(act)  Q2(act)
   14.20     602.0   0.2276   0.1834   0.1269   0.1768   0.8408  0.02300 -0.01956  0.06044
                      x(hb)    y(hb)    z(hb)    a(hb)    c(hb)    f(hb)   Q1(hb)   Q2(hb)
                     0.2574   0.3938   0.1355   0.3898   0.8301  0.04938 -0.01782  0.08294
                      x(di)    j(di)    f(di)    Q(di)  Qaf(di)  Qfm(di)
                     0.2706   0.1415   0.3769  0.01120 0.006944 -0.09095
                     x(chl)   y(chl)   Q(chl)     x(g)     z(g)     f(g)
                     0.3092   0.5175   0.4824   0.8242   0.3603  0.01535

  mode      act       hb       di      chl        g       ru
         0.3846   0.1645  0.07883   0.3284  0.03942 0.004247

Irrespective of how careful you are, solvi can be a headache to deal with. Some solvi are relatively simple and largely a binary problem (eg ilm-hem or sp-mt) others are slightly more complex such as with the feldspars. Finally, some minerals such as amphibole, can at times be a nightmare to sort out as solvi here exist in multidimensional composition space and it is not always easy to relate the compositions space of a solvus to the variables used. Depending on the calculation you are doing, identifying whether your results are correct may require careful inspection of the output. Eg. Below the act and hb have identical composition

  P(kbar)     T(°C)   x(act)   y(act)   z(act)   a(act)   c(act)   f(act)  Q1(act)  Q2(act)
#   14.20     628.5   0.2424   0.2386   0.1008   0.2882   0.8520  0.03398 -0.01692  0.07118
                       x(hb)    y(hb)    z(hb)    a(hb)    c(hb)    f(hb)   Q1(hb)   Q2(hb)
                      0.2424   0.2386   0.1008   0.2882   0.8520  0.03398 -0.01692  0.07118
                       x(di)    j(di)    f(di)    Q(di)  Qaf(di)  Qfm(di)
                      0.2714   0.1235   0.4039 0.008742 0.005997 -0.08906
                      x(chl)   y(chl)   Q(chl)     x(g)     z(g)     f(g)
                      0.3067   0.5154   0.4845   0.8036   0.2933  0.01179

  mode      act       hb       di      chl        g       ru
         0.1681   0.4328  0.05576   0.3011  0.03800 0.004273

In other cases, having two phases plotting on the same side of a solvus causes a degeneracy and the problem is obvious at a glance. E.g.

P(kbar)   T(°C)    x(he)     y(he)    z(he)        x(mt)    y(mt)    z(mt)   
2.60       877.9   0.9464   0.8203  0.06514   0.9750   0.1730   0.4069  
        209sp + 167opx + 29liq + 10ilm + 220q = 56mt + 35cd + 129g + 11ksp
2.70       544.0   0.9913  0.03152   0.1763   0.9913  0.03152   0.1763  
        mt = sp
2.80       548.1   0.9908  0.03197   0.1751   0.9908  0.03197   0.1751  
        mt = sp

Here the calculation has failed with both sp and mt having a mt composition. This has made it impossible for thermocalc to write a balanced reaction between all the phases so has written a nonsensical mt = sp reaction.

Typically the only way to sort out the top of the solvus is to be careful and methodical. This involves calculating as much as you can of the coexisting phases and trying to see the shape of the solvus on the diagram. You will commonly have to change starting guesses several times.  Also changing the P-T window can help as can changing from calculating T at P to P at T. Commonly, the top part of the solvus will not calculate, with each attempt resulting in the coexisting phases having the same composition. If playing with the starting guesses does not help, there is little you can do here in terms of further calculation. The best option here is to make up some approximate P-T numbers that close the solvus in a sensible way. When presenting a phase diagram where you have done this it is often best to show this approximate boundary as a dashed line to show it is approximate.

A further complication is the appearance of very small (apparent) solvi on a larger solvus or when two phases have almost identical but not exactly identical compositions. These small solvi are basically like small bumps or humps on the solvi surface. They are just a consequence of the complex a-x models used in some calculations and do not represent real natural solvi (they are typically within error of not being present). The most common place to find them is close to the top of the larger solvus and appear in the output as coexisting phases with nearly identical composition. Again, look carefully at the output as you go. Changing the starting guesses can help. Below is an example of nearly identical amphibole compositions.

  P(kbar)     T(°C)   x(act)   y(act)   z(act)   a(act)   c(act)   f(act)  Q1(act)  Q2(act)
#   14.00     618.5   0.2454   0.2451   0.1039   0.2775   0.8544  0.03370 -0.01873  0.07155
                       x(hb)    y(hb)    z(hb)    a(hb)    c(hb)    f(hb)   Q1(hb)   Q2(hb)
                      0.2456   0.2464   0.1039   0.2789   0.8544  0.03388 -0.01872  0.07169
                       x(di)    j(di)    f(di)    Q(di)  Qaf(di)  Qfm(di)
                      0.2751   0.1254   0.3986 0.009074 0.006107 -0.09109
                      x(chl)   y(chl)   Q(chl)     x(g)     z(g)     f(g)
                      0.3111   0.5162   0.4837   0.8143   0.3200  0.01333

  mode      act       hb       di      chl        g       ru
       0.006184   0.5952  0.05612   0.3075  0.03080 0.004263

Minerals to be careful with regard to solvi are:

Even if you do not have coexisting phases you still have to be wary of solvi. Regardless of the name the phase has in the a-x file it is possible to calculate compositions on the wrong side of a solvus. For example you could change the starting guesses of hb such that they are on the actinolite side of the solvus and the amphibole you calculate is actually an actinolite despite the phase name being hornblende. It is also possible for a phase to jump a solvus along a line. This typically results in sharp shift in the P-T conditions of the line (see Fig. below) or a zig-zag of the line if the results jump back across the solvus. However, the size of this shift may be quite small if you are close to the solvus top.

solvus jumps image


back to top

Failed Calculations

Sometimes a calculation just won’t calculate and thermocalc returns just a series of numbers. These numbers do have some meaning that is sometimes related to the input you have used and other times more related to the inner workings of the software.  Other times thermocalc will just produce an error message. The material below may be of use if your calculation fails, but does not produce an error message. A discussion of error messages can be found in the common problems section

The main reasons for a a given calculation to fail are:

  1. the equilibria you are trying to calculate doesn’t exist
  2. the non linear equation solver simply failed for some reason
  3. your starting guesses are too far from a solution
  4. there is a solution but it is outside your P-T window
  5. the line you are calculating is shorter than the P/T increments you have chosen

If your calculation fails I recommend the following steps

  1. Look at the output. The numbers given may lead you to a solution. The meaning of these numbers is given here
  2. Look at the assemblage, zero mode phase(s), P-T window and P/T increments you entered. Do they look right?
  3. If they look ok run the equilibria again to see if it will work the second time
  4. Change your P-T window and/or P/T increments (especially if you think the line is short) and try again.
  5. If you are calculating a line and it could be short, try calculating the points that may terminatre it.
  6. If you think the reaction could be very flat in P-T try calculating P at T rather than T at P
  7. Change starting guesses and try again
  8. If still not working try steps 1-5 again with the new starting guesses
  9. If that still is not working, try calculating the equilibria with no modes set to zero to see if you can find the equilibria at all (this is particularly useful if you have got the zero mode phase wrong). Try calculating different possible boundaries (ie different zero-mode phases) for this field.
  10. A final trick is to set a composition isopleth or a series of compositions as well as a zero mode for a phase and calculate a series of points.
  11. If all else fails, leave that section of the diagram and calculate the equilibria all around it, this may give you an idea of the size & shape of the field you are having trouble with as well as supplying different possible starting guesses.

Other times an equilibrium may be hard to calculate includes where a number of phases have near zero modes.

back to top