gem HELP CONTENTS
Introduction
Working With gem
Quick Start (Important)
Main Sheets
Platform
Charting and Printing
Advanced Usage
StatusStatus of convergence
Projected G (Projected Gradient)
Potential and Activities
Menu References
File
Open Malt File
Malt Direct
Open Project
Save Project
Save Project As
Save As CSV file
Exit
Edit
Cut
Copy
Paste
Fill with Case 1
DeleteSelect All
Copy 4 sheets
View
Platform
Graph
Sorted Output
RunRun
Run 1 Case
Stop Engine
Tool
Command Box
Settings
Colors of Grids
Help
Help
Malt Homepage
About
Command References
Error Message References
Algorithm in gem
Miscellaneous
The difficulty of convergence
Decimal Separator (for some of European users)

Introduction
Introduction
gem for Windows is an upgrade version of gem for DOS. gem stands for Gibbs Energy Minimizer anddesigned to calculate chemical equilibria using MALT data.
There are two calculation modes corresponding to the energy to be minimized, Gibbs mode (to minimize thegibbs energy of the chemical system upon consideration) and Helmholtz mode (helmholtz energy).
gem calculates the equilibrium point by unique convergent algorithm* mainly based on gradient projection
method and backed up by some idea of linear programming.

* T.Matsumoto and H.Yokokawa, Netsu Sokutei, 19(4)(1992)170-173(in Japanese).
The algorithm in English can be seen in gemManual.pdf in CD-ROM or at www.kagaku.com/malt/ .

New Features
gem for Windows has new features in compare with gem for DOS as follows. .
1. gem for DOS can calculate only one equilibrium point under a given condition.
gem can successively calculate equilibrium points for varying parameters. (In this consequent, you canspecify initial mol amount for a compound as the result of previous calculation.)
2. gem has no restriction on the number of elements nor the number of compounds to be included in thecalculation.
3. gem can chart the calculated output data, and print them.
4. gem can save the calculation conditions as a project.
You can restart the calculation under the same conditions later.
5. gem can export the calculated output data to other sheet calculation software (Excel, Origin, etc.) as Tab
Separated Value format.

Working With gem

Quick Start (Important)
As a tutorial, here we calculate Fe-O-S-Cr system under the conditions as follows. Note that MALT should berunning and retrieve Fe-O-S-Cr system before the following operations.
In this tutorial, successive calculation for Cases are described. If the problem is focused on 1 point
equilibrium calculation, however, Platform offers more primitive and easy operation. Anyway, step1 andstep2 are always needed.

Number of cases

9 cases

Calculation Mode

Gibbs

Temperaturefrom 1200K to 2000K step 100K

Initial mole conditions Fe : 9
SO2 : 10
Cr : 1step 1

Execute gem

step 2

Get Thermodynamic data from MALT

step 3

Set Number of cases

step 4

Set Calculation Modestep 5

Set Temperature

step 6

Set Pressure(atm) / Volume(litre)

step 7

Set Initial Mol

step 8Calculatestep 9Chart output data

step 10 Save the Project

step 1

Execute gem

There are 3 ways of executing gem. One is the usual way such as double clicking of gem.exe in file explorer.
gem will appear as Fig.1.
The second way is from MALT menu > tools > gem. In this case, gem will appear as Fig.2 with the compoundsystem currently retrieved by MALT (See step2).
The third way is the one using Windows Start Menu > Execute with file name. Here you can specify the
filename 'gem.exe' as in the one of the followings.

1. Just 'gem.exe', this brings the same execution of gem as the first way.
2. With the switch meaning MALT Direct, 'gem.exe /md', this has the same effect as the second way.
3. With the project file name, which is already saved as a project file (*.gem), 'gem.exe ProjectName.gem' See
Open Project Menu. Alternatively, If you set the linkage between gem project file (*.gem) and gem.exe fileunder Windows, you can perform this by double clicking the project file in file explorer.
Fig.1 : Starting display of gem

step 2

Get Thermodynamic data from MALT

Click Menu: File > Malt Direct or Malt Direct Button in toolbar.
This step is needed only when you choose the first way to execute gem in step1. gem will get the compoundsystem currently retrieved by MALT.
Fig.2 is the display after this command, and alphabets indicated upon the figure will be used in the following
explanations.

Fig.2 : After getting thermodynamic data.

step 3

Set Number of cases

Simply input '9' as the number of cases and enter key into the edit box located in the middle of tool bar (A in
Fig.2).
This operation can be made anytime, but you must fill the data in all cases after increasing the number ofcases.
---Alternatively, you can use NT command from CommandBox.
step 4

Set Calculation Mode

Left click on the 3rd row, leftist column of Cases (B in Fig.2). The letter there is G (means Gibbs mode) or A
(means Helmholtz mode), and is toggled by the click.
---Alternatively, you can use G or A command from CommandBox.
step 5

