Here is an example macro for use with thermodynamics software mtdata. This script sets up a stepped calculation of equilibrium for a steel composition, it then output a text file of the mass fraction of each phase. Reading the script is made difficult by the use of contracted version of the commands. The first command selects the multiphase modules could have been written ‘mu’ rather than ‘multiphase’. The next command starts ‘def sys…’ is the same as ‘define system’. Note most commands end with an exclamation mark, this is the way to tell mtdata you really mean what you typed.
:Macro file to calculate equilibrium phase fractions
:Mathew Peet and Hala Salman Hasan 20th June 2007
def sys "Fe,C,Si,Mn,Cr,Mo,Co,Al" source plus sub_sgte !
:this is a comment
:uncomment following line to use tcfe database instead
:def sys "Fe,C,Si,Mn,Cr,Mo,Co,Al" source tcfe !
classify absent phase(*) !
classify normal phase(FCC_A1,BCC_A2,M23C6,M6C,cementite,m7c3) !
classify misc(FCC_A1) 1 !
set w 100 !
set w(2) 0.78 w(3) 1.6 w(4) 2.02 w(5) 1.01 w(6) 0.24 w(7) 3.87 w(8) 1.37 !
step temp 773 1373 5 !
:this line is a comment
:following 3 lines output a spreadsheet of phase fractions with temperature
com pri gra !
ord mass phase !
plot tabu spread !
:uncomment line/ type following to see compositions of phases
:compute print brief print mol !
Example output of the above calculation was archived.