MTDATA – Phase Diagram Software from the National Physical Laboratory







Training and Support 




Other Services 





Introduction to TERNARY

Worked examples

The intention of this section is to provide a guided introduction to each command within the TERNARY module through a series of examples which illustrate not only the function of each command, but how they can be used in combination. Each example consists of text and output; the output is given in a separate table/figure numbered to match the sub-section heading. The commands issued are given in both, printed in italics. The text contains appropriate and helpful comments, and should be read in conjunction with the relevant output.

Setting up a system and making calculations

define system="Al,Si,Zn" source=DEMO_1 !

DEFINE SYSTEM allows the user to enter the system components into the program as a list separated by commas and within quotes. The parameter SOURCE instructs the program to search the specified database(s) - in this case the DEMO_1 database - for data for all the compounds which are combinations of the three elements and for all relevant solution phases.

A report of the search is given - there are 5 phases and 10 species. The data for these phases and species are read from the database into the memory and also written to an output file which in this case has a default name, since none was specified by the user.

list system=components phases substances !

The command LIST produces a display, in this case of components, phases and substances in the system, together with useful attributes. In referring to phases and substances in later CLASSIFY commands, it is important to use the numbers which appear on these lists. STATUS = NORMAL means that the component/phase/ substance is present and will be considered in the calculations. The status of any phase or substance can be altered using the CLASSIFY command. Components cannot be classified as ABSENT in the TERNARY module.

In the component list, AMOUNT is the number of moles of a given component in the system. This may be entered using either the SET command or the graphics cursor. After the plot is complete the component amounts are reset and become undefined again.

In the phase list, note that all condensed substances are assigned to different phases unless their phase labels are identical.

set temperature=800 !

A temperature must be set as there is no default value; the unit is kelvin.

compute !

After the execution of the COMPUTE command (followed by a <CR>) the axes illustrated in the first figure below are drawn and the graphics cursor appears if a starting composition has not already been set. This may take the form of crosswires or an arrow pointer. The figure is a result of executing the COMPUTE command and coming straight out by typing in A the graphics sub-command for exit, without performing any calculations. Other graphics single key-stroke commands are described below.

list system components !

Notice that the component amounts are undefined.

compute !

The next diagram is a result of the instruction to the program to calculate and plot using the graphics sub-command F (either upper or lower case). Exit from COMPUTE is accomplished by entering A (again either upper or lower case).


The diagram which has just been calculated is sent to the local plotting device which, in this instance is a laser printer.

TERNARY OPTION ? define system="Al,Si,Zn" source=DEMO_1 !


Date and time of run  4-NOV-87  14:36:28

DATAFILE = SOURCE.MPINPUT -  CREATED 14:36 04/11/87                   
SYSTEM = Al,Si,Zn,                                                   
NUMBER OF PHASES  =   5                                      
NUMBER OF SPECIES =  10                                                 

TERNARY OPTION ? list system=components phases substances !

NUMBER      COMPONENT         STATUS      AMOUNT      
  1            Al             NORMAL      undefined
  2            Si             NORMAL      undefined
  3            Zn             NORMAL      undefined

NUMBER      PHASE             STATUS      MODEL                    
  1         FCC_A1            NORMAL      REDLICH-KISTER     
  2         HCP_A3            NORMAL      REDLICH-KISTER     
  3         LIQUID            NORMAL      REDLICH-KISTER     
  4         BCC_A2            NORMAL      PURE SUBSTANCE
  5         DIAMOND_A4        NORMAL      PURE SUBSTANCE     

  1         Al<FCC_A1>        NORMAL                         
  2         Si<FCC_A1>        NORMAL                         
  3         Zn<FCC_A1>        NORMAL                         
  4         Al<HCP_A3>        NORMAL                         
  5         Zn<HCP_A3>        NORMAL                         
  6         Al<LIQUID>        NORMAL                         
  7         Si<LIQUID>        NORMAL                         
  8         Zn<LIQUID>        NORMAL                         
  9         Si<BCC_A2>        NORMAL                         
 10         Si<DIAMOND_A4>    NORMAL                         