Set Temperature (K)You can simply input the values into appropriate cells directly. But if the temperature change is regular suchthat it is expressed as initial value and step value, then left click on the 2nd row, the 2nd column where'Temperature(K)' is shown. (C in Fig.2)
A dialog box called Promptform will appear, then input the initial value(1200), comma(,), step value(100),that is, '1200,100' (Fig.3) and click OK button (or enter key). All cells in Temperature row will be filledinaccordance with the initial, step values you set. Step value can be specified two ways, one is usual number
as increment, other is the number with the first letter @ as multiplier. See example and alternative T
command in CommandBox.

Fig.3 : Promptform used for setting Temperature, Pressure/Volume and initial mols.

step 6

Set Pressure(atm)/Volume(litre)

In Gibbs mode, you should set pressure in atm, in Helmholtz mode, you should set volume in litre. The way to
set them is the same as Set Temperature (Left-click on D in Fig.2 ) . In this case, input '1,0' in Promptform forpressure.
---Alternatively, you can use P or V command from CommandBox.
step 7

Set Initial Mol (mol)The way to set them is the same as Set Temperature. Click the cell holding Compound Name to show thePromptform.
The cell on which you do not set any value is regarded as value 0.
---Alternatively, you can use N1, N2 command from CommandBox.
---See Advanced Usage for more sophisticated settings.
****** Important Caution ******
Let the value of initial mol is m, then m should be in the range of:
0.001<m<1000
This restriction comes from numerical dynamic range of calculation, and gem ignore the value less than
1E-8.
For simple reaction, m should be in the order of 1. If the system includes atmospheric gas, however, you can
set larger value than above for the gas (but do not set value larger than 1E+10). To set values so that moving
quantities would be in the above range is right choice.
*** *** *** *** *** *** *** *** *** ***step 8Calculate

Run or Run 1 Case can be used to calculate all cases or specified one case respectively. If you want to cancel
the calculation already started, Stop Engine. When you execute Run 1 Case then you can see Sorted Output
for the case.
step 9Chart output data

You can select the compounds to be charted simply by click on the leftist cell of the compound (E in Fig.2) inCases, Results or Activities respectively. Color dialog box will appear (Fig.4), then choose color in which theline of the compound will be drawn. Click again the cell to cancel the selection. Graph menu will show line
chart for selected compound's mols or activities. See Charting and Printing.
Fig.4 : Specify color for the line of the compound to be drawn in the Graph.

step 10

Save the Project

After these operations, you can save the contents of Cases and the contents of thermodynamic data of thissystem for restarting from the same conditions later.
There are two files to be saved by Save Project, one is *.mcd file which contains thermodynamic data for thissystem, and *.gem file which contains Cases contents and some parameters including mcd file name. Later,
Open Project *.gem file, then you will find the same environment to resume the consideration.
---Note that gem always needs MALT running whether there is mcd file or not.

Main Sheets
Main Sheets consist of Cases, Results, Activities and Monitor.
‘Cases’ is the sheet for settings:
Set Calculation Mode
Set Temperature
Set Pressure/Volume
Set Initial Mol‘Results’ is the sheet for the calculation results in mole of each.
‘Activities’ is the sheet for the calculation results in activities of each compound.
‘Monitor’ is the sheet for the statistics of the calculation such as Status of Convergence, Projected G,
Potential, Enthalpy before/after the reaction, the difference of H, G or A, heat capacity of the whole system,
total mol and activity of each phase. These data are the same as the ones in Platform Engine Monitor Sheet.
See there for details.
********* Toggle display of Status and Cases Temperature & PV *********
You can see Status of Convergence and Projected G in fixed rows of Results, andPotential in Activities.
Click the leftist column of the fixed rows, then the clicked row displays status or the contents of Cases(i.e. Temperature and P or V).

Platform
Platform is showed by Menu : View > Platform.
Platform performs one-equilibrium point calculation, and show detailed information of the calculation.
Platform is automatically utilized by Main Sheets operation: Run and Run 1 Case.
Besides, Platform itself can be used as a calculation unit with user interface which has capability tohandle detailed attributes of the data, that is, the available range of temperature for the data of thecompound.
By Main Sheets operation, extrapolated thermodynamic data will be used when specified temperature
exceeds the available range of data for all compounds.
By Platform operation, you can choose whether to include the compound in the calculation system using
extrapolated data, or reject the compound out of consideration when the temperature exceeds the range.
The right side of Platform has a collection of buttons, edit boxes, radio buttons so that you can set calculation
conditions and calculate one case and finally display sorted output by Platform itself. For text box and stop
button located right-bottom, see Engine Monitor Sheet.
There are 4 sheets in Platform.
Main Operation Sheet
Stoichiometry Sheet
ThermoData SheetEngine Monitor SheetFig.5A : Platform / Main Operation Sheet

Main Operation Sheet'Initial' column corresponds to Cases, 'Last' column to Results, and 'Activity' to Activities. So input mol value
in Initial, calculation output will be in Last and Activity column.
You can choose whether to use extrapolated thermodynamic data or reject the compounds out ofconsideration when specified temperature exceeds available temperature range of the compound (thetemperature ranges are showed in the column having title 'Database and Temp.Range', unit is always K).
The column having title 'ex' provides the place for the choice. Place '*' in the cell, then the compound will
always be taken into account with extrapolated data if needed. Place '' (delete the cell content), then thecompound will be out of consideration when specified temperature exceeds the range.
If you want to change all the cells in 'ex' column, click the title cell. the click switches all the cells on/off.
You can tell whether the data is in the available temperature range or not by looking for the Phase Number
which is in the column having title 'No'. If it is 0, then the data is in the range, in other words, the data ofstable phase for that temperature are taken. If the number n is greater than 0, then the temperature exceeds
the available range of data, and the data of the n-th phase will be extrapolated to the temperature if you
want to take the compound into account.
See also Sorted Output
Stoichiometry Sheet
The elements and stoichiometry coefficients for all compounds are shown.
ThermoData Sheet
Thermodynamic data of the compounds in specified temperature are shown. Note that they are different
from direct readings from MALT display. This is justified by the fact that in thermodynamic calculation, thebase level of the system can be arbitrarily taken (see documents of MALT for details).

Engine Monitor SheetEngine Monitor Sheet shows details for 1 equilibrium calculation.
Fig.5B : Platform / Engine Monitor Sheet

Explanation of the Platform / Engine Monitor Sheet A Status of convergenceA

Status of convergence

B

Calculation Mode (Gibbs or Helmholtz)

C

Projected G

D

Chemical Potential

E

The thermodynamic values for the system are shown.
1. H1,H2,Delta-H
Enthalpy of the whole system in Initial condition is H1.
Enthalpy of the whole system in Last condition (after calculation) is H2.
Delta-H = H2-H1
2. Cp-system
Specific heat of whole system in Last condition at constant pressure.
In Helmholtz mode, Cv-system (specific heat at constant volume) will behere.
3. Delta-G
The differences of Gibbs Energy of the system between before and after
calculation.
In Helmholtz mode, Delta-A (Inner Energy) will be here.

4. Volume
In Gibbs mode, the volume of GAS phase is calculated.
In Helmholtz mode, the pressure is calculated.
Note that the items in E are not calculated if partial pressure of some compound is
set for the calculation.
F

This text box shows the progress of the calculation for convergence. Round number
indicates inner calculation rounds made. If this number exceeds Number for Too
Many Rounds (Default is 100), calculation will be terminated automatically. The
value below the Round number is an index for convergence. If this value goes close
to 1E-4, the calculation reaches the convergence well.

G

Stop button
Clicking this button has the same effect as Stop Engine

H

Calculation Log
Information or messages from calculation module are accumulated in this Log. Someof error messages are also logged here without interrupting consecutive calculations
for Cases.
If partial pressure setting exists as calculation condition, following message will beshown: Partial Pressure of (Compound Name) is fixed at xxxx (atm).
If this setting could not be achieved, then the message will be *Failed : Partial
Pressure of (Compound Name) is fixed at xxxx (atm).
For other messages, see error messages.

The items here in EngineMonitor sheet can be seen in Monitor sheet of Mainform after RUN execution.

Charting and Printing
You can chart any of input conditions (Case number, Temperature Pressure/Volume, initial mole of eachcompound) and output results (mole or activity of each compound) by Graph menu, and print the chart toprinter. See Quick Start for how to select the compound and draw the line.
Fig.6 : Graph****** Important Caution ******
Although you can select horizontal caption out of any items in combo box, the true horizontal axis is always
Cases. The caption is merely made by the item name and its values of initial/final cases. So the user is fully
accountable for its reasonability of his selection.
The lines between the case points are simply drawn to join them for visuality, and not reflect actual
calculation on those intermediate points. So you should not regard them as representing actual state at all,especially the section includes a boundary of the existence of a compound.
Since program will adapt the whole size of graph to the form size or paper size, and X-Axis and A-Axis havedifferent origins, apparent aspects of the curves (Results vs Activities) may vary when the form is resized orprinted.
*** *** *** *** *** *** *** *** *** ***In the graph, left side vertical scale is linear scale for mol values of Cases and Results, right side verticalscale is log scale for activity values of Activities. You can read either value by cursor indicator which appears
if you check the checkbox located right below of Graphform. There are two combo boxes called Xscale andAscale to adjust scale for them. In Xscale, you can specify the number of pixels used to display 1 mol inheight.
Similarly in Ascale, the number of pixels used to display 1 (logA) can be specified.
The chart is drawn by metafile, saved as *.wmf file and print as metafile.
You can customize the appearance of the graph by 'Appearance' button which shows Appearance form (Fig 7).

Fig.7 : Appearance form

Title

The contents of this edit box will follow the project name in top centerof the graph.

Line Width for Axis
Line Width for Data
Point Size
Font Size(approximate font height in dots )These 5 parameters can be set for display and for printers
independently. Since printers have much more dots than display,these independent tunings are practical.

Tick Length
Scale Factor for Save File

