Skip to content

Commit 098d749

Browse files
committed
Add files via upload
added .gitignore added test file removed some debug lines
1 parent 5000993 commit 098d749

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__
2+
.venv

BinarySystems.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def fit_phase(self, xdata, Gdata, kwellmax=1e9):
115115
kwell to be used when fitting a line compound
116116
"""
117117
if len(xdata) > 2:
118-
plt.plot(xdata, Gdata, '-')
119118
(a, b, c), _ = curve_fit(self.functional_form, xdata, Gdata,
120119
bounds=([0, -np.inf, -np.inf], [2.0 * kwellmax, np.inf, np.inf]))
121120
print(a, b, c)
@@ -517,7 +516,6 @@ def __init__(self, parameter_dict={"a0":1.0,"a1":0.0,"b0":0.0,"b1":1.0,"c0":0.0,
517516

518517
def fit_from_isothermal(self, xdata, Gdata, kwellmax=1e9):
519518
if len(xdata) > 2:
520-
plt.plot(xdata, Gdata, '-')
521519
(a, b, c), _ = curve_fit(self.functional_form, xdata, Gdata,
522520
bounds=([0, -np.inf, -np.inf], [2.0 * kwellmax, np.inf, np.inf]))
523521
print(a, b, c)

BinaryTests.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)