Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New equilibrium tests #103

Closed
richardotis opened this issue Jun 22, 2017 · 34 comments
Closed

New equilibrium tests #103

richardotis opened this issue Jun 22, 2017 · 34 comments
Assignees
Milestone

Comments

@richardotis
Copy link
Collaborator

richardotis commented Jun 22, 2017

While working on solver improvements I came across a few phase diagram points that kept failing even when the test suite would pass. These should probably be added to the suite.

db_alzn = Database('alzn_mey.tdb')
my_phases_alzn = ['LIQUID', 'FCC_A1', 'HCP_A3']
equilibrium(db_alzn, ['AL', 'ZN', 'VA'] , my_phases_alzn, {v.X('ZN'):0.04,
                                                       v.T: 400, v.P:101325}, verbose=True)
equilibrium(db_alzn, ['AL', 'ZN', 'VA'] , my_phases_alzn, {v.X('ZN'):0.7+1e-12,
                                                       v.T: 730, v.P:101325}, verbose=True)
equilibrium(db_alzn, ['AL', 'ZN', 'VA'] , my_phases_alzn, {v.X('ZN'):0.48,
                                                       v.T: 560, v.P:101325}, verbose=True)
equilibrium(db_alzn, ['AL', 'ZN', 'VA'] , my_phases_alzn, {v.X('ZN'):0.3,
                                                       v.T: 620, v.P:101325}, verbose=True)
equilibrium(db_alzn, ['AL', 'ZN', 'VA'] , my_phases_alzn, {v.X('ZN'):0.22,
                                                       v.T: 580, v.P:101325}, verbose=True)
@richardotis richardotis added this to the 0.6 milestone Jun 22, 2017
@richardotis richardotis self-assigned this Jun 22, 2017
@bocklund
Copy link
Collaborator

bocklund commented Jun 23, 2017

This isn't directly related to solve_eq_at_conditions because it doesn't even get to an equilibrium calculation. Changing the starting values of the starting Al concentration seems to make it work sometimes.

database_file = '/Users/brandon/Box Sync/databases/literature/Al-Cu-Zr_Zhou.tdb'
from matplotlib import pyplot as plt
from pycalphad import Database, equilibrium, variables as v
dbf = Database(database_file)
phases = list(dbf.phases.keys())
comps = ['AL','CU','ZR','VA']
conditions = {v.X('ZR'): 0.4, v.X('AL'): (0,1,0.04), v.P: 101325, v.T: 1373}
equilibrium(dbf, comps, phases, conditions, x=v.X('ZR'), y=v.X('AL'),verbose=True) 
Unhelpful traceback:
Calculation Backend: Compiled (autowrap)
Components: AL CU VA ZR
Phases: AL2CU AL2ZR AL2ZR3 AL3ZR2 AL3ZR4 AL3ZR5 AL4ZR5 AL5CU8 AL9CU11 ALPHA2 ALZR ALZR2 ALZR3 BCC_A2 CBCC_A12 CU10ZR7 CU2ZR CU51ZR14 CU5ZR7 CU8ZR3 CU9ZR2 CUB_A13 CUZR CUZR2 EPS2 ETA1 ETA2 FCC_A1 GAM1 GAM2 HCP_A3 LIQUID M3ZR OMEGA T1 T11 T2 T3 T4 T6 T7 T9 [done]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-29-7abb40511c4f> in <module>()
      1 fig = plt.figure(figsize=(20,20))
----> 2 equilibrium(dbf, comps, phases, conditions, x=v.X('ZR'), y=v.X('AL'),verbose=True)

/Users/brandon/Projects/pycalphad/pycalphad/core/equilibrium.py in equilibrium(dbf, comps, phases, conditions, output, model, verbose, broadcast, calc_opts, scheduler, parameters, **kwargs)
    356         properties = delayed(properties.merge, pure=False)(eqcal, inplace=True, compat='equals')
    357     if scheduler is not None:
--> 358         properties = dask.compute(properties, get=scheduler)[0]
    359     properties.attrs['created'] = datetime.utcnow()
    360     if len(kwargs) > 0:

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/base.py in compute(*args, **kwargs)
    177         dsk = merge(var.dask for var in variables)
    178     keys = [var._keys() for var in variables]
--> 179     results = get(dsk, keys, **kwargs)
    180 
    181     results_iter = iter(results)

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in get_sync(dsk, keys, **kwargs)
    521     queue = Queue()
    522     return get_async(apply_sync, 1, dsk, keys, queue=queue,
--> 523                      raise_on_exception=True, **kwargs)
    524 
    525 

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in get_async(apply_async, num_workers, dsk, result, cache, queue, get_id, raise_on_exception, rerun_exceptions_locally, callbacks, **kwargs)
    488             f(key, res, dsk, state, worker_id)
    489         while state['ready'] and len(state['running']) < num_workers:
--> 490             fire_task()
    491 
    492     # Final reporting

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in fire_task()
    459         # Submit
    460         apply_async(execute_task, args=[key, dsk[key], data, queue,
--> 461                                         get_id, raise_on_exception])
    462 
    463     # Seed initial tasks into the thread pool

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in apply_sync(func, args, kwds)
    509 def apply_sync(func, args=(), kwds={}):
    510     """ A naive synchronous version of apply_async """