TERNARY OPTION ? set temperature=800 !
TERNARY OPTION ? compute !

TERNARY OPTION ? list system components !

  1         Al               NORMAL     undefined     
  2         Si               NORMAL     undefined     
  3         Zn               NORMAL     undefined     

TERNARY OPTION ? compute !



The result of executing a COMPUTE command within the TERNARY module and returning to the command level by using the graphics sub-command A.


The result of executing a COMPUTE command within the TERNARY module and initiating the calculations using the graphics sub-command F. The initial position of the graphics cursor is indicated by a cross on the diagram.

Changing the starting point for calculations

define data="salts" !
set temperature=875 !
compute !

When the program is given the graphics sub-command F, it begins the calculation at the current cursor position. Further calculations are carried out automatically to derive the boundaries of the immediate two or three phase region and all those which are contiguous with it and each other. The first figure below shows the results of such a calculation and plot; the initial cursor position is shown as a cross.

However, if two or three phase regions are not topologically linked to the current calculated regions the calculation procedure cannot locate them. This results in an incomplete diagram. With experience and intuition, the graphics cursor could be moved into an area where another two or three phase region is suspected and a further series of calculations initiated on the same diagram by again using the graphics sub-command F. The second figure below shows the result of such a recalculation on the first diagram; again, the new position of the cursor is shown as a cross.

The following three figures show similar examples of where the automatic plotting needs to be restarted. These calculations are for the same system but for a different temperature.

When calculating phase diagrams using the TERNARY module it is strongly recommended that the user first calculates the three binary sub-systems perhaps using the BINARY module. Inspection of the binary phase diagrams may reveal that areas of the ternary phase diagram have not yet been calculated as may happen if they are not connected to previously calculated regions.

Phase fields may be labelled using the graphics subcommand L. The cursor is moved to the area of interest and L entered. The phases in equilibrium are then determined and the cursor reappears. If then a second entry of L is made the phase names are written on the diagram at the current position of the cursor. If the phase field of interest is very small, the label may be written outside the diagram by repositioning the cursor before the second L is entered. In the case of single or two phase fields a MULTIPHASE equilibrium calculation is performed to determine the phases in equilibrium, although if a miscibility gap is present there is no guarantee that the correct phase combination will always be found. Phase labelling should therefore be used with caution. Note that if it is intended to replot the diagram from stored tie line information using the REPLOT command, labels should be added only after the plotting of the whole ternary diagram is complete.

TERNARY OPTION ? define data="salts" !

Date and time of run  4-NOV-87  14:41:37
SYSTEM = KCl,CaCl2,ZnCl2,                                                   
NUMBER OF PHASES  =   8                                       
NUMBER OF SPECIES =  10                                       

TERNARY OPTION ? set temperature=875 !
TERNARY OPTION ? compute !



Calculation of the part of the ternary isothermal section of the KCl-CaCl2-ZnCl2 system for 875 K. The calculation of the diagram began with the tie line indicated by the cross. The diagram is not complete and must be restarted to calculate the phase boundaries near the KCl corner of the diagram.


Calculation of the complete ternary isothermal section of the KCl-CaCl2-ZnCl2 system for 875 K. The calculations began as described in the previous figure and were concluded by moving the graphics cursor to the position marked by the cross near to pure KCl. Further use of the graphics sub-command F commences these calculations.


Calculation of part of the ternary isothermal section of the KCl-CaCl2-ZnCl2 system for 910 K. This diagram should be compared with the next two figures which show other phase boundaries for this temperature that are not topologically linked. For a calculation of the complete diagram for this temperature the calculations must be started three times with different cursor positions.


Calculation of part of the ternary isothermal section of the KCl-CaCl2-ZnCl2 system for 910 K. This diagram should be compared with the previous diagram and the next diagram.


Calculation of part of the ternary isothermal section of the KCl-CaCl2-ZnCl2 system for 910 K. This diagram should be compared with the two previous figures.

Examining metastable phases

define data="FeCrNi" !

The system is loaded from a previously compiled datafile.

