%matplotlib inline
import matplotlib.pyplot as plt
from pycalphad import equilibrium
from pycalphad import Database, Model
import pycalphad.variables as v
dbf = Database('craldad_for_pandat.TDB')
phases = ['LIQUID', 'L12_FCC', 'BCC_B2', 'HCP_A3']
%time eq = equilibrium(dbf, ['AL', 'CO', 'NI', 'CR', 'VA'] , phases,\
{v.X('AL'): 0.20, v.X('CO'): 0.2, v.X('CR'): 0.2, v.T: 1373})
print(eq)
Components: AL CO CR NI VA Phases: BCC_B2 HCP_A3 L12_FCC LIQUID [done] Computing initial grid [564 points, 92.6KB] Computing convex hull [iteration 1] progress 19.288055434586827 Refining convex hull Rebuilding grid [580 points, 95.2KB] Computing convex hull [iteration 2] progress 0.4652835373202756 Refining convex hull Rebuilding grid [596 points, 97.9KB] Computing convex hull [iteration 3] progress 0.3324503400628075 Refining convex hull Rebuilding grid [612 points, 100.5KB] Computing convex hull [iteration 4] progress 0.020028744402992384 Refining convex hull Rebuilding grid [628 points, 103.1KB] Computing convex hull [iteration 5] progress 0.44804143838362037 Refining convex hull Rebuilding grid [644 points, 105.7KB] Computing convex hull [iteration 6] progress 0.35943117982930717 Refining convex hull Rebuilding grid [660 points, 108.4KB] Computing convex hull [iteration 7] progress 0.39743817491223377 Refining convex hull Rebuilding grid [676 points, 111.0KB] Computing convex hull [iteration 8] progress 0.08128427815893714 Refining convex hull Rebuilding grid [692 points, 113.6KB] Computing convex hull [iteration 9] progress 0.19519938369872106 Refining convex hull Rebuilding grid [708 points, 116.2KB] Computing convex hull [iteration 10] progress 0.09114047582941227 Refining convex hull Rebuilding grid [724 points, 118.9KB] Computing convex hull [iteration 11] progress 0.10305668905029851 Refining convex hull Rebuilding grid [740 points, 121.5KB] Computing convex hull [iteration 12] progress 0.0 Convergence achieved CPU times: user 1h 20min 56s, sys: 3.26 s, total: 1h 20min 59s Wall time: 1h 20min 54s <xray.Dataset> Dimensions: (T: 1, X_AL: 1, X_CO: 1, X_CR: 1, component: 4, internal_dof: 11, vertex: 4) Coordinates: * T (T) float64 1.373e+03 * X_AL (X_AL) float64 0.2 * X_CO (X_CO) float64 0.2 * X_CR (X_CR) float64 0.2 * vertex (vertex) int64 0 1 2 3 * component (component) object 'AL' 'CO' 'CR' 'NI' * internal_dof (internal_dof) int64 0 1 2 3 4 5 6 7 8 9 10 Data variables: MU (T, X_AL, X_CO, X_CR, component) float64 -1.632e+05 ... GM (T, X_AL, X_CO, X_CR) float64 -1.006e+05 NP (T, X_AL, X_CO, X_CR, vertex) float64 0.4473 0.4243 0.1166 ... X (T, X_AL, X_CO, X_CR, vertex, component) float64 0.3238 ... Y (T, X_AL, X_CO, X_CR, vertex, internal_dof) float64 6.019e-05 ... Phase (T, X_AL, X_CO, X_CR, vertex) object 'BCC_B2' 'L12_FCC' ... Attributes: iterations: 12
print(eq.GM)
print(eq.X)
print(eq.Y)
print(eq.Phase)
print(eq.MU)
print(eq.NP)
<xray.DataArray 'GM' (T: 1, X_AL: 1, X_CO: 1, X_CR: 1)> array([[[[-100572.24799322]]]]) Coordinates: * X_AL (X_AL) float64 0.2 * X_CR (X_CR) float64 0.2 * T (T) float64 1.373e+03 * X_CO (X_CO) float64 0.2 <xray.DataArray 'X' (T: 1, X_AL: 1, X_CO: 1, X_CR: 1, vertex: 4, component: 4)> array([[[[[[ 0.32378609, 0.12005975, 0.08400686, 0.47214247], [ 0.09906774, 0.26864454, 0.29603664, 0.33625108], [ 0.10177295, 0.24934209, 0.29031305, 0.35857191], [ 0.10827891, 0.27380119, 0.25075019, 0.36716971]]]]]]) Coordinates: * vertex (vertex) int64 0 1 2 3 * component (component) object 'AL' 'CO' 'CR' 'NI' * X_AL (X_AL) float64 0.2 * X_CR (X_CR) float64 0.2 * T (T) float64 1.373e+03 * X_CO (X_CO) float64 0.2 <xray.DataArray 'Y' (T: 1, X_AL: 1, X_CO: 1, X_CR: 1, vertex: 4, internal_dof: 11)> array([[[[[[ 6.01858584e-05, 1.63208810e-01, 2.56291059e-02, 8.10084852e-01, 1.01958685e-03, 6.47180842e-01, 7.67879023e-02, 1.42298694e-01, 1.33717205e-01, 3.18176785e-06, 9.99999999e-01], [ 9.84862920e-02, 2.63435731e-01, 2.91585171e-01, 3.46492806e-01, 1.00812073e-01, 2.84270965e-01, 3.09391056e-01, 3.05525906e-01, 1.00000000e+00, nan, nan], [ 1.03989179e-01, 2.50388853e-01, 2.93573704e-01, 3.52048263e-01, 9.51242691e-02, 2.46201805e-01, 2.80531070e-01, 3.78142856e-01, 1.00000000e+00, nan, nan], [ 1.06547158e-01, 2.76213045e-01, 2.48644546e-01, 3.68595252e-01, 1.13474173e-01, 2.66565634e-01, 2.57067125e-01, 3.62893068e-01, 1.00000000e+00, nan, nan]]]]]]) Coordinates: * vertex (vertex) int64 0 1 2 3 * X_AL (X_AL) float64 0.2 * X_CR (X_CR) float64 0.2 * T (T) float64 1.373e+03 * X_CO (X_CO) float64 0.2 * internal_dof (internal_dof) int64 0 1 2 3 4 5 6 7 8 9 10 <xray.DataArray 'Phase' (T: 1, X_AL: 1, X_CO: 1, X_CR: 1, vertex: 4)> array([[[[['BCC_B2', 'L12_FCC', 'L12_FCC', 'L12_FCC']]]]], dtype=object) Coordinates: * vertex (vertex) int64 0 1 2 3 * X_AL (X_AL) float64 0.2 * X_CR (X_CR) float64 0.2 * T (T) float64 1.373e+03 * X_CO (X_CO) float64 0.2 <xray.DataArray 'MU' (T: 1, X_AL: 1, X_CO: 1, X_CR: 1, component: 4)> array([[[[[-163157.67075898, -89072.63746383, -65999.92570852, -92315.50301739]]]]]) Coordinates: * component (component) object 'AL' 'CO' 'CR' 'NI' * X_AL (X_AL) float64 0.2 * X_CR (X_CR) float64 0.2 * T (T) float64 1.373e+03 * X_CO (X_CO) float64 0.2 <xray.DataArray 'NP' (T: 1, X_AL: 1, X_CO: 1, X_CR: 1, vertex: 4)> array([[[[[ 0.4472588 , 0.42427707, 0.1165914 , 0.01187488]]]]]) Coordinates: * vertex (vertex) int64 0 1 2 3 * X_AL (X_AL) float64 0.2 * X_CR (X_CR) float64 0.2 * T (T) float64 1.373e+03 * X_CO (X_CO) float64 0.2