--> 511     return func(*args, **kwds)
    512 
    513 

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in execute_task(key, task, data, queue, get_id, raise_on_exception)
    265     """
    266     try:
--> 267         result = _execute_task(task, data)
    268         id = get_id()
    269         result = key, result, None, id

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in _execute_task(arg, cache, dsk)
    247         func, args = arg[0], arg[1:]
    248         args2 = [_execute_task(a, cache) for a in args]
--> 249         return func(*args2)
    250     elif not ishashable(arg):
    251         return arg

/Users/brandon/Projects/pycalphad/pycalphad/core/lower_convex_hull.py in lower_convex_hull(global_grid, result_array)
    108             hyperplane(idx_global_grid_X_values, idx_global_grid_GM_values,
    109                        idx_comp_values, idx_result_array_MU_values,
--> 110                        idx_result_array_NP_values, idx_result_array_points_values)
    111         # Copy phase values out
    112         points = result_array_points_values[it.multi_index]

/Users/brandon/Projects/pycalphad/pycalphad/core/hyperplane.pyx in pycalphad.core.hyperplane.hyperplane (pycalphad/core/hyperplane.c:4379)()

/Users/brandon/Projects/pycalphad/pycalphad/core/hyperplane.pyx in pycalphad.core.hyperplane.hyperplane (pycalphad/core/hyperplane.c:4073)()

ValueError: ('Max hull iterations exceeded. Remaining driving force: ', -6.815012708108264e+20)

@richardotis
Copy link
Collaborator Author

What is x and ykwargs?

@bocklund
Copy link
Collaborator

This used to be a ternplot call and those got left behind.

@bocklund
Copy link
Collaborator

bocklund commented Jun 23, 2017

A better case

%matplotlib inline
from matplotlib import pyplot as plt
from pycalphad import Database, equilibrium, variables as v
from time import time
dbfile = '/Users/brandon/Box Sync/databases/nims-databases/Cr-Ti-V.tdb'
dbf = Database(dbfile)
comps = ['CR', 'TI', 'V', 'VA']
import numpy as np
phases = list(dbf.phases.keys())
conditions = {v.X('TI'): 0.7, v.X('V'): 0.08, v.P: 101325, v.T: 873}
equilibrium(dbf, comps, phases, conditions, verbose=True)
Traceback with verbose:
Calculation Backend: Compiled (autowrap)
Components: CR TI V VA
Phases: BCC_A2 HCP_A3 LAVES_C14 LAVES_C15 LAVES_C36 LIQUID [done]
('Composition Sets', [CompositionSet(LAVES_C15, [  5.92592593e-01   4.07407407e-01   1.00000000e-12], NP=0.1698454988461324), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.09091405367343551), CompositionSet(BCC_A2, [ 0.1614506   0.73033021  0.10821919], NP=0.7392404474804323)])
('reduced_hessian eigenvalues', array([ -9.35555842e+01,   2.63716672e+03,   7.34835746e+03,
         9.45520023e+13,   1.50880519e+14,   2.83273159e+14,
         3.71086120e+14,   4.52127157e+14]))
('reduced_hessian modified eigenvalues', array([  9.36119157e+01,   2.63710806e+03,   7.34838927e+03,
         9.45520023e+13,   1.50880519e+14,   2.83273159e+14,
         3.71086120e+14,   4.52127157e+14]))
('NEW_L_MULTIPLIERS', array([  1119.36911679,   4228.36452636, -10806.09864172,  49436.7410664 ,
        22101.91951702, -71468.68284031, -40784.31179058, -37035.98269442,
       -56564.00520976]))
('L_CONSTRAINTS', array([ -1.86045099e-16,  -1.99922887e-16,  -1.99922887e-16,
         0.00000000e+00,  -1.38777878e-17,   0.00000000e+00,
         0.00000000e+00,   1.11022302e-16,   0.00000000e+00]))
('penalty', 10000)
('old_driving_force', -38877.441584370004, 1.9992288680364425e-16)
('sublsum', -773.12325259891827)
(1.0, -32832.10507939454, 0.30000000000146687)
(0.5, -34526.129460600612, 0.23781870035898778)
(0.25, -36550.40915897314, 0.16979519781956143)
(0.125, -37662.797858529128, 0.11915583853618006)
(0.0625, -38792.486883353755, 0.011080696692249536)
(0.03125, -38889.196045920362, 0.00076004893197989531)
('alpha', 0.03125)
('Phases', [CompositionSet(LAVES_C15, [  5.90738131e-01   4.09261869e-01   1.00000000e-12], NP=0.15918950839059595), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.04143677635789113), CompositionSet(BCC_A2, [ 0.15728563  0.74329824  0.09941613], NP=0.7993737152515131)])
('step', array([ -8.90141369e-02,   8.90141370e-02,  -3.67062453e-11,
        -2.00583381e-11,   4.99099204e-11,  -2.98513200e-11,
        -5.24027252e-10,   1.07005822e-09,  -5.46031187e-10,
         0.00000000e+00,  -1.33279261e-01,   4.14976979e-01,
        -2.81697717e-01,   0.00000000e+00,  -3.40991695e-01,
        -1.58327287e+00,   1.92426457e+00]))
('conv_angle', 89.79776732441249)
('Site fractions', array([  8.86107197e-01,   1.13892803e-01,   1.00000000e-12,
         1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e+00,   1.57285625e-01,   7.43298242e-01,
         9.94161330e-02,   1.00000000e+00]))
('Phase fractions', array([ 0.15918951,  0.04143678,  0.79937372]))
('Chemical potentials', array([-40784.31179058, -37035.98269442, -56564.00520976]))
('Chem pot progress', array([  603.09879796,  -288.9259566 , -5948.11097951]))
('Energy progress', -15.753445324575296)
('Driving force', 518.45987218480877)
('Composition Sets', [CompositionSet(LAVES_C15, [  5.90738131e-01   4.09261869e-01   1.00000000e-12], NP=0.15918950839059595), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.04143677635789113), CompositionSet(BCC_A2, [ 0.15728563  0.74329824  0.09941613], NP=0.7993737152515131)])
('reduced_hessian eigenvalues', array([ -8.42443784e+02,   2.34981063e+03,   7.17174080e+03,
         6.93551800e+13,   8.87081258e+13,   2.07965079e+14,
         2.65899737e+14,   3.50012665e+14]))
('reduced_hessian modified eigenvalues', array([  8.42437928e+02,   2.34980974e+03,   7.17175571e+03,
         6.93551800e+13,   8.87081258e+13,   2.07965079e+14,
         2.65899737e+14,   3.50012665e+14]))
('NEW_L_MULTIPLIERS', array([ -1205.86044506,  -4319.34053693,   -861.09764171,   3736.35810387,
         7942.45623166, -25231.16025878, -42373.47010455, -36909.29646803,
       -47771.87770541]))
('L_CONSTRAINTS', array([  1.14685475e-12,   1.55944138e-12,   1.99997788e-12,
         0.00000000e+00,   9.71445147e-17,   0.00000000e+00,
        -2.30692550e-04,   7.60048932e-04,  -5.29356381e-04]))
('penalty', 10000)
('old_driving_force', -38885.004771838554, 0.00076004893197989531)
('sublsum', -193.8734426569564)
(1.0, -37533.127304432441, 0.12621820700173769)
(0.5, -38548.015722427459, 0.03868429303661336)
(0.25, -38919.582663747016, 0.001151425059618294)
('alpha', 0.25)
('Phases', [CompositionSet(LAVES_C15, [  6.14872349e-01   3.85127651e-01   9.90618126e-12], NP=0.16211497243643985), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.0027290306171850534), CompositionSet(BCC_A2, [ 0.14334914  0.76151933  0.09513153], NP=0.8351559969464489)])
('step', array([  1.44805306e-01,  -1.44805306e-01,   3.81484640e-11,
         2.14076136e-11,  -5.35444062e-11,   3.05772471e-11,
        -8.82166499e-11,   1.72257830e-10,  -8.60411583e-11,
         0.00000000e+00,  -5.57459552e-02,   7.28843570e-02,
        -1.71384018e-02,   0.00000000e+00,   1.17018562e-02,
        -1.54830983e-01,   1.43129127e-01]))
('conv_angle', 88.46881504278565)
('Site fractions', array([  9.22308524e-01,   7.76914763e-02,   1.05371160e-11,
         6.35190339e-12,   1.00000000e+00,   8.64431179e-12,
         1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e+00,   1.43349137e-01,   7.61519331e-01,
         9.51315326e-02,   1.00000000e+00]))
('Phase fractions', array([ 0.16211497,  0.00272903,  0.835156  ]))
('Chemical potentials', array([-42373.47010455, -36909.29646803, -47771.87770541]))
('Chem pot progress', array([-1589.15831397,   126.68622639,  8792.12750435]))
('Energy progress', -40.15364283663075)
('Driving force', 37.8100020674392)
('Composition Sets', [CompositionSet(LAVES_C15, [  6.14872349e-01   3.85127651e-01   9.90618126e-12], NP=0.16211497243643985), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.0027290306171850534), CompositionSet(BCC_A2, [ 0.14334914  0.76151933  0.09513153], NP=0.8351559969464489)])
('reduced_hessian eigenvalues', array([  4.46456395e+02,   3.89343994e+03,   8.50166182e+03,
         4.57677544e+12,   1.37303023e+13,   1.72840787e+13,
         4.89565008e+13,   5.43895215e+13]))
('NEW_L_MULTIPLIERS', array([  -905.93107499,  -3121.6072806 ,  -2441.54492526,  10867.32368692,
         9922.92239094, -32148.4761443 , -41659.13591996, -36747.05577181,
       -51310.29274292]))
('L_CONSTRAINTS', array([  8.60190063e-13,   1.16962425e-12,   1.99997788e-12,
         0.00000000e+00,   5.55111512e-17,   0.00000000e+00,
        -6.01094994e-04,   1.15142506e-03,  -5.50330066e-04]))
('penalty', 10000)
('old_driving_force', -38921.287385225973, 0.001151425059618294)
('sublsum', -144.7594778295913)
(1.0, -36482.972200633551, 0.18966235922116914)
(0.5, -37317.778371026041, 0.15658228013220343)
(0.25, -38120.027402641885, 0.083003249157682313)
(0.125, -38544.718951472183, 0.040225841781000082)
(0.0625, -38749.216837186337, 0.019202373107327309)
(0.03125, -38849.535084471499, 0.0087819475241579514)
(0, -38921.287385225973, 0.001151425059618294)
Decreasing constraint penalty because alpha is zero
('alpha', 0)
('Phases', [CompositionSet(LAVES_C15, [  6.14872349e-01   3.85127651e-01   9.90618126e-12], NP=0.16211497243643985), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.0027290306171850534), CompositionSet(BCC_A2, [ 0.14334914  0.76151933  0.09513153], NP=0.8351559969464489)])
('step', array([  3.86175350e-02,  -3.86175352e-02,   1.78821469e-10,
         5.94845425e-11,  -1.77926962e-10,   1.17272771e-10,
        -3.82948664e-09,   7.90159662e-09,  -4.07410999e-09,
         0.00000000e+00,  -4.13802338e-02,   8.25034002e-02,
        -4.11231664e-02,   0.00000000e+00,  -3.51204416e-02,
        -3.31683164e-01,   3.66803605e-01]))
('conv_angle', 89.358796949372461)
('Site fractions', array([  9.22308524e-01,   7.76914763e-02,   1.05371160e-11,
         6.35190339e-12,   1.00000000e+00,   8.64431179e-12,
         1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e+00,   1.43349137e-01,   7.61519331e-01,
         9.51315326e-02,   1.00000000e+00]))
('Phase fractions', array([ 0.16211497,  0.00272903,  0.835156  ]))
('Chemical potentials', array([-41659.13591996, -36747.05577181, -51310.29274292]))
('Chem pot progress', array([  714.33418458,   162.24069622, -3538.41503751]))
('Energy progress', 0.0)
('Driving force', 48.456475626393512)
('Composition Sets', [CompositionSet(LAVES_C15, [  6.14872349e-01   3.85127651e-01   9.90618126e-12], NP=0.16211497243643985), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=0.0027290306171850534), CompositionSet(BCC_A2, [ 0.14334914  0.76151933  0.09513153], NP=0.8351559969464489)])
('reduced_hessian eigenvalues', array([ -5.25172181e+00,   3.93388283e+03,   8.28720491e+03,
         4.57677544e+12,   1.37303023e+13,   1.72840787e+13,
         4.89565008e+13,   5.43895215e+13]))
('reduced_hessian modified eigenvalues', array([  5.25295878e+00,   3.93387771e+03,   8.28720535e+03,
         4.57677544e+12,   1.37303023e+13,   1.72840787e+13,
         4.89565008e+13,   5.43895215e+13]))
('NEW_L_MULTIPLIERS', array([  35829.90163072,  127805.33633421, -176724.53539448,
        806324.14030158,  251528.01229684, -822187.35916907,
        -36504.40278557,  -37002.57161944, -173162.81680812]))
('L_CONSTRAINTS', array([  8.60190063e-13,   1.16962425e-12,   1.99997788e-12,
         0.00000000e+00,   5.55111512e-17,   0.00000000e+00,
        -6.01094994e-04,   1.15142506e-03,  -5.50330066e-04]))
('penalty', 1000.0)
('old_driving_force', -39005.679452090502, 0.001151425059618294)
('sublsum', -8002.0561721167178)
(1.0, -45740.461950679797, 0.300000000002)
('alpha', 1.0)
('Phases', [CompositionSet(LAVES_C15, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=1e-12), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=1e-12), CompositionSet(BCC_A2, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=1.0)])
('step', array([ -1.43150068e+00,   1.43150069e+00,  -7.59120765e-09,
        -2.43604475e-09,   7.44952714e-09,  -5.01465140e-09,
        -2.84421040e-07,   5.79367197e-07,  -2.94948156e-07,
         0.00000000e+00,  -9.54884955e-01,   4.34094822e+00,
        -3.38606327e+00,   0.00000000e+00,  -5.38201409e+00,
        -2.43498876e+01,   2.97319017e+01]))
('conv_angle', 89.990761583271507)
('Site fractions', array([  1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e-12,   1.00000000e+00,   1.00000000e-12,
         1.00000000e+00,   1.00000000e-12,   1.00000000e+00,
         1.00000000e-12,   1.00000000e+00]))
('Phase fractions', array([  1.00000000e-12,   1.00000000e-12,   1.00000000e+00]))
('Chemical potentials', array([ -36504.40278557,  -37002.57161944, -173162.81680812]))
('Chem pot progress', array([   5154.7331344 ,    -255.51584763, -121852.5240652 ]))
('Energy progress', 3376.109193678065)
('Driving force', 1445.3321408723932)
('Composition Sets', [CompositionSet(LAVES_C15, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=1e-12), CompositionSet(HCP_A3, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=1e-12), CompositionSet(BCC_A2, [  1.00000000e-12   1.00000000e+00   1.00000000e-12], NP=1.0)])
('reduced_hessian eigenvalues', array([-109983.28494995,  -60379.19386669,     603.2074116 ,
          1658.93227169,    2416.0378329 ,    3359.32297988,
         62808.00517844,  112933.63809998]))
('reduced_hessian modified eigenvalues', array([    603.2074116 ,    1658.93227169,    2416.0378329 ,
          3359.32297988,   60379.19386669,   62808.00517844,
        109983.28494995,  112933.63809998]))
('NEW_L_MULTIPLIERS', array([  1.86543170e+04,   1.11026430e+04,   1.23210752e+04,
         6.64815637e+03,   2.78243137e+04,  -7.02837564e+04,
         1.10687486e+15,  -5.17724029e+04,   4.02499948e+14]))
('L_CONSTRAINTS', array([  1.99997788e-12,   1.99997788e-12,   1.99997788e-12,
         0.00000000e+00,   1.99997788e-12,   0.00000000e+00,
        -2.20000000e-01,   3.00000000e-01,  -8.00000000e-02]))
('penalty', 10000)
('old_driving_force', 275712464769945.09, 0.300000000002)
('sublsum', -275712464857543.66)
(1.0, -39927.237237187896, 0.10898146238945319)
('alpha', 1.0)
('Phases', [CompositionSet(LAVES_C15, [ 0.05219216  0.87596675  0.14449539], NP=1e-12), CompositionSet(HCP_A3, [  1.00000000e-12   8.82959720e-01   1.57626177e-01], NP=1e-12), CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('step', array([-0.10898146, -0.06327894,  0.1722604 ,  0.15657649, -0.24554187,
        0.08896538, -0.0405859 , -0.11704028,  0.15762618,  0.        ,
        0.22      , -0.3       ,  0.08      ,  0.        , -0.31651209,
       -0.20152023,  0.51803232]))
('conv_angle', 74.125330171074097)
('Site fractions', array([  1.00000000e-12,   9.36721065e-01,   1.72260398e-01,
         1.56576488e-01,   7.54458133e-01,   8.89653793e-02,
         1.00000000e-12,   8.82959720e-01,   1.57626177e-01,
         1.00000000e+00,   2.20000000e-01,   7.00000000e-01,
         8.00000000e-02,   1.00000000e+00]))
('Phase fractions', array([  1.00000000e-12,   1.00000000e-12,   1.00000000e+00]))
('Chemical potentials', array([  1.10687486e+15,  -5.17724029e+04,   4.02499948e+14]))
('Chem pot progress', array([  1.10687486e+15,  -1.47698313e+04,   4.02499949e+14]))
('Energy progress', -3207.3673680377105)
('Driving force', -275712464788129.16)
('Composition Sets', [CompositionSet(LAVES_C15, [ 0.05219216  0.87596675  0.14449539], NP=1e-12), CompositionSet(HCP_A3, [  1.00000000e-12   8.82959720e-01   1.57626177e-01], NP=1e-12), CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('reduced_hessian eigenvalues', array([ -7.04596003e+14,  -2.59499700e+14,  -6.17927018e-02,
         2.66672720e-04,   4.32787545e+02,   6.78061826e+02,
         4.86357843e+14,   7.30006612e+14]))
('reduced_hessian modified eigenvalues', array([  5.55323318e-02,   1.52176901e-01,   4.32791216e+02,
         6.77994043e+02,   2.59499700e+14,   4.86357843e+14,
         7.04596003e+14,   7.30006612e+14]))
('NEW_L_MULTIPLIERS', array([  1.30161410e+13,   6.50807052e+12,   3.59841134e+12,
         2.26881529e+11,  -3.38490915e+13,  -2.58382807e+13,
        -2.24606772e+13,   3.52119424e+13,   1.47344520e+13]))
('L_CONSTRAINTS', array([  1.08981462e-01,   2.77555756e-17,   4.05858971e-02,
         0.00000000e+00,  -1.38777878e-16,   0.00000000e+00,
         1.13187237e-13,   1.99995576e-12,  -4.16333634e-17]))
('penalty', 10000)
('old_driving_force', -1564562874705.7666, 0.10898146238945319)
('sublsum', 1564562837101.6934)
(1.0, -1238422768383.885, 0.052408568767892488)
(0.5, -1401492821545.2434, 0.080695015578672896)
(0.25, -1483027848125.6069, 0.094838238984062989)
(0.125, -1523795361415.7114, 0.10190985068675815)
(0.0625, -1544179118060.7454, 0.10544565653810567)
(0.03125, -1554370996383.2598, 0.10721355946377942)
(0, -1564562874705.7666, 0.10898146238945319)
Decreasing constraint penalty because alpha is zero
('alpha', 0)
('Phases', [CompositionSet(LAVES_C15, [ 0.05219216  0.87596675  0.14449539], NP=1e-12), CompositionSet(HCP_A3, [  1.00000000e-12   8.82959720e-01   1.57626177e-01], NP=1e-12), CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('step', array([-0.05240857, -0.00496618, -0.05160671,  0.02311418, -0.01256448,
       -0.0105497 , -0.03002138, -0.01556654,  0.00500203,  0.        ,
       -0.00876953,  0.00596031,  0.00280922,  0.        , -0.03880589,
       -0.00715212,  0.0490677 ]))
('conv_angle', 100.19389240121117)
('Site fractions', array([  1.00000000e-12,   9.36721065e-01,   1.72260398e-01,
         1.56576488e-01,   7.54458133e-01,   8.89653793e-02,
         1.00000000e-12,   8.82959720e-01,   1.57626177e-01,
         1.00000000e+00,   2.20000000e-01,   7.00000000e-01,
         8.00000000e-02,   1.00000000e+00]))
('Phase fractions', array([  1.00000000e-12,   1.00000000e-12,   1.00000000e+00]))
('Chemical potentials', array([ -2.24606772e+13,   3.52119424e+13,   1.47344520e+13]))
('Chem pot progress', array([ -1.12933554e+15,   3.52119424e+13,  -3.87765496e+14]))
('Energy progress', 0.0)
('Driving force', -20885766892715.602)
Removing CompositionSet(HCP_A3, [  1.00000000e-12   8.82959720e-01   1.57626177e-01], NP=nan)
Removing CompositionSet(LAVES_C15, [ 0.05219216  0.87596675  0.14449539], NP=nan)
('Composition Sets', [CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('NEW_L_MULTIPLIERS', array([  8611.67863773, -25809.24934117, -38212.58516708, -37589.9336589 ,
       -50527.75194443]))
('L_CONSTRAINTS', array([ -1.38777878e-16,   0.00000000e+00,   6.10067552e-14,
         2.41029419e-13,  -3.02161074e-13]))
('penalty', 1000.0)
('old_driving_force', -38764.606846821727, 3.0216107393954417e-13)
('sublsum', 7.3943593899036551e-17)
(1.0, -38764.606846822324, 4.163336342344337e-17)
('alpha', 1.0)
('Phases', [CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('step', array([ -6.10037021e-14,  -2.41019704e-13,   3.02162184e-13,
         0.00000000e+00,  -1.38777878e-17]))
('conv_angle', 90.002873286102101)
('Site fractions', array([ 0.22,  0.7 ,  0.08,  1.  ]))
('Phase fractions', array([ 1.]))
('Chemical potentials', array([-38212.58516708, -37589.9336589 , -50527.75194443]))
('Chem pot progress', array([  2.24606772e+13,  -3.52119424e+13,  -1.47344520e+13]))
('Energy progress', -3.8708094507455826e-09)
('Driving force', -2.664393281134835)
('Composition Sets', [CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('NEW_L_MULTIPLIERS', array([  8614.34274117, -25809.24963102, -38215.24895881, -37592.59825099,
       -50530.41625235]))
('L_CONSTRAINTS', array([  4.16333634e-17,   0.00000000e+00,   0.00000000e+00,
         0.00000000e+00,   0.00000000e+00]))
('penalty', 10000)
('old_driving_force', -38764.606846822324, 4.163336342344337e-17)
('sublsum', 1.6357819730662906e-28)
(1.0, -38764.606846822324, 4.163336342344337e-17)
(0.5, -38764.606846822324, 4.163336342344337e-17)
(0.25, -38764.606846822324, 4.163336342344337e-17)
(0.125, -38764.606846822324, 4.163336342344337e-17)
(0.0625, -38764.606846822324, 4.163336342344337e-17)
(0.03125, -38764.606846822324, 4.163336342344337e-17)
(0, -38764.606846822324, 4.163336342344337e-17)
Decreasing constraint penalty because alpha is zero
('alpha', 0)
('Phases', [CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('step', array([ -9.15933995e-18,  -2.91433544e-17,  -3.33066907e-18,
         0.00000000e+00,   4.16333634e-17]))
('conv_angle', 110.77760244046381)
('Site fractions', array([ 0.22,  0.7 ,  0.08,  1.  ]))
('Phase fractions', array([ 1.]))
('Chemical potentials', array([-38215.24895881, -37592.59825099, -50530.41625235]))
('Chem pot progress', array([-2.66379173, -2.6645921 , -2.66430791]))
('Energy progress', 0.0)
('Driving force', 0.0)
('Composition Sets', [CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('NEW_L_MULTIPLIERS', array([  8614.34274117, -25809.24963102, -38215.24895881, -37592.59825099,
       -50530.41625235]))
('L_CONSTRAINTS', array([  4.16333634e-17,   0.00000000e+00,   0.00000000e+00,
         0.00000000e+00,   0.00000000e+00]))
('penalty', 1000.0)
('old_driving_force', -38764.606846822324, 4.163336342344337e-17)
('sublsum', 1.6357819730662906e-28)
(1.0, -38764.606846822324, 4.163336342344337e-17)
(0.5, -38764.606846822324, 4.163336342344337e-17)
(0.25, -38764.606846822324, 4.163336342344337e-17)
(0.125, -38764.606846822324, 4.163336342344337e-17)
(0.0625, -38764.606846822324, 4.163336342344337e-17)
(0.03125, -38764.606846822324, 4.163336342344337e-17)
(0, -38764.606846822324, 4.163336342344337e-17)
Decreasing constraint penalty because alpha is zero
('alpha', 0)
('Phases', [CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0)])
('step', array([ -9.15933995e-18,  -2.91433544e-17,  -3.33066907e-18,
         0.00000000e+00,   4.16333634e-17]))
('conv_angle', 110.77760244046381)
('Site fractions', array([ 0.22,  0.7 ,  0.08,  1.  ]))
('Phase fractions', array([ 1.]))
('Chemical potentials', array([-38215.24895881, -37592.59825099, -50530.41625235]))
('Chem pot progress', array([ 0.,  0.,  0.]))
('Energy progress', 0.0)
('Driving force', 0.0)
Candidates to add: 
defaultdict(<class 'list'>, {'LAVES_C14': [(CompositionSet(LAVES_C14, [ 0.66666667  0.33333333  0.        ], NP=1.0), 1454.7565379485677), (CompositionSet(LAVES_C14, [ 0.66666667  0.33333333  0.        ], NP=1.0), 1454.7565379485677), (CompositionSet(LAVES_C14, [ 0.66666667  0.33333333  0.        ], NP=1.0), 1454.7565379485677), (CompositionSet(LAVES_C14, [ 0.66666667  0.33333333  0.        ], NP=1.0), 1454.7565379485677), (CompositionSet(LAVES_C14, [ 0.66666667  0.33333333  0.        ], NP=1.0), 1454.756538460002)], 'BCC_A2': [(CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0), -1.4551915228366852e-11), (CompositionSet(BCC_A2, [ 0.22000001  0.70000002  0.07999997], NP=1.0), -4.3655745685100555e-11), (CompositionSet(BCC_A2, [ 0.21999999  0.70000004  0.07999997], NP=1.0), -6.548361852765083e-11), (CompositionSet(BCC_A2, [ 0.22000002  0.7         0.07999998], NP=1.0), -1.4551915228366852e-11), (CompositionSet(BCC_A2, [ 0.22000003  0.69999999  0.07999998], NP=1.0), -5.093170329928398e-11), (CompositionSet(BCC_A2, [ 0.22000002  0.70000004  0.07999994], NP=1.0), -1.6007106751203537e-10), (CompositionSet(BCC_A2, [ 0.21999994  0.70000004  0.08000002], NP=1.0), -8.731149137020111e-11), (CompositionSet(BCC_A2, [ 0.22        0.70000002  0.07999998], NP=1.0), -1.4551915228366852e-11), (CompositionSet(BCC_A2, [ 0.22  0.7   0.08], NP=1.0), -2.1827872842550278e-11)], 'LAVES_C36': [(CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.03086370e-11], NP=1.0), 1724.6360362269697), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205), (CompositionSet(LAVES_C36, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1724.6360314516205)], 'LIQUID': [], 'LAVES_C15': [(CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   3.28019791e-11], NP=1.0), 1787.165926706286), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133), (CompositionSet(LAVES_C15, [  6.66666667e-01   3.33333333e-01   1.00000000e-12], NP=1.0), 1787.1659214603133)], 'HCP_A3': []})
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-43-90ff3312d790> in <module>()
      9 phases = list(dbf.phases.keys())
     10 conditions = {v.X('TI'): 0.7, v.X('V'): 0.08, v.P: 101325, v.T: 873}
---> 11 equilibrium(dbf, comps, phases, conditions, verbose=True)
     12 
     13 

/Users/brandon/Projects/pycalphad/pycalphad/core/equilibrium.py in equilibrium(dbf, comps, phases, conditions, output, model, verbose, broadcast, calc_opts, scheduler, parameters, **kwargs)
    356         properties = delayed(properties.merge, pure=False)(eqcal, inplace=True, compat='equals')
    357     if scheduler is not None:
--> 358         properties = dask.compute(properties, get=scheduler)[0]
    359     properties.attrs['created'] = datetime.utcnow()
    360     if len(kwargs) > 0:

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/base.py in compute(*args, **kwargs)
    177         dsk = merge(var.dask for var in variables)
    178     keys = [var._keys() for var in variables]
--> 179     results = get(dsk, keys, **kwargs)
    180 
    181     results_iter = iter(results)

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in get_sync(dsk, keys, **kwargs)
    521     queue = Queue()
    522     return get_async(apply_sync, 1, dsk, keys, queue=queue,
--> 523                      raise_on_exception=True, **kwargs)
    524 
    525 

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in get_async(apply_async, num_workers, dsk, result, cache, queue, get_id, raise_on_exception, rerun_exceptions_locally, callbacks, **kwargs)
    488             f(key, res, dsk, state, worker_id)
    489         while state['ready'] and len(state['running']) < num_workers:
--> 490             fire_task()
    491 
    492     # Final reporting

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in fire_task()
    459         # Submit
    460         apply_async(execute_task, args=[key, dsk[key], data, queue,
--> 461                                         get_id, raise_on_exception])
    462 
    463     # Seed initial tasks into the thread pool

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in apply_sync(func, args, kwds)
    509 def apply_sync(func, args=(), kwds={}):
    510     """ A naive synchronous version of apply_async """
--> 511     return func(*args, **kwds)
    512 
    513 

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in execute_task(key, task, data, queue, get_id, raise_on_exception)
    265     """
    266     try:
--> 267         result = _execute_task(task, data)
    268         id = get_id()
    269         result = key, result, None, id

/Users/brandon/.virtualenvs/pycalphad/lib/python3.5/site-packages/dask/async.py in _execute_task(arg, cache, dsk)
    247         func, args = arg[0], arg[1:]
    248         args2 = [_execute_task(a, cache) for a in args]
--> 249         return func(*args2)
    250     elif not ishashable(arg):
    251         return arg

/Users/brandon/Projects/pycalphad/pycalphad/core/eqsolver.pyx in pycalphad.core.eqsolver._solve_eq_at_conditions (pycalphad/core/eqsolver.c:23270)()

/Users/brandon/Projects/pycalphad/pycalphad/core/eqsolver.pyx in pycalphad.core.eqsolver.add_new_phases (pycalphad/core/eqsolver.c:9833)()

/Users/brandon/Projects/pycalphad/pycalphad/core/hyperplane.pyx in pycalphad.core.hyperplane.hyperplane (pycalphad/core/hyperplane.c:4073)()

ValueError: ('Max hull iterations exceeded. Remaining driving force: ', -39793.86464999274)

<\details>

@richardotis
Copy link
Collaborator Author

Looks like two different bugs with the same symptom. Can you send the TDB file?

@bocklund
Copy link
Collaborator

Discussed OOB on 2017-07-28:

A new branch will be created to hold failing equilibrium calls written as tests. As solver improvements make tests pass, they will be git cherry-picked into the test suite.

Challenge: tests for databases with licensing issues.

I have some examples that are non working for CC licensed tdbs from the NIST website and open-access CC databases in literature to start.

@bocklund
Copy link
Collaborator

Note to @bocklund:

  • Test the fix-memory PR 1 (solver class) against my previous successful calculations.
  • Test the fix-memory PR 2 (ipopt) against my previous successful calculations.

Add any working examples that are now non-working to test suite to be fixed before merge

@bocklund
Copy link
Collaborator

bocklund commented Jul 29, 2017

@richardotis should calculations that are successful at higher point densities, but not at the default (e.g. 2000 over 500 current default) be added to the test suite at the working (e.g. 2000) or non-working (equilibrium default) point density?

I think we should do the latter.

@richardotis
Copy link
Collaborator Author

That effect means higher point density is hiding a convergence problem. We should use the same point density with every test.

@richardotis
Copy link
Collaborator Author

I would like to see your current results comparing develop to fix_memory, before I start breaking things up.

@richardotis
Copy link
Collaborator Author

richardotis commented Jul 31, 2017

import numpy as np
from pycalphad import CompiledModel, Model, Database, calculate, equilibrium
import pycalphad.variables as v
#from sympy.core.cache import clear_cache