Windows Metafile(*.wmf) itself is scalable in nature. It has, however,the properties of height/width as boundary rectangle. This factor willcontrol the size of it. If you select '2' , then the height property of the
Metafile is twice as the height of displayed image (dots).

Advanced Usage
In Cases, you can use some special syntax as to specify initial mol value.
♦ Input the letter 'r' or 'R' directly into cells as initial mol instead of usual numeric value, then program will
regard that as the result mol value of the previous case. Note that this syntax is not available in
Promptform and CommandBox. About this usage and how it is employed in actual research, see *1.
♦ In Helmholtz mode, you can set up initial cell so that partial pressure of the compound (it should be gas)
would become the specified value in final equilibrium state. For example, input 'PP0.1' into initial cell for
setting the final partial pressure of that compound as 0.1 atm. Alternatively, Promptform or CommandBox
can be used.
Note that this setting is possible only for gas and calculation mode should be Helmholtz. Moreover, thecalculation does not always achieve this condition. See Settings. This setting is also available in Platform.
♦ From CommandBox, you can modify the phase of certain condensed compounds so that they form an ideal
solutions altogether. gem prepares such ideal solution phases up to 30. Each phase can contain any
number of compounds which are originally defined as condensed matter. Also, you can change such
solution phase to condensed phase, vice versa. These settings can be done only by CommandBox.
*1 H.Yokokawa, S.Yamauchi and T.Matsumoto, Thermodynamic Database MALT for Windows with gem and
CHD, Calphad, 26(2002) 155-166.

Status
Status of convergence
The 4th row of Monitor Sheet displays the status of convergence. This will be any of the followings:
Converged : The calculation of convergence is well finished.
Too many round : The number of calculation round exceeds 'Number for Too Many Rounds (Default is 100)'
without good solution. The result may not have small enough projected G.
Stop : The calculation was stopped by user.
Also you can see the Status of convergence in the 2nd row of Results Sheet by clicking the leftist column ofthe row.

Projected G (Projected Gradient)
Projected G shown in the 5th row of Monitor Sheet is the norm of the projected gradient vector of G or A of
the system. The projection is made into the space which satisfies mass-balance equation. The smaller
Projected G is, the more precise the solution is. If projected G < 1E-3, you can rely on the solution as goodenough.
Since the calculation algorithm does not use this projected G as a criterion of convergence for saving time,
this value confirms the convergence.
Also you can see the Projected G in the 3rd row of Results Sheet by clicking the leftist column of the row.

Potential and Activities
The 6th row of Monitor Sheet shows Potential information.
Definite: Each element's (component's) chemical potential is definite.
Indefinite: Each element's (component's) chemical potential is indefinite, or Projected Gradient > 1.
If each element's chemical potential is definite as L1,L2,…,Ln, then A:the activity of a compound is derived
fromµ0 + RTln(A) = a1L1 +a2L2+ … +anLn
Here,µ0 : Chemical potential of the compound at the Temperature and 1atm.
aj : Stoichiometry coefficient of the compound for element j.
For gaseous compound, this activity expresses partial pressure (calculation is based on ideal gas) of the gas.
Note that even if all gaseous compounds result in 0 mol in the calculation, non-zero value of activity will beshowed for each gas if potential is definite. This means vapor pressure. You will know that the gases could
not appear because the sum of their activities does not reach the outer pressure.
For condensed compound, the activity is 1 if it appears. The closer to 1 the activity is, the more likely thecompound appears when temperature or pressure/volume changes.
If the potential is indefinite, the value of activities is simply calculated as partial pressure for gaseouscompounds. For condensed compound, '----' will be showed but it is also true that the activity of depositedcompound is 1.
Whether potential is definite or indefinite depends on a set of compounds finally exists. This theme requires
the details of algorithm, and is beyond this help.
Also you can see the Potential information in the 2nd row of Activities Sheet by clicking the leftist column ofthe row.

Menu References
FILE
Open Malt File

Shortcut : Ctrl + M

The Open Malt File menu is used to load Malt Direct file (*.mcd). This file should be saved by Save Projectmenu previously.
Malt Direct

Shortcut : Ctrl + D

The Malt Direct menu gets thermodynamic data of all the compounds currently being selected by MALT.
Therefore, MALT should be running and retrieve some chemical compounds as a system to be considered
before the Malt Direct menu issues.
*Note: Since this menu uses clipboard, the contents previously set in clipboard will be lost.
Open Project

Shortcut : Ctrl + O

The Open Project menu is used to load a project file (*.gem) through a standard Windows file open dialog
box.
See Save Project.
Save Project Shortcut : Ctrl + S
The Save Project menu is used to save the contents of the current conditions to disk file (*.gem and *.mcd
if Malt Direct file exists).
Please note that the Save Project menu saves only the contents of Cases, some setting parameters and if
the data are taken through Malt Direct menu, thermodynamic data file (this is separately saved as*.mcd) . The Save Project menu does not save any calculation results that are easily recalculated after
loading the project. The saved file(*.gem) is a text file so that you can see the contents of it by usual text
editor.
See Open Malt File , Open Project.
Save Project As

Shortcut : F12

The Save Project As menu is used to save the current project to disk using a new filename. A standard
Windows file save dialog box will appear so that a new name can be specified. The old project will remain
on disk under its old name (except when an untitled 'project' is being saved), and the current project will
be saved to the new name provided. gem will then record the project's new name so that all the future
save operations are made to the new name.
The saved contents are the same as that of Save Project menu.
Save As CSV file

Shortcut : Ctrl+F11

The Save As CSV file menu is used to save the current contents of Cases, Results, Activities and Monitor
altogether as CSV (Comma Separated Values) file. This file can be read by Excel and you can see the 4
sheets of gem in 1 sheet of Excel.

Exit

Shortcut : None

The Exit menu is used to close gem and end your calculating session. If unsaved changes have been madeto any project file a dialog box will appear for such file to alert you to this condition. You will then be able
to choose whether to save the changes before exiting, exit without saving, or cancel the Exit request
altogether.
You can quickly tell whether a project file has unsaved changes by looking for Save Project Button in thetool bar, although it is sometimes oversensitive.

EDIT
Cut

Shortcut : Ctrl + X

The Cut menu removes the selected text from the current control and places it on the current clipboard as
text.
If the current control is a grid, then the clipbord text is formatted by Tab Separated Value format, that is,each cell content in a row is joined by TAB(#9) code and each row content is joined by CRLF(#13#10).
This format (Note that this is not a private clipboard format. Clipboard format is still simple text) enables
to paste the clipboard contents into spread sheet of any software which support this format(Excel, Origin,most of other such software including gem itself).
Copy

Shortcut : Ctrl + C

The Copy menu copies the selected text in the current control onto the current clipboard. If the current
control is a grid, see Cut .
Paste

Shortcut : Ctrl + V

The Paste menu inserts the text from the current clipboard at the location of the text cursor in the current
control.
If the current control is a grid and clipboard text includes Tab and CRLF codes then the contents are
regarded as cell texts (see Cut ) and spread over appropriate selection area of the grid. If the size of copiedarea and paste area are inconsistent, then 'Size mismatch' message will be showed.
If the numbers of Tabs in rows are different by rows, then 'Wrong format' message will be showed.
Fill with Case 1

Shortcut : Ctrl + F

The Fill with Case1 menu fills every case column in Cases with the contents of Case1. This menu isuseful when you spread cases to large number and must set the initial values on them. First, use thismenu to fill all case area with Case1 content. Then set the values only on changing parameters byappropriate method (see Quick Start or CommandBox ).
DeleteShortcut : Ctrl +Del for the selection area of Grid
'Del' is available except above, although 'Ctrl+Del' can be used as general.

The Delete menu deletes the selected text from the current control. If the control is a grid, then thecontents ofcells in the selected area will be deleted.
Select All

Shortcut : Ctrl + A

The Select All menu can be used to quickly select all text within the current control. If the current control
is a grid, then the selection area includes all cells in the grid including fixed row and columns.

Copy 4 Sheets

Shortcut : Ctrl+Alt+C

The Copy 4 Sheets menu is used to copy the current contents of Cases, Results, Activities and Monitor
altogether into clipboard as Tab Separated Values. Then you can paste these 4 sheets into 1 sheet of Excel.

VIEW
Platform (as menu)

Shortcut : Ctrl + P

The Platform menu shows Platform. Platform window is created when the application gem executed, andhas 4 states during all operations of gem. In any state, Platform is working as the core of calculation.
1. Invisible at all
Platform is invisible, but it works in the back.
2. Visible but Inactive
A portion of Platform window can be seen in the back of other windows, but it works and you can see
the cell value changing during calculation.
3. Active Window
Platform is visible and active window.
4. Docked in page control
Platform is dockable window into Main Sheets, and if you drag Platform window close to Main
Sheets, then it becomes additional sheet of Main Sheets. Double click the tab of Platform sheet when
you want to bring it back to Window style.
Fig.11: Platform docked in Main Sheets

The platform menu shows and activates Platform window (if it is not docked in Main Sheets) or activatesPlatform sheet in Main Sheets (if it is docked).
Graph
Shortcut : Ctrl + G
The Graph menu shows Graphform which can chart and print the calculation results. Graphform window
is created when the application gem executed, and has 4 states during all operations of gem.
1. Invisible at all---Graphform is invisible.
2. Visible but Inactive---A portion of Graphform window can be seen in the back of other windows.
3. Active Window---Graphform is visible and active window.
4. Docked in page control---Graphform is dockable window into Main Sheets, and if you drag Graphform
window close to Main Sheets, then it becomes additional sheet of Main Sheets. Double click the tab ofGraphform sheet when you want to bring it back to Window style.
The Graph menu shows and activates Graphform window (if it is not docked in Main Sheets) or
activates Graphform sheet in Main Sheets (if it is docked).
Sorted Output

Shortcut : None

The Sorted Output menu shows new Sortform which sorts the result of specified case in the order of phaseand result mole of each compound (downwards). You can create any number of Sorforms by this menu.
The Sortform is lost entirely when it is closed.
Note : You should use this menu after execute Run 1 Case for specified case. Otherwise, you will see
the sorted output of the latest calculation regardless of what case is highlighted in Main Sheets.
You can edit text area in the top of Sortform, and Save/Load the contents of the text and grid in usual way
as *.srt file. Also, the contents can be printed to a printer.
Fig.31: Sortform

Explanation of the Sortform A Status of convergenceA

Status of convergence

B

Projected GC

Potential

D

This asterisk means that the compounds are taken into calculation even if thetemperature is beyond the available temperature range for the data of thecompounds.

E

These compounds are out of consideration because the temperature is beyond theavailable temperature range for the data of the compounds, and extrapolation
settings are off.

See also Platform.

RUN
Run

Shortcut : Ctrl + R

The Run menu executes the equilibrium calculation all through the Cases, and writes the results to
Results and Activities.
Run 1 Case

Shortcut : F8

The Run 1 Case menu executes the equilibrium calculation only for specified case, and writes the result tothe corresponding place in Results, Activities and Monitor sheets. You can select the Case by clicking the
top row which shows the case number.
Stop Engine

Shortcut : Ctrl + F8

The Stop Engine menu stops current calculation. The result of current case whose calculation is stopped
halfway by this menu has the status of 'Stop' and may have large Projected G. You can not rely on such
result.

TOOL
CommandBox

Shortcut : Ctrl + B

The CommandBox menu shows CommandBox which stays top of other windows of gem.
CommandBox is a tool which can be used as an alternative way to set initial conditions.
Uppercase letters are the Command and lowercase letters denote numerical values.
Use period as decimal separator.
Comma can be replaced by space.
COMMANDDESCRIPTION

L

Lock (Key input on Main Form is transferred to CommandBox).
This is useful when you set initial mol, etc from CommandBox.

U

UnLock.

G

Gibbs modeA

Helmholtz mode

NT,nSet Number of cases at n

T,t

Set Temperature at t(K) in current case and PlatForm.

T,t,step*1
P,p

Set Temperature in all cases from t(K) with increment: step.
Set Pressure at p(atm) in current case and PlatForm.

P,p,step*1
V,v
V,v,step*1
n1,n2

n1,n2,step*1n,PPpn,PPp,step*1

Set Pressure from p(atm) with increment: step(See below).
Set Volume at v(litre) in current case and PlatForm.
Set Volume from v(litre) with increment:step(See below).
Set n2(mol) as the initial quantity of the n1-th compound in current case and
PlatForm.
Set the initial quantity of the n1-th compound from n2(mol) with increment: step (Seebelow).
Set the Partial Pressure of the n-th compound(gas) at p(atm) in current case and
PlatForm.
Set the Partial Pressure of the n-th compound(gas). from p(atm) with increment: step
(See below). try 3,PP0.1,@0.1 (Note that space cannot be inserted between PP and
0.1 )

AC

Clear Result & Activity Grids except Fixed Area.

CL,nClear the initial quantity settings of the n-th compound.

CP,n,PhaseName*2 Change Phase name of the n-th compound (not GAS) to PhaseName (string)Q

Quit the program.

*1 step is usually set as increment [Tn+1=Tn+step], but can be used as multiplier [Tn+1=Tn*step] if thestep begins from @. Try the following two commands: T,1000,10 and T,1000,@1.1 step in other commands
works in the same way.
*2 PhaseName should not be 'Gas'. If PhaseName begins 'Condensed', then the compound is treated ascondensed phase in succeeding calculation. Otherwise it is regarded as the name of an ideal solution(mixture) phase. PhaseName can contain upper/lower case letters either, for the program is indifferent tothe cases.
Settings

Shortcut : None

The Settings menu shows Settingform where you can set following parameters.
Initial value(mol) for Partial Pressure Settings (Default is 1E+3)
When you set initial value of some compound as partial pressure in Helmholtz mode, programautomatically use this value as initial mol value to be supplied. Note that even if this large value is
supplied, calculation may fail to achieve specified partial pressure for the specified gas compound in
unreasonable settings.
Number for Too Many Rounds (Default is 100)
Calculation of convergence for 1 equilibrium point will be stopped when the number of rounds
calculation made goes beyond this parameter without success of convergence.
See Status of Convergence. You can try more calculation rounds to achieve the convergence byincreasing this parameter. See also the Difficulty of convergence.

Colors of Grids

Shortcut : None

By the Colors of Grids menu, you can customize colors of each grid in Main Sheets and Platform. Thismenu shows a dialog box as "Color palette popup menu in Grids?" After "Yes", color popup menu appears
as the menu of right-click on each grid. Then you can specify the area in the grid and change its color.
Changed colors are saved in the project by Save Project.
To go back to usual right-click menu, select the Colors of Grids menu and click "No" button.
*The colors of Monitor grid in Mainform are the same as Engine Monitor grid in Platform, and Case Colorof Monitor grid is the same as the one of Cases grid. Please specify them.

HELP
Help

Shortcut : F1

Help is available at any time within gem by pressing F1.
Malt Homepage

Shortcut : None

The Malt Homepage menu shows Malt homepage if your PC is connecting to the INTERNET.
About

Shortcut : None

The About menu shows AboutBox which shows current version of gem , and the copyright information.

Error Message References
Error Messages
Abort--Too Many Loop in a convergence cycle
The calculation is confined in an inner routine. This is a fatal error for the algorithm.
The calculation should be made under the other conditions.
Can not be changed to GAS.
In CP (Change Phase) command, you can not specify the 'gas' phase.
Compound n Invalid number
Illegal numeric expression for initial mol of the n-th Compound.
Compound n is out of consideration.
The n-th compound is out of consideration, so you can not set initial mol on it.
Compound n Partial Pressure Settings are Invalid under Gibbs Mode.
The n-th compound : Partial Pressure Settings are available only under Helmholtz Mode.
Compound n This Phase cannot be set Partial Pressure.
Partial Pressure setting is available only for gas species.
MALT I/F Error<FunctionName#n>ErrorCode=m
MALT Interface Error
In any case below, contact Kagaku Gijutsu-Sha.
For reference only.
MALT I/F Error<FunctionName#n>ErrorCode=m
FunctionName :Initialize
GetThermoData
GetStoichiometry
GetNameRangePhase#n : n is code identifier in the program.
m : ErrorCode
0 : Normal
3 : MALT has not yet any compound handle, failure of initialization
4 : not initialized yet
5 : compound handle is not specified
6 : the compound handle set is zero or more than the number of available compounds
7 : the compound handle set is different from the currently specified handle
8 : there is an error in specifying temperature
9 : specified temperature is out of range (for the case of PhaseNo=0; specifying stable phases)
10 : specified temperature range number is out of range (for the case of no existence of specified number
by CL)
11 : there is an error in number of calculation temperatures or in number of compounds set by CH
12 : the size of data buffer area is too small
Malt Interface File is not Opened yet
gem has not yet opened project file nor mcd file nor MALT Direct.

Mass Balance Error
No reaction can be made under current settings by the restriction of the law of conservation of mass. For
example, let the system contain only H2O(gas), H2O(condensed) and OH(gas), and set the initial mol of OH
as 1. In this case, reaction can not take place because a part of OH can not become H2O while keeping thelaw.
No Reaction
This is trivial case for no reaction.
Number of Mixture Phase can not exceed 30
Number of Mixture Phase can not exceed 30. Make less of them.
R cannot be used in the first case
Since 'R' means result of previous case, you can not use 'R' (or 'r') in the first case as the initial mol
quantity.
Range Error n1<Parameter's Name<n2
The Parameter should be in the range between n1 and n2
Size mismatch
In pasting some data from certain selected area in a grid to another grid, this message will occur when thesize of the selected area copied is not in accordance with the size of selected area to be pasted.
Some Compounds are fixed.
When the system includes the compound which has no reaction with others such as Argon gas, thismessage notifies it. If it is OK, then you can continue the calculation.
This phase can not be specified.
In CP (Change Phase) command, you can not specify gas phase compound.
In PP (Partial Pressure) command, you can specify only gas phase compound.
Wrong format of matrix
In pasting some data from certain selected area in a grid to another grid, this message will occur when thenumber of cells counted by TAB and CRLF in the clipboard text is not a multiple of the number of rows
counted by CRLF in the text.
This case sometimes occurs when you try to copy some area in Excel and paste them to gem because Excel
is using somewhat memory-saving clipboard format if the right-side cells are containing nothing. In suchcase, please copy & paste each column or row respectively.
Zero for the Element 'ElementName'.
All of initial values of the compounds including this element are zero. If it is OK, you can continue thecalculation.
Zero System
All initial values are zero.

Algorithm in gem

The Algorithm used in gem for calculating the minimum point of G,
Gibbs energy of the system.

A unique algorithm has been developed for gem in order to solve chemical equilibrium problems in general.
This algorithm is mainly based on the gradient projection method with aids of some concepts in linear
programming. This algorithm neither needs any estimated initial values other than derived values fromthe input quantities for reactant mole numbers, temperature and pressure (or volume), nor passes
unreasonable states in which mass balance equations will not be satisfied. Therefore, this leads to excellent
stability in finding the solution.
1. The problem
Let the system consist of n compounds and m elements. Then, the problem can be described as:
Minimize the Gibbs energy of the systemnnn
G = ∑(gi/RT)Xi + ∑Xi ln (Xi P/ ∑Xj )
i=1
i=k
j=K

(1)

where xi: the quantity of the i-th compound (mol)the 1st to (k-1)th compounds are condensed,
and the rest of compounds are gaseous.
P: Pressure (atm)
T: Temperature(K)
R: Gas constantgi:Standard Gibbs formation energy of the i-th compound at temperature T
ln : natural logarithm
subject toa11x1+a12x2+…+a1nxn=b1
a21x1+a22x2+…+a2nxn=b2

(2)

…

…
am1x1+am2x2+…+amnxn=bm
and
xi ≥0 i=1, ..., n
(3)
where
aji: stoichiometry coefficient of the i-th compound for the j-th element
We will use vector notation, and use primes (') to indicate the transposes of vectors and matrices.
Equations (2) can be written as

AX'=B
where
X = [x1,x2, …, xn]
A=

A1
A2 =
.

Am

(2)

a11, a12, …, a1na21, a22, …, a2n…

…

am1, am2, …, amn

B is constant vector which is given by initial quantities in the system.

The steepest descent vector of G is-gradG = － [∂G/∂xi]
We will use this vector and find the minimum point of G under the constraints of(2) and (3). Here, we assume the G is convex in all area defined by (2) and (3).
2. The gradient projection method
If we project the vector -gradG into the space that satisfies (2), the moving point along that direction isalways satisfying the mass-balance law. Let {Ai} be the space spanned by the vectors A1, ..., Am, and S
be the space which satisfies (2), then {Ai} and S are the orthogonal complement of each other. In otherwords, if we subtract the components which belong to {Ai} from -gradG, the resultant vector belongs to S.
Hence we first transform the vector series Ai into the orthogonal vectors Li by the Gram-Schmidt
orthogonalization.
Then, we obtain the vector Q as a result of the subtraction of the Li components from -gradG.
3. One stage of calculation for convergence
The initial point of calculation x0 is given as the quantities of input materials, and we derive the vector Q
as above mentioned. The next problem is how far the point should move along that direction. We canderivec = QQ '/QHQ ' where H=[∂2G/∂xi∂xj](4)and adopt X= X0+cQ as the next point based on the ordinary principle of the steepest descent method.
This point is, however, either over-going or short-going in general. In order to examine which situationis the case, we make the inner product of -gradG at X and Q. If the inner product is negative, the point isover-going, so that we will adopt some inner point between X and X0. If positive, we will go farther.
In the present algorithm, an inter(extra)polating coefficient for each case is given as functions of c, Q andr, which will be described later. By successively applying this method, we finally obtain the point on thisdirection as the next point where the norm of the inner product is less than an appropriate thresholdvalue.
4. Linear programming
In principle, the gradient projection method is the core of this algorithm. However, we cannot always
move along the direction of Q because of non-negative constraints (3). Moreover, if we handle all variables
equally at a calculation stage, there would be some problems arisen from the fact that each variable has
the value of quite different order.
In order to avoid this problem, our program has employed some concepts utilized in the linear
programming. In the linear programming, the movement of point on the convex polyhedron is restricted
such as the point should go to the adjacent point only at a calculation stage. That is, the space in which
the point is movable in a calculation stage is restricted within one dimensional space including the point.
In our program, the space is being restricted in one dimensional subspace of S. Actually, we make one
calculation stage under the condition that (n-m-1) variables out of n variables are regarded to be fixed as
constant.
In the next stage, the variable which has the smallest value in the resultant variables is fixed and we take

into account the oldest variable which has been fixed earlier.
Initially, the bigger variable will be served earlier.
For the non-negative constraints, let

r=min{xi/|qi| : qi<0} where [qi]=Q(5)

and when r is smaller than c in (4), we use this r value instead of c in order to avoid negative variables.
In the case of r=0, no calculation is made at the stage and the variable xi which is 0 and qi <0 will be fixedin the next stage.
This calculation is iterated until the difference of each variable over n-m successive stages becomes lessthan 1/10000 of the value.
To confirm that the point satisfies the condition of minimum, the program outputs the norm of the
projected gradG (for i : xi >0 ) on S. The smaller value indicates that the solution can be regarded as more
precise.

Miscellaneous
The difficulty of convergence
In Gibbs mode calculation, by the nature of the algorithm, it is sometimes difficult to achieve convergenceparticularly in the case that gas phase is about to appear but not yet.
For such critical cases, it is recommended to calculate in Helmholtz mode. Then you can tell whether the gas
phase will appear or not by comparing the sum of activities (vapor pressure) with outer pressure. Note thatin this calculation you should set the volume small enough for the condensed phase to be left some amount in
Last condition. Anyway, in Gibbs mode calculation, gem will face theoretical difficulty when all species are
zero in the mixture phase. gem tries to evade such calculation but the evasion is not strict, so it is better toinspect the situation by Helmholtz mode calculation.
If you encounter the case that a mixture phase results zero in Gibbs mode while Helmholtz calculation
predicts the phase should appear, please inform Kagaku Gijutsu-Sha of the case with its detail. We will keep
it for future reference.
The same difficulty will be occurred for mixture phase in either Gibbs or Helmholtz mode.
One way is to increase Number for Too Many Rounds (Default is 100).
The other way is to fluctuate the initial conditions (Temperature, mol, P/V) . You would know what happens
around there.

Decimal Separator (for some of European Users)
Period is used as decimal separator within gem.
Please use period instead of comma as the separator.