MTDATA – Phase Diagram Software from the National Physical Laboratory

 

 

 

Home 

News 

Products 


Training and Support 

FAQs 

Links 

Agents 

Other Services 

 

Services 

 


 

Introduction to UTILITY

Worked examples

The intention of this section is to provide a guided introduction to the commands available in the UTILITY module through a series of examples which illustrate their practical use. Commands issued by the MTDATA user are printed in italics and examples are given of any output obtained. The accompanying text contains helpful comments. Sample of the exact output which the user would see upon the screen are given in tables with numbers identical to those of the corresponding subsection heading.


Creating a temporary database and loading data in.

create database="temp" title="Database to test UTILITY commands" !

CREATE_DATABASE sets up an empty database and adds its name to the list of currently active databases held in memory. Unless the UPDATE=YES parameter is used it will not appear on the active list in future MTDATA sessions. Two database files are in fact created. The first is the database itself and is given the file extension ".dbs". The second is an index file and is given the extension ".inx". Both files are essential to the integrity of the database and deleting either one will destroy it. The .inx and .dbs files are created in the current directory unless an explicit path is given to another directory or the "mt-" prefix is used. (The "mt-" prefix is used to point to the main MTDATA directory where the MTDATA code and menu files are kept). The command above will result in the creation of files named "temp.dbs" and "temp.inx" in the current directory. Note that for the database to be set up successfully files with these names must not already exist.

stat

The STATISTICS command displays a list of those databases that are active in the current MTDATA session. Note that no exclamation mark should be entered following this command. An entry should appear in the database list corresponding to the new database (along with those appropriate to any other databases) as follows:

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA    SUBSTANCES    INDEX SATN    PROTECTION
temp             3        1          0            0           T
Database to test UTILITY commands


Note that a "T" is shown in the PROTECTION column to indicate that the database has been given a title. The title itself appears beneath the database name. The SUBSTANCES column contains a zero indicating that no substance data have been loaded in.

load_data file="cdata.loa" !

The command LOAD_DATA is used to load data into a database from an MTDATA data loading file. In this particular case the data loading file is called "cdata.loa". Note that no target database is identified. If this is the case then the last database specified in a successfully executed UTILITY command (ie temp) is used.

Say the file "cdata.loa" contains the data for carbon in Cp format given as the first example in the description of MTDATA data load formats. The command

stat

generates the following output relating to temp:

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA    SUBSTANCES    INDEX SATN    PROTECTION
temp             3        3         1             0            T
Database for testing out UTILITY commands


Note that one data loading event is recorded in the SUBSTANCES column.

Of course the number of data items that can be loaded into a database at any one time is NOT restricted to one. Subject to disk capacity, there is no limit to the number of data items that a single MTDATA data loading file can contain.

The following restrictions apply to databases themselves. Note that the numerical  limits quoted are for guidance only and may differ between MTDATA configurations:

1)    The number of datasets for the same molecular formula but with different phase or isomer names should not exceed about 25. The exact limit depends upon the length of the individual phase or isomer names used.

2)    If too many index records have leading element combinations made up from many different elements "index saturation" could result. The level of index saturation for a particular database can be checked by using the STATISTICS command. The "INDEX SATN" parameter shown has a limit of 400.

modify_database title="Example data for C from Appendix 1" !

The MODIFY_DATABASE command is used to change the title (or password) of a database. Here the title of temp is changed to reflect the new data which have been loaded in.

stat

now shows, for the database temp:

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA    SUBSTANCES    INDEX SATN    PROTECTION
temp             3        3         1             0            T
Example data for C from Appendix 1

return
exit

As in all MTDATA modules the RETURN command passes control up one level to the WHICH MODULE ? prompt. The user may then EXIT from MTDATA or enter another module.

UTILITY OPTION ? create database="temp"
SPECIFICATION ? title="Database to test UTILITY commands" !
UTILITY OPTION ? stat

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA   SUBSTANCES   INDEX SATN   PROTECTION
temp             3        1        0            0           T
Database to test UTILITY commands

UTILITY OPTION ? load_data file="cdata.loa" !

 C

UTILITY OPTION ? stat

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA   SUBSTANCES   INDEX SATN   PROTECTION
temp             3        3        1            0           T
Database to test UTILITY commands

UTILITY OPTION ? modify_database
MODIFY OPTION ? title="Example data for C from Appendix 1" !
UTILITY OPTION ? stat

        M T D A T A   D A T A B A S E   S T A T I S T I C S
DATABASE       INDEX    DATA   SUBSTANCES   INDEX SATN   PROTECTION
temp             3        3        1            0           T
Example data for C from Appendix 1