dbf = Database('alfe_sei.TDB')
from pympler import tracker
phx = dbf.phases.keys()
conds = {v.T: (300,2000,100), v.X('AL'): 0.3, v.P: 101325}
#clear_cache()
tr = tracker.SummaryTracker()
tr.print_diff()
tr.print_diff()
tr.print_diff()
tr.print_diff()
eq = equilibrium(dbf, ['AL', 'FE', 'VA'], phx, conds)
dbf = Database('alfe_sei.TDB')
eq = equilibrium(dbf, ['AL', 'FE', 'VA'], phx, conds)
#clear_cache()
tr.print_diff()
                                                types |   # objects |   total size
===================================================== | =========== | ============
             <class 'sympy.core.assumptions.StdFactKB |         167 |    110.52 KB
                                         <class 'dict |         283 |     75.38 KB
                            <class '_lrucache.hashseq |         627 |     71.94 KB
                                        <class 'tuple |         626 |     40.81 KB
                                      <class 'weakref |         425 |     33.20 KB
                              <class '_lrucache.clist |         627 |     29.39 KB
                                          <class 'int |         789 |     26.44 KB
                                          <class 'set |           3 |     23.16 KB
                                <class 'numpy.ndarray |          66 |     21.07 KB
                           <class 'sympy.core.mul.Mul |         269 |     18.91 KB
                     <class 'sympy.core.numbers.Float |         225 |     17.58 KB
  <class 'pycalphad.core.compiled_model.CompiledModel |           3 |     13.95 KB
     <class 'pycalphad.core.compiled_model.memoryview |          66 |     12.38 KB
                                         <class 'list |         127 |     11.08 KB
                                    <class 'frozenset |          49 |     10.72 KB

If you enable the lines to clear the sympy cache, we get fewer dangling objects:

===================================================== | =========== | ============
                                         <class 'dict |         119 |     37.50 KB
                                      <class 'weakref |         407 |     31.80 KB
                                          <class 'set |           3 |     23.16 KB
                                <class 'numpy.ndarray |          66 |     21.07 KB
  <class 'pycalphad.core.compiled_model.CompiledModel |           3 |     13.95 KB
     <class 'pycalphad.core.compiled_model.memoryview |          66 |     12.38 KB
                                         <class 'list |         127 |     11.08 KB
                                        <class 'tuple |         159 |      9.72 KB
                                    <class 'frozenset |          42 |      9.19 KB
                                         <class 'cell |         184 |      8.62 KB
             <class 'sympy.core.assumptions.StdFactKB |           8 |      7.81 KB
                                  function (<lambda>) |          58 |      7.70 KB
                                          <class 'int |         182 |      5.60 KB
     <class 'cyordereddict._cyordereddict.OrderedDict |           3 |      5.41 KB
                      <class 'tinydb.database.Element |          10 |      4.84 KB

@richardotis
Copy link
Collaborator Author

For one case in Cr-Ti-V, I'm finding a stochastic result (one clearly not mass balanced, another that appears correct):

from pycalphad import Database, equilibrium, variables as v
dbfile = 'Cr-Ti-V.tdb'
dbf = Database(dbfile)
comps = ['CR', 'TI', 'V', 'VA']
import numpy as np
phases = list(dbf.phases.keys())
conditions = {v.X('TI'): 0.4, v.X('V'): 0.28, v.P: 101325, v.T: 873}
eq = equilibrium(dbf, comps, phases, conditions, verbose=True)
print(eq)
print(eq.X)

@richardotis
Copy link
Collaborator Author

(This is on 006aa37)

@richardotis
Copy link
Collaborator Author

The above bug should be fixed in 6242690. I'd be interested in seeing the calculation results with that commit. It should be a little faster, too.

@richardotis
Copy link
Collaborator Author

Comparing energies calculated by 6242690 ("current") to develop

TI: 0.1 V: 0.1 Current: -36951.52790000284 Develop: -36951.52790000283
TI: 0.1 V: 0.2 Current: -39108.65018029529 Develop: -39108.650180295335
TI: 0.1 V: 0.3 Current: -40390.01955995843 Develop: -40390.019559958426
TI: 0.1 V: 0.4 Current: -40860.23926759578 Develop: -41157.67386318837
TI: 0.1 V: 0.5 Current: -41490.93559017657 Develop: -41576.26649009518
TI: 0.1 V: 0.6 Current: -41782.57286534879 Develop: -41782.572865348746
TI: 0.1 V: 0.7 Current: -41627.155780050765 Develop: Not Calculated
TI: 0.1 V: 0.8 Current: -40740.59791607576 Develop: -40740.59791607576
TI: 0.1 V: 0.9 Current: nan Develop: -38232.04696022588
TI: 0.2 V: 0.1 Current: -39177.65541816435 Develop: -39177.65541816436
TI: 0.2 V: 0.2 Current: -40482.82418630918 Develop: -40482.82418630609
TI: 0.2 V: 0.3 Current: -41063.76113118898 Develop: -41063.76113118963
TI: 0.2 V: 0.4 Current: -40977.679600570904 Develop: -41294.30070207802
TI: 0.2 V: 0.5 Current: -41421.062879194054 Develop: -41440.8572675
TI: 0.2 V: 0.6 Current: -41485.3606907515 Develop: -41485.360690751484
TI: 0.2 V: 0.7 Current: -40959.06204430518 Develop: Not Calculated
TI: 0.2 V: 0.8 Current: nan Develop: -39012.5530250823
TI: 0.2 V: 0.9 Current: nan Develop: nan
TI: 0.3 V: 0.1 Current: -40514.19428461143 Develop: -40514.194284611425
TI: 0.3 V: 0.2 Current: -40798.32642407969 Develop: -40798.326424079685
TI: 0.3 V: 0.3 Current: -40942.45986819676 Develop: -40942.459868196354
TI: 0.3 V: 0.4 Current: -40990.02438760531 Develop: -41059.33372407014
TI: 0.3 V: 0.5 Current: -41212.65188607643 Develop: -41212.65188607641
TI: 0.3 V: 0.6 Current: -40931.379508032776 Develop: -40931.37950803279
TI: 0.3 V: 0.7 Current: -39379.83597596234 Develop: Not Calculated
TI: 0.3 V: 0.8 Current: nan Develop: nan
TI: 0.3 V: 0.9 Current: nan Develop: nan
TI: 0.4 V: 0.1 Current: -40412.69857939123 Develop: -40412.69857939127
TI: 0.4 V: 0.2 Current: -40580.26669611495 Develop: -40580.26669611499
TI: 0.4 V: 0.3 Current: -40493.13072450688 Develop: -40685.49468166111
TI: 0.4 V: 0.4 Current: -40873.718314119564 Develop: -40873.17941579559
TI: 0.4 V: 0.5 Current: -40762.73209756912 Develop: -40762.73209756909
TI: 0.4 V: 0.6 Current: nan Develop: -39478.27923602011
TI: 0.4 V: 0.7 Current: nan Develop: Not Calculated
TI: 0.4 V: 0.8 Current: nan Develop: nan
TI: 0.4 V: 0.9 Current: nan Develop: nan
TI: 0.5 V: 0.1 Current: -40026.15382510132 Develop: -40026.153825101304
TI: 0.5 V: 0.2 Current: -39881.47455302914 Develop: -40290.06498984063
TI: 0.5 V: 0.3 Current: -40449.04089107193 Develop: -40460.295171800775
TI: 0.5 V: 0.4 Current: -40481.515446358 Develop: -40481.51544635788
TI: 0.5 V: 0.5 Current: -39377.93574145896 Develop: nan
TI: 0.5 V: 0.6 Current: nan Develop: nan
TI: 0.5 V: 0.7 Current: nan Develop: Not Calculated
TI: 0.5 V: 0.8 Current: nan Develop: nan
TI: 0.5 V: 0.9 Current: nan Develop: nan
TI: 0.6 V: 0.1 Current: -38971.79493585602 Develop: -39588.39775291984
TI: 0.6 V: 0.2 Current: -39870.84837592336 Develop: -39918.26901595376
TI: 0.6 V: 0.3 Current: -40077.746543322675 Develop: -40077.74653917344
TI: 0.6 V: 0.4 Current: -39115.746037810124 Develop: -39115.746035587355
TI: 0.6 V: 0.5 Current: nan Develop: nan
TI: 0.6 V: 0.6 Current: nan Develop: nan
TI: 0.6 V: 0.7 Current: nan Develop: Not Calculated
TI: 0.6 V: 0.8 Current: nan Develop: nan
TI: 0.6 V: 0.9 Current: nan Develop: nan
TI: 0.7 V: 0.1 Current: -39126.48085019605 Develop: Not Calculated
TI: 0.7 V: 0.2 Current: -39503.06371624846 Develop: Not Calculated
TI: 0.7 V: 0.3 Current: -38703.37893396467 Develop: Not Calculated
TI: 0.7 V: 0.4 Current: nan Develop: Not Calculated
TI: 0.7 V: 0.5 Current: nan Develop: Not Calculated
TI: 0.7 V: 0.6 Current: nan Develop: Not Calculated
TI: 0.7 V: 0.7 Current: nan Develop: Not Calculated
TI: 0.7 V: 0.8 Current: nan Develop: Not Calculated
TI: 0.7 V: 0.9 Current: nan Develop: Not Calculated
TI: 0.8 V: 0.1 Current: -38632.31914810656 Develop: -38632.31914443396
TI: 0.8 V: 0.2 Current: -38143.24899831889 Develop: -38143.24898610302
TI: 0.8 V: 0.3 Current: nan Develop: nan
TI: 0.8 V: 0.4 Current: nan Develop: nan
TI: 0.8 V: 0.5 Current: nan Develop: nan
TI: 0.8 V: 0.6 Current: nan Develop: nan
TI: 0.8 V: 0.7 Current: nan Develop: Not Calculated
TI: 0.8 V: 0.8 Current: nan Develop: nan
TI: 0.8 V: 0.9 Current: nan Develop: nan
TI: 0.9 V: 0.1 Current: -37557.35240529825 Develop: -37557.35239281283
TI: 0.9 V: 0.2 Current: nan Develop: nan
TI: 0.9 V: 0.3 Current: nan Develop: nan
TI: 0.9 V: 0.4 Current: nan Develop: nan
TI: 0.9 V: 0.5 Current: nan Develop: nan
TI: 0.9 V: 0.6 Current: nan Develop: nan
TI: 0.9 V: 0.7 Current: nan Develop: Not Calculated
TI: 0.9 V: 0.8 Current: nan Develop: nan
TI: 0.9 V: 0.9 Current: nan Develop: nan

Filtering to just the interesting ones:

TI: 0.1 V: 0.4 Current: -40860.23926759578 Develop: -41157.67386318837
TI: 0.1 V: 0.5 Current: -41490.93559017657 Develop: -41576.26649009518
TI: 0.2 V: 0.4 Current: -40977.679600570904 Develop: -41294.30070207802
TI: 0.2 V: 0.5 Current: -41421.062879194054 Develop: -41440.8572675
TI: 0.3 V: 0.4 Current: -40990.02438760531 Develop: -41059.33372407014
TI: 0.4 V: 0.3 Current: -40493.13072450688 Develop: -40685.49468166111
TI: 0.4 V: 0.4 Current: -40873.718314119564 Develop: -40873.17941579559
TI: 0.5 V: 0.2 Current: -39881.47455302914 Develop: -40290.06498984063
TI: 0.5 V: 0.3 Current: -40449.04089107193 Develop: -40460.295171800775
TI: 0.6 V: 0.1 Current: -38971.79493585602 Develop: -39588.39775291984
TI: 0.6 V: 0.2 Current: -39870.84837592336 Develop: -39918.26901595376

