|
| 1 | +# TDB Test AlCu |
| 2 | +############################################################ |
| 3 | +import BinarySystems as BS |
| 4 | +import matplotlib.pyplot as plt |
| 5 | +from pycalphad import Database |
| 6 | +tdb_file = "AlCu.TDB" |
| 7 | +db = Database(tdb_file) |
| 8 | +# pycalphad uses capitalized elements |
| 9 | +elements = ["AL", "CU"] |
| 10 | +component = "CU" |
| 11 | +temperature = 800.0 |
| 12 | + |
| 13 | +AlCu_Sys = BS.BinaryIsothermalDiscreteSystem() |
| 14 | +AlCu_Sys.fromTDB(db, elements, component, temperature) |
| 15 | +AlCu_Fit = BS.BinaryIsothermal2ndOrderSystem() |
| 16 | +AlCu_Fit.from_discrete_near_equilibrium(AlCu_Sys, x=0.3) |
| 17 | + |
| 18 | +print(AlCu_Fit.phases) |
| 19 | +plt.plot(AlCu_Sys.phases['FCC_A1'].xdata, |
| 20 | + AlCu_Fit.phases['FCC_A1_0'].free_energy(AlCu_Sys.phases['FCC_A1'].xdata), |
| 21 | + linestyle='-', color='tab:orange', |
| 22 | + label="Phase 1 Fit",linewidth=2) |
| 23 | + |
| 24 | +plt.plot(AlCu_Sys.phases['FCC_A1'].xdata, |
| 25 | + AlCu_Sys.phases['FCC_A1'].Gdata, |
| 26 | + linestyle='-', color='k', |
| 27 | + label="Phase 1 Fit",linewidth=1) |
| 28 | +#plt.plot(AlCu_Sys.phases['AL2CU_C16'].xdata, |
| 29 | +# AlCu_Fit.phases['AL2CU_C16'].free_energy(AlCu_Sys.phases['AL2CU_C16'].xdata), |
| 30 | +# linestyle='-', color='tab:green', |
| 31 | +# label="Phase 1 Fit",linewidth=2) |
| 32 | +# |
| 33 | +#plt.plot(AlCu_Sys.phases['AL2CU_C16'].xdata, |
| 34 | +# AlCu_Sys.phases['AL2CU_C16'].Gdata, |
| 35 | +# linestyle='-', color='k', |
| 36 | +# label="Phase 1 Fit",linewidth=1) |
| 37 | + |
| 38 | +#plt.ylim([-56000,-47000]) |
| 39 | +plt.xlim([0,1]) |
| 40 | +plt.xticks([]) |
| 41 | +#plt.yticks([]) |
| 42 | + |
| 43 | +############################################################ |
| 44 | + |
| 45 | +# Test B |
| 46 | +############################################################ |
0 commit comments