UTILITY OPTION ? return
WHICH MODULE ? exit


Creating a permanent database.

create database="mydata" title="Sample C data" password="xyz123" update=yes !

The use of the UPDATE=YES parameter in the CREATE_DATABASE command causes a permanent database to be set up. This means that the database list in the MTDATA database configuration file is updated with the new database name. Hence the new database becomes available for use (or active) in future MTDATA sessions.

If the permanent database "mydata" is to contain valuable data then it is a good idea to give it a password as has been done above. The password must be given if the data within the database are to be listed out and if new data are to be loaded in. This gives some protection against accidentally overwriting valuable data.

stat

The STATISTICS command displays the following entry for the mydata database:

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA    SUBSTANCES    INDEX SATN    PROTECTION
mydata           3        1         0             0            PT
Sample C data


Note that a "P" appears in the PROTECTION column indicating that the mydata database is password protected.

load_data database=mydata password='xyz123' fil="cdata.loa" !

Data are loaded into the database from the MTDATA data loading file "cdata.loa". As the database is password protected the correct password must be given. Note that the database name is NOT entered in quotes. This is because it is an existing database known to MTDATA so its name appears in a menu (type load_data database ?) just like any other keyword. In the CREATE_DATABASE command the database name is new and so must be provided in quotes.

modify_data password="xyz123" new_password=" " !

The MODIFY_DATA command is used here to change the password of the mydata database. As it is the last database referred to in a UTILITY command there is no need to repeat its name. The old password must be given before the new password will be accepted. If the new password is blank, as above, password protection is removed from the database.

UTILITY OPTION ? create database="mydata" title="Sample C data"
SPECIFICATION ? password="xyz123" update=yes !
UTILITY OPTION ? stat

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA   SUBSTANCES   INDEX SATN   PROTECTION
mydata           3        1        0            0           PT
Sample C data

UTILITY OPTION ? load_data database=mydata pass="xyz123" file="cdata.loa" !

 C

UTILITY OPTION ? modify_data password="xyz123" new_password=" " !

Listing the contents of a database and changing data

stat

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA    SUBSTANCES    INDEX SATN    PROTECTION
mydata           3        3         1            0             T
Sample C data


list_data database=mydata format names_only !

The LIST_DATA command with the FORMAT=NAMES_ONLY parameter generates a list of those species and interactions for which data can be found in the named database. By default this list comes to the screen as follows:

C

FILE CONTAINS DATASETS FOR     2 UNARIES
                        0 BINARY INTERACTIONS
                        0 TERNARY INTERACTIONS



The list of names (in this case just C) is followed by a summary of the total number of unary and interaction data items in the database. (The true unary count is one less than that shown because a single dummy dataset is written to each database when it is first created.)

list_dat output_file="cdata1.loa" format=data !

A full data listing, in the MTDATA data loading format, can be obtained by specifying FORMAT=DATA_OUTPUT. In this case the data listing is sent to the file "cdata1.loa". The contents of "cdata1.loa" file would appear as follows, except for the date and time of course:

C     E/J     T/K     P/Pa    17:41 16/12/93

   .00000E+00  .00000E+00  5.74000E+00 3            mydata
     
  7.86257E+00  6.45378E 02  4.01342E 05  6.35549E+04  500.000 .0000E+00
  1.33654E+01  1.40896E 02  4.73001E 06  1.15035E+06 1100.000 .0000E+00
  2.56144E+01  2.41417E 04  9.95791E 08  3.96509E+06 5999.000 .0000E+00


This file can be edited, using a text editor, to change any data which the user wishes to modify or to add new data items. The new data can then be re-loaded into the mydata database.

load_data data=mydata file="cdata1.loa" query=overwrite !

The QUERY=OVERWRITE parameter is used to request that the new data in "cdata1.loa" be used to overwrite any existing database entries for the same substance or interaction. This is a sensible course of action when existing data are being modified. If the QUERY parameter were not invoked then the user would be prompted for a decision about whether to overwrite existing data each time a conflict was identified. This could become tedious for a large database.

Note that if the database mydata were password protected then the correct password would have to be given as part of each data listing or data loading command.

list_dat data=mydata password="qwerty" output_file="cdata1.loa" for=data !
load_data file='cdata1.loa' password="qwerty" query=overwrite !

UTILITY OPTION ? stat

        M T D A T A   D A T A B A S E   S T A T I S T I C S

DATABASE       INDEX    DATA   SUBSTANCES   INDEX SATN   PROTECTION
mydata           3        3        1            0           T
Sample C data