No convergence failures, but there seems to be some variation in how the edge of composition space is handled:

TI: 0.5 V: 0.5 Current: -39377.93574145896 Develop: nan
TI: 0.4 V: 0.6 Current: nan Develop: -39478.27923602011
TI: 0.2 V: 0.8 Current: nan Develop: -39012.5530250823
TI: 0.1 V: 0.9 Current: nan Develop: -38232.04696022588

@bocklund
Copy link
Collaborator

bocklund commented Aug 2, 2017

develop
image

d1cfd9f
image

6242690
image

In the most recent one it looks like we are having trouble calculating the compositions of the miscibility gap and that we're not finding the single bcc phase under it

@richardotis
Copy link
Collaborator Author

richardotis commented Aug 7, 2017

This is a global minimization issue, with most of the issue being how the phases get changed during miscibility gap detection inside add_new_phases. Some of it seems to be an issue with the number of phases added to the system: you can't just add as many phases to the solver and expect it to find the global minimum; in fact, it will be sensitive to starting point for the different phase fractions in some cases.
I haven't yet solved the issue, but I've made some progress.
For 4fd5a0c

TI: 0.2 V: 0.4 Current: -41067.56043742116 Develop: -41294.30070207802
TI: 0.3 V: 0.4 Current: -40990.02439942912 Develop: -41059.33372407014
TI: 0.4 V: 0.3 Current: -40728.20342223294 Develop: -40685.49468166111
TI: 0.5 V: 0.3 Current: -40449.04089911968 Develop: -40460.295171800775
TI: 0.6 V: 0.2 Current: -39870.848387702266 Develop: -39918.26901595376

@bocklund
Copy link
Collaborator

bocklund commented Aug 10, 2017

One other challenging system is the sigma phase in this Fe-Ni-V system. https://psu.box.com/s/yhlg629eh48ble1sarn252zcx5kdxt5s

The following image is from the solver near develop head. The sigma phase should go from that tie triangle (near equiatomic Fe-Ni-V) to roughly ~50/50 Ni-V.

I can provide specific points that failed to converge in this figure, if needed. I tried (but I think did not save) an image from the current fix-memory branch last week. The results were similar to the Cr-Ti-V system in that there were few (or no) convergence failures, but some regressions in the phase fractions in certain areas.

image

This is more blocking to my current work than Cr-Ti-V, for what it's worth.

@bocklund
Copy link
Collaborator

Updates from PR #124 66e3fc2:

(Note: "current" refers to develop/release solver)

Fe-Ni-V

  • We are still having trouble with the sigma phase, the phase diagram appears similar, but maybe slightly more successful calculations than the current solver.
  • We are picking up the Ni3V phase now, and we were completely missing it before at 1300K!
  • Increasing point density to 500 gave a significant improvement to finding the sigma phase

(All these diagrams at 1300K)
image
and 'zoomed in' on sigma region:
image

500 point density:
image

Cr-Ti-V

  • Mostly better handling of the laves phase near the end of composition space
  • Completely miss the miscibility gap now
  • Problems in the centrally located tie-triangle appear more systematic
  • Weird stuff happening at the corners of some of the tie-triangles

(At 873K)
image

Al-Cu-Zr

  • Mostly correct looking, but many fewer phases appear. Not sure if there was a bug in the previous eqplot code or if we are not detecting phases correctly.
  • Some accuracy issues:
  • weird tie triangle stuff at Cu-65Zr-28Al
  • stray tieline at Cu-25Zr-70Al

(At 1373K)
Current:
image

66e3fc2:

image

@bocklund
Copy link
Collaborator

bocklund commented Sep 15, 2017

Some issues in Al-Ni:

db_alni = Database('NI_AL_DUPIN_2001.TDB')
my_phases_alni = ['LIQUID', 'FCC_L12', 'BCC_B2', 'AL3NI5', 'AL3NI2', 'AL3NI1']
# should be a two phase region of the ordered phase and disordered phase
# basically anything above 610c doesn't find the right phases
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.2, v.T: 1000, v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.2, v.T: 700, v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.2, v.T: 1400, v.P:101325})

# should be two phase B2 and liquid
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.6, v.T: 1600, v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.4, v.T: 1800, v.P:101325})

These take ~7 seconds on develop and ~70 seconds on 66e3fc2

Full diagram (completed after ~5 hours!) with 2% composition steps and a temperature step size of 10 Kelvin.
image

@richardotis
Copy link
Collaborator Author

I'm unable to reproduce errors with any of the first three equilibria (I get an ordered phase and a disordered phase). I am on Python 3.5 and 66e3fc2.

@richardotis
Copy link
Collaborator Author

Note that I'm running with verbose=True,which shouldn't affect the result in principle.

@richardotis
Copy link
Collaborator Author

I'm unable to reproduce errors with any of the Al-Ni equilibria listed.

@bocklund
Copy link
Collaborator

bocklund commented Oct 1, 2017

Looks like I might have been on 6242690, but idk why I would have written that I was on
66e3fc2. I am now getting the correct phases. Going to check my previous results again

@bocklund
Copy link
Collaborator

bocklund commented Oct 1, 2017

Ok. I've tried to re plot the phase diagram, but I am running into the following error

Traceback:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-12-2b529cb341cb> in <module>()
----> 1 eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.05), v.T: (400, 2000, 50), v.P:101325})

~/Projects/pycalphad/pycalphad/core/equilibrium.py in equilibrium(dbf, comps, phases, conditions, output, model, verbose, broadcast, calc_opts, scheduler, parameters, **kwargs)
    355         properties = delayed(properties.merge, pure=False)(eqcal, inplace=True, compat='equals')
    356     if scheduler is not None:
--> 357         properties = dask.compute(properties, get=scheduler)[0]
    358     properties.attrs['created'] = datetime.utcnow().isoformat()
    359     if len(kwargs) > 0:

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/base.py in compute(*args, **kwargs)
    203     dsk = collections_to_dsk(variables, optimize_graph, **kwargs)
    204     keys = [var._keys() for var in variables]
--> 205     results = get(dsk, keys, **kwargs)
    206 
    207     results_iter = iter(results)

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/async.py in get_sync(*args, **kwargs)
     12 def get_sync(*args, **kwargs):
     13     warnings.warn(_msg.format('get_sync'))
