Computing the equilibrium composition of the ternary system Ba-Cu-Y Evgenii Rudnyi, 1995 (c) All rights reserved Chemistry Department Moscow State University 119899 Moscow Russia rudnyi@mch.chem.msu.su http://www.chem.msu.su/~rudnyi/welcome.html The program is written as a supplementary material to the paper E.B. Rudnyi, G.F. Voronin. Thermodynamic assessment of the ternary Ba-Cu-Y system. Presented at International Conference on Metallurgical Coating and Thin Films, 1995, San Diego and is to be submitted to CALPHAD. Some information about our work availabe at my homepages (see below). The program consists from the single file BACUY_EQ.EXE. SYSTEM REQUIREMENT IBM-PC compatible computer under MS-DOS (version > 4.0?). The program compiled with the Borland 4.0 C++ compiler under the option -1. According to the Borland's manual it should work with processors starting 80186 (it does not work with 8086), but I did not test how it works on 80186 and 80286. It needs about 500 Kb of memory. The more powerful computer the quicker the program. ACKNOWLEDGEMENT International Science Foundation is acknowledged for generous financial support (grant MRL-000). SUPPORT I can be reached at addresses given above. Feel free drop a line if you have a problem. Use -l option to see the license agreement. GENERAL The program takes Gibbs energies of the phases in the Ba-Cu-Y system estimated in our paper and computes equilibrium composition in the temperature range 400-4000 K by minimizing the total Gibbs energy of the system. It employs DONLP (DO NonLinear Programming) subroutine (available at netlib/opt/donlp.shar) developed by P. Spellucci (spellucci@mathematik.th-darmstadt.de) with initial estimates obtained by linear programing. The simplest way of using the program is the form bacuy_eq -i After that enter the total mole fractions of copper and yttrium (point at the Gibbs triangle, xBa = 1 - xCu - xY) and the temperature required. If all goes well the program will give you the equilibrium mole numbers and liquid's composition. MODEL The Gibbs energies of ten solid phases, Ba, Cu, Y, BaCu, BaCu13, Cu6Y, Cu4Y, Cu7Y2, Cu2Y, CuY, and the liquid alloys Ba-Cu-Y were programmed. The gas phase is not included, so the equilibrium composition at higher temperatures corresponds to the case when the mixture is under rather high pressure of the shaft. All the solid phases are considered as "point" phases (no solid solutions). The biggest homogeneous region that was omitted, few mole per cents, is in the case of Cu6Y and Cu4Y. The liquid barium and yttrium don't like each other, so there is a quite large miscibility gap in the melt. Mostly, you will get two liquids at equilibrium with exception of high temperatures and large copper contents. INPUT You must put in at least three values, the point in the Gibbs triangle (two coordinates) ant the temperature. Depending on the mode, these numbers are taken by default from the data file, with -i option from the console, with -c option from the command line. The point in the Gibbs triangle is set by the total mole fractions of copper, xCu, and yttrium, xY. The total mole fraction of barium is computed by the program as xBa = 1 - xCu - xY. You could not enter any total mole fraction less than 0.005 (0.5 mole per cent). The temperature value must lie in the range from 400 to 4000 K. OUTPUT The program computes the equilibrium mole numbers of each phase and the composition (mole fractions) of the liquid phases. The results are written to console (only phases that exist at equilibrium), to a log-file that echo the console output, and to a listing file in the form convenient to draw graphs (results for all the phases, small numbers like 1e-15 means zeros). With -p[1-3] options the original output by DONLP subroutine goes to the files FORT.10 and FORT.20. By default DONLP itself writes nothing. INITIAL ESTIMATES As any numerical minimizer, DONLP needs an initial estimates. To this end, liniar programming technique is employed where the melt is modeled as a lot of the "point" phases. So, first you recieve something like this xBa=0.3, xCu=0.3, xY=0.4 initial LP guesses, T=1100, ier=0, G=-8.28e+04, grids = 50 CuY 0.1258 L1 0.3061 0.9799 0.02 0.0001 L2 0.4422 0.0001 0.38 0.6199 and just then DONLP starts its iteration DONLP results, T=1100, ier=0, G=-8.281e+04 n(mole) xBa xCu xY CuY 0.1401 L1 0.3046 0.9838 0.01619 5.695e-05 L2 0.4151 0.0008625 0.3732 0.6259 If you make several calculations in a single run by default the results from the previous calclulation serve as the initial estimates. Sometimes it gives poor initial estimates and you need the option -e1. Under this option linear programming technique is employed for each calculation. Option -g let you to change a number of "point" phases used to model the melt for linear programming. Actually, I made this option for myself (to study the influence of initial estimates on DONLP), you should not need it. TROUBLESHOOTING Sometimies BACUY_EQ.EXE terminates abnormaly. Note also IER parameter in the DONLP output. If it is not zero, the results are not good. You can do little about it. Just try this composition and temperature with the option -e1. If it does not help, try to contact me. If IER is not equal to zero the program gives as a result the linear programming estimates (if there is no liquid, they may serve as truth). Below is the description of IER from the DONLP manual termination reason has the following meaning: -5: qp-solver did fail (until now this did never occur) -4: computation of stepsize is not tried, because the directional derivative is positive opposed to negative, as it should be. that means a severe error in the computation of the direction. will have the same reasons as the case -1. On some systems, where arithmetic errors are masked, it may also result from leaving the domain of definition of some function, e.g. evaluating a gradient with ln with argument less or equal zero may result in "undefined" which in turn makes the result of a comparison undefined which in turn may result in in this termination. -3: more than ITERMA steps were tried. seemingly, there is "sufficient" progress . if ITERMA is large (as 4000 at present), that means that either the problem is extre- mely badly scaled or extremely illconditioned. check the problem. 30*N is a reasonable upper bound for step numbers to be expected. -2: no acceptable stepsize found. this occurs, if the termination criteria used by donlp are inconsistent with the precision of evaluation of one of the funct- ions or if one of the functions doesn't satisfy the differentiabi- lity requirements assumed. (implicitly donlp assumes c2 at least). in most cases the solution may be useful nevertheless. normally this termination simply results from programming errors in EGRADF, EGRADG or EGRADH or false setting of GUNIT. -1: case 1: X is feasible: a kuhn-tucker point has been found, which doesn't satisfy the mangasarian-fromowitz constraint qualification. therefore there is no equivalence between local minimizers of the l1-penalty function and the local solutions of the problem. solution may be useful anyway. case 2: X is strongly infeasible: the contraints contradict one another locally at least. no feasible point can be found using the current X. 0: precision requirements are satisfied 1: error in kuhn-tucker conditions is sufficiently small 2: directional derivative is in the roundoff level of evaluating f. in most cases a solution of sufficient precision is found. in case of severe illconditioning the precision of X may be poor however. 3: singular case. relaxed precision requirements are satisfied. 4: objective function did not decrease very much over some steps, while simultaneously either the problem is severely illconditioned, singular or numerical gradients are used. continuation seemingly doesn't make sense. 5: X does change only very little while simultaneously the gradients of active constraints are singular. continuation seemingly doesn't make sense. I added the value of IER equal to 9. It means the case of not full rank in the equality constraints. FEW FORMAL WORDS The datafile is supposed by default to have the extension .DAT. File names for output are formed from the datafile by changing the extension to .LOG for a log-file and to .LST for a listing file. File names for DONLP output are fixed to FORT.10 and FORT.20. If the file name under -i and -c options is not set, the program writes to console only. The option -c should be the last on the command line. It is very handy to compute a heating curve bacuy_eq -c .3 .4 800 1200 10 or a cooling curve bacuy_eq -c .3 .4 1200 800 -10 The option -k is designed to see what the Ba-Cu-Y diagram looks like with the Ba-Y interaction parameters from R. Konetzki et al. Z. Metallkunde, 1994, v. 85, N 11, p. 748. Note that under this option only the interaction parameters for Ba-Y are changed (not for Ba-Cu and Cu-Y), so what will be computed with -k parameter should slightly differ from the original results in the Konetzki's paper. Our results for the Ba-Cu and Cu-Y systems are close to Konetzki's. The only big difference is the Ba-Y. It is up to you what you choose.