list system phases !

From experience, it has been found that the sigma phase (Phase 4), forms slowly and it is therefore useful to calculate the phase diagram both with and without this phase included. This can be done through use of the appropriate CLASSIFY command.

set temperature=1100 !
compute !

The first figure below results from the calculation involving all the phases.

classify absent phase(4) !
list system phases !
compute !

The result is given in the second figure.

Table 2.3

TERNARY OPTION ? define data="FeCrNi" !

Date and time of run  4-NOV-87  15:03:51
DATA FILE FECRNI                                                 

TERNARY OPTION ? list system phases !

NUMBER      PHASE            STATUS     MODEL                    
  1         LIQUID           NORMAL     REDLICH-KISTER
  2         FCC              NORMAL     REDLICH-KISTER
  3         BCC              NORMAL     REDLICH-KISTER
  4         SIGMA Sub        NORMAL     SUBLATTICE         

TERNARY OPTION ? set temperature=1100 !
TERNARY OPTION ? compute !


TERNARY OPTION ? classify absent phase(4) !
TERNARY OPTION ? list system phases !

NUMBER      PHASE            STATUS     MODEL                    
  1         LIQUID           NORMAL     REDLICH-KISTER     
  2         FCC              NORMAL     REDLICH-KISTER
  3         BCC              NORMAL     REDLICH-KISTER     
  4         SIGMA Sub        absent     SUBLATTICE         

TERNARY OPTION ? compute !




Calculated ternary isothermal section for the Fe-Cr-Ni system for 1100 K with the sigma phase included in the calculations.


Calculated ternary isothermal section for the Fe-Cr-Ni system for 1100 K with the sigma phase classified as ABSENT.

Calculations with Miscibility Gaps

define data="cufeni" !
list system phases !
set temperature 1323 !

Again the data are loaded from a previously compiled datafile and are provided for three phases - liquid, bcc and fcc. Examination of the binary phase diagrams for the sub-systems has indicated that a miscibility gap may be expected in the ternary system for the fcc phase at the temperature of interest. Normally if the data were retrieved from a commercial database the phase would already have been classified as potentially having a miscibility gap.

class misc(2) 1 !

The number inside the bracket indicates the number referring to the FCC phase. The command specifies that a miscibility gap is potentially present for that particular phase. It is very rare for more than 1 to be needed. To cancel this command subsequently the value NONE should be used ie misc(2)=none.

compute !

Calculations in systems with potential miscibility gaps are difficult and the correct results cannot in this instance be guaranteed. However reliability can be improved by initially  positioning the graphics cursor close to the binary edge where the miscibility gap is expected to be most pronounced - in this case near the Cu-Fe binary edge. Use of a step size smaller than the default may also be advantageous. This problem should also be born in mind when using the labelling graphics subcommand.


As always the command LASER copies the calculated diagram to the local plotting device.

TERNARY OPTION ? define data="cufeni" !

Date and time of run  4-NOV-87  17:11:30
Cu Fe Ni dataset from DMA (A)54              

TERNARY OPTION ? list system phases !

NUMBER       PHASE            STATUS      MODEL
  1          LIQUID           NORMAL      REDLICH-KISTER     
  2          FCC              NORMAL      REDLICH-KISTER
  3          BCC              NORMAL      REDLICH-KISTER     
  4          L12              NORMAL      REDLICH-KISTER     

TERNARY OPTION ? set temperature 1323 !
TERNARY OPTION ? class misc(2) 1 !
TERNARY OPTION ? compute !



Calculated ternary isothermal section for the Cu-Fe-Ni system for 1323 K. A miscibility gap has been classified for the FCC phase and an initial graphics cursor position chosen near the Cu-Fe binary edge.

Plotting diagrams in terms of Weight fraction

define data="fecrc" !
list system phases !
set temperature=1700 !
set w 1 !

The final command entered above sets the total mass to 1 kg and allows the axes to be calibrated in terms of mass fraction. This calibration may be reset to mole fraction (default) by assigning a value to N in the SET command.

compute !

Positioning the cursor inside a probable two or three phase region and using the sub-command F initiates the calculation of the phase diagram.

TERNARY OPTION ? define data="fecrc" !

Date and time of run  4-NOV-87  17:20:55

TERNARY OPTION ? list system phases !

NUMBER      PHASE             STATUS      MODEL                    
  1         GRAPHITE          NORMAL      PURE SUBSTANCE     
  2         LIQUID            NORMAL      REDLICH-KISTER     
  3         FCC               NORMAL      SUBLATTICE         
  4         BCC               NORMAL      SUBLATTICE         
  5         Cem               NORMAL      SUBLATTICE         
  6         Cr3C2             NORMAL      SUBLATTICE         
  7         M23C6             NORMAL      SUBLATTICE         
  8         M7C3              NORMAL      SUBLATTICE         
  9         Sigma             NORMAL      SUBLATTICE         

TERNARY OPTION ? set temperature=1700 !
TERNARY OPTION ? set w 1 !
TERNARY OPTION ? compute !




Ternary isothermal section for the Fe-Cr-C system calculated for 1700 K with the composition scale of the axes in weight fraction.

Replotting a previously calculated diagram

The diagram produced in the previous section is calibrated in mass fraction. One feature of the diagram is that the detail is concentrated near the Fe-Cr binary edge. In order to examine the details of the diagram it is necessary to magnify a portion or portions of the diagram using the REPLOT command. A point in the centre of the area of interest must be chosen and entered as a composition using the SET command. This point will then become the centre of the magnified image on the screen. If no magnification is required it is not necessary to SET a composition.

set w(1) 0.3 w(2) 0.6 w(3) 0.1 !
replot filename "fecrc12.tnr" proportion all
order_of_components 2_3_1 !
replot magnification 1.5 3 !

The numerical results of each ternary diagram are stored in a file which has the same root name as the data input filename, appended with a counter, and followed by the filename extension ".tnr". The filename appropriate to the diagram to be replotted should be entered. If no filename is given the most recently calculated diagram is the one to be replotted, in which case the most recently created results file with filename extension ".tnr" will be taken as the default.

The proportion parameter relates to the proportion of the calculated tie lines to be replotted, and may be all, half or one third of the total number. The latter two possibilities may be useful to "tidy up" a diagram if a large number of tie lines has been calculated.

The order_of_components  gives the positioning of the three components at the corners of the triangle in a clockwise rotation starting at the bottom left corner. Thus "3_1_2" implies that the third component (C) is positioned at the bottom left corner, the first (Fe) at the top of the diagram and the second (Cr) at the bottom right.

If a magnification is required then two numbers greater than or equal to 0.25 must be entered. They refer to the magnification in orthogonal x and y directions respectively.

The input is terminated with ! and a carriage return. The replotted diagram with no magnification input is shown in the first figure below and the magnified diagram in the second figure.

Note that phase labels added after the original calculations using the graphics subcommand L will reappear in the replotted diagram. Further labels may be introduced if required as annotation stored in an experimental data file.

TERNARY OPTION ? set w(1) 0.3 w(2) 0.6 w(3) 0.1 !
TERNARY OPTION ? replot filename "fecrc12.tnr" proportion all
REPLOT OPTION ? order_of_components 2_3_1 !
TERNARY OPTION ? replot magnification 1.5 3.0 !

The ternary isothermal section for the Fe-Cr-C system calculated for 1700 K. The order of components has been rearranged.

The Cr-rich corner of the ternary isothermal section for the Fe-Cr-C system calculated for 1700 K.

Superimposing experimental data

replot filename "fecrni34.tnr" experimental_file "steel1273.exp" !

Experimental data and various forms of annotation may be superimposed on a diagram by defining an experimental file the format of which is described in the appendix.  The diagram resulting from the above commands is shown below.

TERNARY OPTION ? replot filename "fecrni34.tnr"
REPLOT OPTION ? experimental_file "steel1273.exp" !

Calculated phase diagram for the Fe-Cr-Ni system for 1273 K with experimental tie lines superimposed.


Updated 2 July 2010