UTILITY OPTION ? list_data database=mydata format names_only !
C

FILE CONTAINS DATASETS FOR     2 UNARIES
                               0 BINARY INTERACTIONS
                               0 TERNARY INTERACTIONS
UTILITY OPTION ? list_data output_file="cdata1.loa" format=data !

C     E/J     T/K     P/Pa    17:41 16/12/93

  .00000E+00   .00000E+00  5.74000E+00  3            mydata

 7.86257E+00  6.45378E 02  4.01342E 05  6.35549E+04  500.0 .000E+00
 1.33654E+01  1.40896E 02  4.73001E 06  1.15035E+06 1100.0 .000E+00
 2.56144E+01  2.41417E 04  9.95791E 08  3.96509E+06 5999.0 .000E+00

FILE CONTAINS DATASETS FOR     2 UNARIES
                               0 BINARY INTERACTIONS
                               0 TERNARY INTERACTIONS

UTILITY OPTION ? load_data data=mydata file="cdata1.loa" query=overwrite !
 C

Listing the current MTDATA configuration

limits

The LIMITS command displays the limits of the current MTDATA configuration on the screen, that is to say the maximum numbers of components, species and phases that can be dealt with in MULTIPHASE, the maximum number of species that can be dealt with in ACCESS and the maximum number of steps in MULTIPHASE plots. Typically output appears as follows:

UTILITY OPTION ? limits

                  M T D A T A   L I M I T S

                        MAXIMUM NUMBER OF COMPONENTS =      30
                            MAXIMUM NUMBER OF PHASES =     250
          MAXIMUM NUMBER OF SUBSTANCES IN MULTIPHASE =     500
              MAXIMUM NUMBER OF SUBSTANCES IN ACCESS =    1000
         MAXIMUM NUMBER OF STEPS IN MULTIPHASE PLOTS =     500



Plotting out an MTDATA metafile

Before the PLOT command can be illustrated an MTDATA metafile is needed. The simplest way of making an MTDATA metafile is to capture a diagram plotted using another MTDATA module.

[METAFILE=util25.mta

A metafile can be opened from within MTDATA by entering a [ (open square bracket) character followed by METAFILE= (in capitals) and then the chosen metafile name. If a file of this name already exists it will be overwritten. A <return> is necessary to return to the UTILITY OPTION ? prompt. Note that if the user's command is echoed to the screen without the '[' then it has not been recognised by MTDATA, possibly due to a simple typing mistake.

Every subsequent MTDATA diagram that appears on the screen is captured, in a simple and easy to edit form, in the MTDATA metafile. The metafile continues to accumulate diagrams until it is closed, by opening a new metafile, by leaving MTDATA altogether or on a PC by entering [METAFILE=nul:.

return binary
define data="crni" !
list system=phases !
step temperature=1000 2200 10 !
set n(1) 0.5 n(2) 0.5 t 1010 compute !
return utility

This set of commands are for the BINARY module and generate a binary diagram for the Cr-Ni system. Any diagram would suffice to illustrate the use of MTDATA metafiles. As the metafile "util25.mta" is open the diagram that is produced is captured for possible editing and replotting.

[METAFILE=none

A new metafile is defined so closing "util25.mta".

plot file "util25.mta" !

The PLOT command is used to replot all of the diagrams stored in the named metafile.

A particular value of metafiles is that they can be edited using a text editor so allowing MTDATA diagrams to be modified and then replotted. For more information on MTDATA metafiles see Appendix 2.
 

UTILITY OPTION ? [METAFILE=util25.mta

UTILITY OPTION ? return binary
BINARY OPTION ? define data="crni" !
 DATAFILE = crni.MPI -  CREATED 15:28 31/01/89
 SYSTEM = Cr,Ni,                                                 
 NUMBER OF PHASES  =   5                                    
 NUMBER OF SPECIES =  14                                     

BINARY OPTION ? list system=phases !

SOLUTION PHASES         MODEL NAME
 1    SIGMA             SUBLATTICE
 2    LIQUID            REDLICH_KISTER
 3    BCC_A2            REDLICH_KISTER
 4    FCC_A1            REDLICH_KISTER
 5    HCP_A3            PURE_SUBSTANCE

BINARY OPTION ? step temperature=1000 2200 10 !
BINARY OPTION ? set n(1) 0.5 n(2) 0.5 t 1010 ! compute !

PLEASE PRESS RETURN TO PLOT

BINARY OPTION ? return utility
UTILITY OPTION ? [METAFILE=none

UTILITY OPTION ? plot file "util25.mta" !

PLEASE PRESS RETURN TO PLOT


Updated 26 May 2010