---> 14     return local.get_sync(*args, **kwargs)
     15 
     16 

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in get_sync(dsk, keys, **kwargs)
    560     """
    561     kwargs.pop('num_workers', None)    # if num_workers present, remove it
--> 562     return get_async(apply_sync, 1, dsk, keys, **kwargs)
    563 
    564 

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in get_async(apply_async, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, **kwargs)
    527 
    528                 while state['ready'] and len(state['running']) < num_workers:
--> 529                     fire_task()
    530 
    531             succeeded = True

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in fire_task()
    502                             args=(key, dumps((dsk[key], data)),
    503                                   dumps, loads, get_id, pack_exception),
--> 504                             callback=queue.put)
    505 
    506             # Seed initial tasks into the thread pool

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in apply_sync(func, args, kwds, callback)
    549 def apply_sync(func, args=(), kwds={}, callback=None):
    550     """ A naive synchronous version of apply_async """
--> 551     res = func(*args, **kwds)
    552     if callback is not None:
    553         callback(res)

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    293         failed = False
    294     except BaseException as e:
--> 295         result = pack_exception(e, dumps)
    296         failed = True
    297     return key, result, failed

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    288     try:
    289         task, data = loads(task_info)
--> 290         result = _execute_task(task, data)
    291         id = get_id()
    292         result = dumps((result, id))

~/anaconda3/envs/pycalphad_ipopt/lib/python3.6/site-packages/dask/local.py in _execute_task(arg, cache, dsk)
    269         func, args = arg[0], arg[1:]
    270         args2 = [_execute_task(a, cache) for a in args]
--> 271         return func(*args2)
    272     elif not ishashable(arg):
    273         return arg

~/Projects/pycalphad/pycalphad/core/eqsolver.pyx in pycalphad.core.eqsolver._solve_eq_at_conditions()

ValueError: cannot copy sequence with size 3 to array axis with dimension 2

I'm just trying to track down the behavior that triggers it can't quite figure it out.

Things that do trigger it:

eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.05), v.T: (400, 1900, 20), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.05), v.T: (400, 2000, 50), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0,1,0.25), v.T: (400, 2000, 50), v.P:101325})

Things that do not:

eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0,1,0.25), v.T: (400, 2000, 75), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.5, v.T: (400, 2000, 10), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): 0.5, v.T: (400, 2000, 5), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: 500, v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: 2000, v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.002), v.T: 500, v.P:101325})

It looks like possibly the combination and number of temperature and composition conditions trigger this.

@bocklund
Copy link
Collaborator

bocklund commented Oct 1, 2017

These also work so I don't think it's a number of points thing

eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: (500, 600, 10), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: (500, 600, 5), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: (500, 600, 1), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: (1800, 2000, 10), v.P:101325})
eq = equilibrium(db_alni, ['AL', 'NI', 'VA'] , my_phases_alni, {v.X('AL'): (0, 1, 0.01), v.T: (500, 700, 10), v.P:101325})

@richardotis
Copy link
Collaborator Author

When you get the error: ValueError: cannot copy sequence with size 3 to array axis with dimension 2
Are you close to an invariant reaction when you get this error? I've seen this error before when the solver tries to copy a 3-phase region into a result array when that would violate the Gibbs phase rule.

@bocklund
Copy link
Collaborator

bocklund commented Nov 3, 2017

Checking into ValueError: cannot copy sequence with size 3 to array axis with dimension 2. It doesn't look like I'm near an invariant reaction, but I was able to track it down to the following point:

from pycalphad import __version__ as pycalphad_version,Database, equilibrium, variables as v
from pycalphad.plot.eqplot import eqplot
print(pycalphad_version)

alni_db = Database('NI_AL_DUPIN_2001.TDB')
alni_comps = ['AL', 'NI', 'VA']
alni_phases = list(alni_db.phases.keys())

eq = equilibrium(alni_db, alni_comps, alni_phases, {v.X('AL'): 0.1, v.T: 740, v.P:101325}, verbose=True)

Looks to be near the two phase order/disorder region

@bocklund
Copy link
Collaborator

bocklund commented Nov 3, 2017

Verbose output for that is

Calculation Backend: Compiled (autowrap)
Components: AL NI VA
Phases: AL3NI1 AL3NI2 AL3NI5 BCC_A2 BCC_B2 FCC_A1 FCC_L12 LIQUID [done]
Trying to improve poor solution
Chemical Potentials [-176810.73960244  -30201.46279285]
[  1.40940230e-06   1.56600247e-07   1.40940175e-06   1.56600255e-07
   1.40940224e-07   1.40940204e-06   1.56600250e-07   1.40940224e-07
   1.80368557e-07   6.44749968e-07]
[ 0.1         0.9         0.1         0.9         1.          0.1         0.9
  1.          0.78140234  0.21859766]
Status: 0 b'Algorithm terminated successfully at a locally optimal point, satisfying the convergence tolerances (can be specified by options).'
Adding CompositionSet(FCC_L12, [ 0.24489796  0.75510204], NP=0.3333333333333333, GM=-66192.96533392674) Driving force: 87.18985294105369
Trying to improve poor solution
Chemical Potentials [-177362.92705238  -30140.76202639]
[  9.34229457e-08   1.01591602e-08   9.34229458e-08   1.01591602e-08
   9.16276679e-09   9.34229457e-08   1.01591602e-08   9.16276679e-09
   1.07436910e-03   9.16284484e-09   9.28419837e-09   7.00549867e-07
   9.16276679e-09   1.73696239e-08   1.99383682e-08   7.08873392e-07]
[  9.80783241e-02   9.01921676e-01   9.80783240e-02   9.01921676e-01
   1.00000000e+00   9.80783241e-02   9.01921676e-01   1.00000000e+00
   8.51851032e-06   9.99991481e-01   9.86920617e-01   1.30793828e-02
   1.00000000e+00   5.27517701e-01   4.59555494e-01   1.29268058e-02]
Status: 0 b'Algorithm terminated successfully at a locally optimal point, satisfying the convergence tolerances (can be specified by options).'
('Composition Sets', [CompositionSet(FCC_L12, [ 0.09807832  0.90192168], NP=0.5275177005387275, GM=-44580.06523644036), CompositionSet(FCC_A1, [ 0.09807832  0.90192168], NP=0.459555493684058, GM=-44580.06524151845), CompositionSet(FCC_L12, [ 0.24673654  0.75326346], NP=0.01292680577721452, GM=-66465.85010428746)])

Are the phases right? Should I be using both FCC_A1 and FCC_L12 (same for BCC)?

If I do calculations at x(AL)=0.095 and 0.105, I get the following eq results:

Dimensions:    (P: 1, T: 1, X_AL: 1, component: 2, internal_dof: 7, vertex: 2)
Coordinates:
  * P          (P) float64 1.013e+05
  * T          (T) float64 740.0
  * X_AL       (X_AL) float64 0.095
  * vertex     (vertex) int64 0 1
  * component  (component) <U2 'AL' 'NI'
Dimensions without coordinates: internal_dof
Data variables:
    NP         (P, T, X_AL, vertex) float64 0.2631 0.7369
    GM         (P, T, X_AL) float64 -4.413e+04
    MU         (P, T, X_AL, component) float64 -1.782e+05 -3.005e+04
    X          (P, T, X_AL, vertex, component) float64 0.095 0.905 0.095 0.905
    Y          (P, T, X_AL, vertex, internal_dof) float64 0.095 0.905 0.095 ...
    Phase      (P, T, X_AL, vertex) <U7 'FCC_L12' 'FCC_A1'
Attributes:
    engine:   pycalphad 0.5.2.post1+79.g66e3fc2c
    created:  2017-11-03T15:24:03.542682
Dimensions:    (P: 1, T: 1, X_AL: 1, component: 2, internal_dof: 7, vertex: 2)
Coordinates:
  * P          (P) float64 1.013e+05
  * T          (T) float64 740.0
  * X_AL       (X_AL) float64 0.105
  * vertex     (vertex) int64 0 1
  * component  (component) <U2 'AL' 'NI'
Dimensions without coordinates: internal_dof
Data variables:
    NP         (P, T, X_AL, vertex) float64 0.9534 0.04656
    GM         (P, T, X_AL) float64 -4.56e+04
    MU         (P, T, X_AL, component) float64 -1.774e+05 -3.014e+04
    X          (P, T, X_AL, vertex, component) float64 0.09808 0.9019 0.2467 ...
    Y          (P, T, X_AL, vertex, internal_dof) float64 0.09808 0.9019 ...
    Phase      (P, T, X_AL, vertex) <U7 'FCC_L12' 'FCC_L12'
Attributes:
    engine:   pycalphad 0.5.2.post1+79.g66e3fc2c
    created:  2017-11-03T15:24:27.879393

If I just use FCC_L12 and BCC_B2, I get the X_AL=0.1 condition to work

@richardotis
Copy link
Collaborator Author

  1. For order-disorder model phases, we should suspend the disordered phase to prevent degenerate configurations, which I think is what's happening here with FCC_A1 and FCC_L12. I would consider not doing that to be a bug.
  2. However, this issue of nearly equivalent configurations could happen with any set of phases (and invariant reactions as well), so we need to come up with a solution. That solution could be just to slice off the extra CompositionSets from comp_sets so we don't get the indexing error, or it could be something more complicated.

@bocklund
Copy link
Collaborator

bocklund commented Nov 3, 2017

I understand. I'm happy with AL-NI then.

Did you have a chance to look at the CR-TI-V FE-NI-V? If those are fine in fix_memory and we can write a test or two for some of the problem areas (sigma phase, miscibility gap) then I think I am satisfied.

Do we also need to write tests to check the equilibrium results of the binary examples, or is our current coverage adequate?

@richardotis
Copy link
Collaborator Author

I have not checked the ternaries.

@bocklund
Copy link
Collaborator

bocklund commented Nov 4, 2017

I'm still missing the miscibility gap in the ternary, Cr-Ti-V. I think Fe-Ni-V is satisfactory. I am able to pick up the miscibility gaps with higher point density.

@richardotis
Copy link
Collaborator Author

Closed by gh-124.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants