In [1]:
# http://matplotlib.org/
import matplotlib.pyplot as plt
from matplotlib import ticker
%matplotlib inline

In [2]:
import numpy as np

In [3]:
from libocpy import *

In [4]:
tqini()
tqrpfil('database/Co_Chimad.TDB',('CO','NI','AL','W'))


('CO', 'NI', 'AL', 'W') database/Co_Chimad.TDB
DATABASE/CO_CHIMAD.TDB CO NI AL W

In [5]:
element_name = tqgcom()
print "element name:  ",element_name


element name:   ['AL', 'CO', 'NI', 'W']

In [6]:
number_phase = tqgnp()
print "# of phases:   ",number_phase


# of phases:    43

In [7]:
phase_name = tqgpn()
print "phase name:  ",phase_name
print len(phase_name)


phase name:   ['AL12W', 'AL13CO4', 'AL2W', 'AL3CO', 'AL3NI1', 'AL3NI2', 'AL3NI5', 'AL3RU2', 'AL4W', 'AL5CO2', 'AL5W', 'AL77W23', 'AL7W3', 'AL9CO2', 'ALM3_D019', 'ALTI', 'BCC_B2', 'C14_LAVES', 'C15_LAVES', 'C16_MXTA2', 'C36_LAVES', 'CHI', 'CO7TA2', 'DO22', 'DOA', 'EPSILON_L', 'ETA_AL2TI', 'HCP_A3', 'KAPPA', 'L12_FCC', 'LIQUID', 'MU', 'NI2TA', 'NI3TI', 'NI4W', 'NITI2', 'NIW', 'NIW2', 'O_ALTATI2', 'PHI_ALTA', 'PT3TA', 'SIGMA', 'ZETA_AL5TI2']
43

In [8]:
tqsetc('N',0,1.)
tqsetc('P',0,1E5)
tqsetc('T',0,900)
tqsetc('X','NI',0.1)
tqsetc('X','AL',0.12)
tqsetc('X','W',0.15)

In [10]:
tqce()

In [11]:
phase_name = tqgpn()
for i in range(len(phase_name)):
        print phase_name[i],tqgetv('NP',phase_name[i],'NA')


AL12W 0.0
AL13CO4 0.0
AL2W 0.0
AL3CO 0.0
AL3NI1 0.0
AL3NI2 0.0
AL3NI5 0.0
AL3RU2 0.0
AL4W 0.0
AL5CO2 0.0
AL5W 0.0
AL77W23 0.0
AL7W3 0.0
AL9CO2 0.0
ALM3_D019 0.0
ALTI 0.0
BCC_B2 0.271844336063
C14_LAVES 0.0
C15_LAVES 0.0
C16_MXTA2 0.0
C36_LAVES 0.0
CHI 0.632168844263
CO7TA2 0.0
DO22 0.0
DOA 0.0
EPSILON_L 0.0
ETA_AL2TI 0.0
HCP_A3 0.0
KAPPA 0.0
L12_FCC 0.0959868196738
LIQUID 0.0
MU 0.0
NI2TA 0.0
NI3TI 0.0
NI4W 0.0
NITI2 0.0
NIW 0.0
NIW2 0.0
O_ALTATI2 0.0
PHI_ALTA 0.0
PT3TA 0.0
SIGMA 0.0
ZETA_AL5TI2 0.0

In [12]:
tqsetcs({'T':900,'P':1E5,'N':1.,'X(NI)':0.1,'X(AL)':0.12,'X(W)':0.15})
tqce()

phase_name = tqgpn()
for i in range(len(phase_name)):
    print phase_name[i],tqgetv('NP',phase_name[i],'NA')


condition X AL 1 0.12
condition X NI 3 0.1
condition X W 4 0.15
condition N   0 1.0
condition P   0 100000.0
condition T   0 900
AL12W 0.0
AL13CO4 0.0
AL2W 0.0
AL3CO 0.0
AL3NI1 0.0
AL3NI2 0.0
AL3NI5 0.0
AL3RU2 0.0
AL4W 0.0
AL5CO2 0.0
AL5W 0.0
AL77W23 0.0
AL7W3 0.0
AL9CO2 0.0
ALM3_D019 0.0
ALTI 0.0
BCC_B2 0.27184433597
C14_LAVES 0.0
C15_LAVES 0.0
C16_MXTA2 0.0
C36_LAVES 0.0
CHI 0.632168842147
CO7TA2 0.0
DO22 0.0
DOA 0.0
EPSILON_L 0.0
ETA_AL2TI 0.0
HCP_A3 0.0
KAPPA 0.0
L12_FCC 0.0959868218835
LIQUID 0.0
MU 0.0
NI2TA 0.0
NI3TI 0.0
NI4W 0.0
NITI2 0.0
NIW 0.0
NIW2 0.0
O_ALTATI2 0.0
PHI_ALTA 0.0
PT3TA 0.0
SIGMA 0.0
ZETA_AL5TI2 0.0

In [18]:
T = np.linspace(500,1500,50)

tqphsts("*","SUS",0.)
tqphsts("BCC","ENT",1.)
tqphsts("L12","ENT",1.)

In [21]:
GM_FCC = []

for i in range(len(T)):
    tqsetc('T',0,T[i])
    tqce()
    
    GM_FCC.append(tqgetv('NP','BCC','NA'))
    
for i in range(len(T)):
    print T[i],GM_FCC[i]


500.0 0.266750202372
520.408163265 0.269583720137
540.816326531 0.272335109678
561.224489796 0.274979617809
581.632653061 0.149998094825
602.040816327 0.279866897325
622.448979592 0.149995698619
642.857142857 0.284121924402
663.265306122 0.149990583568
683.673469388 0.149986215344
704.081632653 0.289219415177
724.489795918 0.290594331174
744.897959184 0.29183298979
765.306122449 0.292962616347
785.714285714 0.294020599009
806.12244898 0.295057427046
826.530612245 0.296141454547
846.93877551 0.297366930972
867.346938776 0.298868250146
887.755102041 0.300846935532
908.163265306 0.303627290562
928.571428571 0.307785064588
948.979591837 0.31449351996
969.387755102 0.326620860946
989.795918367 0.35118441507
1010.20408163 0.387240332268
1030.6122449 0.420508783175
1051.02040816 0.450763615184
1071.42857143 0.480164843147
1091.83673469 0.510098328461
1112.24489796 0.912261283552
1132.65306122 0.124025119154
1153.06122449 0.612794778843
1173.46938776 0.120203052737
1193.87755102 0.11848585245
1214.28571429 0.116566874934
1234.69387755 0.114954735343
1255.10204082 0.113459212605
1275.51020408 0.112067890193
1295.91836735 0.110770246921
1316.32653061 0.109557284915
1336.73469388 0.10842125069
1357.14285714 0.107355465159
1377.55102041 0.106354139865
1397.95918367 0.105412230168
1418.36734694 0.104525358856
1438.7755102 0.103689687786
1459.18367347 0.10290187256
1479.59183673 0.102158984135
1500.0 0.101458444575

In [ ]: