Skip to content
Snippets Groups Projects
Commit 484fc44e authored by Sarath Radhakrishnan Menon's avatar Sarath Radhakrishnan Menon
Browse files

add basic tutorial and update helpers

parent d530ab53
No related branches found
No related tags found
1 merge request!10Update phase diagram
Showing with 737 additions and 1 deletion
POSCAR file written by OVITO
1
19.0693264 0.0 0.0
0.0 19.0693264 0.0
0.0 0.0 19.0693264
Li Al
216 216
Cartesian
0.0 0.0 3.178221
1.5891104 4.7673316 1.5891104
0.0 3.178221 0.0
1.5891104 1.5891104 4.7673316
3.178221 0.0 0.0
4.7673316 4.7673316 4.7673316
3.178221 3.178221 3.178221
4.7673316 1.5891104 1.5891104
0.0 0.0 9.5346632
1.5891104 4.7673316 7.9455524
0.0 3.178221 6.356442
1.5891104 1.5891104 11.1237736
3.178221 0.0 6.356442
4.7673316 4.7673316 11.1237736
3.178221 3.178221 9.5346632
4.7673316 1.5891104 7.9455524
0.0 0.0 15.8911058
1.5891104 4.7673316 14.3019943
0.0 3.178221 12.712884
1.5891104 1.5891104 17.4802151
3.178221 0.0 12.712884
4.7673316 4.7673316 17.4802151
3.178221 3.178221 15.8911058
4.7673316 1.5891104 14.3019943
0.0 6.356442 3.178221
1.5891104 11.1237736 1.5891104
0.0 9.5346632 0.0
1.5891104 7.9455524 4.7673316
3.178221 6.356442 0.0
4.7673316 11.1237736 4.7673316
3.178221 9.5346632 3.178221
4.7673316 7.9455524 1.5891104
0.0 6.356442 9.5346632
1.5891104 11.1237736 7.9455524
0.0 9.5346632 6.356442
1.5891104 7.9455524 11.1237736
3.178221 6.356442 6.356442
4.7673316 11.1237736 11.1237736
3.178221 9.5346632 9.5346632
4.7673316 7.9455524 7.9455524
0.0 6.356442 15.8911058
1.5891104 11.1237736 14.3019943
0.0 9.5346632 12.712884
1.5891104 7.9455524 17.4802151
3.178221 6.356442 12.712884
4.7673316 11.1237736 17.4802151
3.178221 9.5346632 15.8911058
4.7673316 7.9455524 14.3019943
0.0 12.712884 3.178221
1.5891104 17.4802151 1.5891104
0.0 15.8911058 0.0
1.5891104 14.3019943 4.7673316
3.178221 12.712884 0.0
4.7673316 17.4802151 4.7673316
3.178221 15.8911058 3.178221
4.7673316 14.3019943 1.5891104
0.0 12.712884 9.5346632
1.5891104 17.4802151 7.9455524
0.0 15.8911058 6.356442
1.5891104 14.3019943 11.1237736
3.178221 12.712884 6.356442
4.7673316 17.4802151 11.1237736
3.178221 15.8911058 9.5346632
4.7673316 14.3019943 7.9455524
0.0 12.712884 15.8911058
1.5891104 17.4802151 14.3019943
0.0 15.8911058 12.712884
1.5891104 14.3019943 17.4802151
3.178221 12.712884 12.712884
4.7673316 17.4802151 17.4802151
3.178221 15.8911058 15.8911058
4.7673316 14.3019943 14.3019943
6.356442 0.0 3.178221
7.9455524 4.7673316 1.5891104
6.356442 3.178221 0.0
7.9455524 1.5891104 4.7673316
9.5346632 0.0 0.0
11.1237736 4.7673316 4.7673316
9.5346632 3.178221 3.178221
11.1237736 1.5891104 1.5891104
6.356442 0.0 9.5346632
7.9455524 4.7673316 7.9455524
6.356442 3.178221 6.356442
7.9455524 1.5891104 11.1237736
9.5346632 0.0 6.356442
11.1237736 4.7673316 11.1237736
9.5346632 3.178221 9.5346632
11.1237736 1.5891104 7.9455524
6.356442 0.0 15.8911058
7.9455524 4.7673316 14.3019943
6.356442 3.178221 12.712884
7.9455524 1.5891104 17.4802151
9.5346632 0.0 12.712884
11.1237736 4.7673316 17.4802151
9.5346632 3.178221 15.8911058
11.1237736 1.5891104 14.3019943
6.356442 6.356442 3.178221
7.9455524 11.1237736 1.5891104
6.356442 9.5346632 0.0
7.9455524 7.9455524 4.7673316
9.5346632 6.356442 0.0
11.1237736 11.1237736 4.7673316
9.5346632 9.5346632 3.178221
11.1237736 7.9455524 1.5891104
6.356442 6.356442 9.5346632
7.9455524 11.1237736 7.9455524
6.356442 9.5346632 6.356442
7.9455524 7.9455524 11.1237736
9.5346632 6.356442 6.356442
11.1237736 11.1237736 11.1237736
9.5346632 9.5346632 9.5346632
11.1237736 7.9455524 7.9455524
6.356442 6.356442 15.8911058
7.9455524 11.1237736 14.3019943
6.356442 9.5346632 12.712884
7.9455524 7.9455524 17.4802151
9.5346632 6.356442 12.712884
11.1237736 11.1237736 17.4802151
9.5346632 9.5346632 15.8911058
11.1237736 7.9455524 14.3019943
6.356442 12.712884 3.178221
7.9455524 17.4802151 1.5891104
6.356442 15.8911058 0.0
7.9455524 14.3019943 4.7673316
9.5346632 12.712884 0.0
11.1237736 17.4802151 4.7673316
9.5346632 15.8911058 3.178221
11.1237736 14.3019943 1.5891104
6.356442 12.712884 9.5346632
7.9455524 17.4802151 7.9455524
6.356442 15.8911058 6.356442
7.9455524 14.3019943 11.1237736
9.5346632 12.712884 6.356442
11.1237736 17.4802151 11.1237736
9.5346632 15.8911058 9.5346632
11.1237736 14.3019943 7.9455524
6.356442 12.712884 15.8911058
7.9455524 17.4802151 14.3019943
6.356442 15.8911058 12.712884
7.9455524 14.3019943 17.4802151
9.5346632 12.712884 12.712884
11.1237736 17.4802151 17.4802151
9.5346632 15.8911058 15.8911058
11.1237736 14.3019943 14.3019943
12.712884 0.0 3.178221
14.3019943 4.7673316 1.5891104
12.712884 3.178221 0.0
14.3019943 1.5891104 4.7673316
15.8911058 0.0 0.0
17.4802151 4.7673316 4.7673316
15.8911058 3.178221 3.178221
17.4802151 1.5891104 1.5891104
12.712884 0.0 9.5346632
14.3019943 4.7673316 7.9455524
12.712884 3.178221 6.356442
14.3019943 1.5891104 11.1237736
15.8911058 0.0 6.356442
17.4802151 4.7673316 11.1237736
15.8911058 3.178221 9.5346632
17.4802151 1.5891104 7.9455524
12.712884 0.0 15.8911058
14.3019943 4.7673316 14.3019943
12.712884 3.178221 12.712884
14.3019943 1.5891104 17.4802151
15.8911058 0.0 12.712884
17.4802151 4.7673316 17.4802151
15.8911058 3.178221 15.8911058
17.4802151 1.5891104 14.3019943
12.712884 6.356442 3.178221
14.3019943 11.1237736 1.5891104
12.712884 9.5346632 0.0
14.3019943 7.9455524 4.7673316
15.8911058 6.356442 0.0
17.4802151 11.1237736 4.7673316
15.8911058 9.5346632 3.178221
17.4802151 7.9455524 1.5891104
12.712884 6.356442 9.5346632
14.3019943 11.1237736 7.9455524
12.712884 9.5346632 6.356442
14.3019943 7.9455524 11.1237736
15.8911058 6.356442 6.356442
17.4802151 11.1237736 11.1237736
15.8911058 9.5346632 9.5346632
17.4802151 7.9455524 7.9455524
12.712884 6.356442 15.8911058
14.3019943 11.1237736 14.3019943
12.712884 9.5346632 12.712884
14.3019943 7.9455524 17.4802151
15.8911058 6.356442 12.712884
17.4802151 11.1237736 17.4802151
15.8911058 9.5346632 15.8911058
17.4802151 7.9455524 14.3019943
12.712884 12.712884 3.178221
14.3019943 17.4802151 1.5891104
12.712884 15.8911058 0.0
14.3019943 14.3019943 4.7673316
15.8911058 12.712884 0.0
17.4802151 17.4802151 4.7673316
15.8911058 15.8911058 3.178221
17.4802151 14.3019943 1.5891104
12.712884 12.712884 9.5346632
14.3019943 17.4802151 7.9455524
12.712884 15.8911058 6.356442
14.3019943 14.3019943 11.1237736
15.8911058 12.712884 6.356442
17.4802151 17.4802151 11.1237736
15.8911058 15.8911058 9.5346632
17.4802151 14.3019943 7.9455524
12.712884 12.712884 15.8911058
14.3019943 17.4802151 14.3019943
12.712884 15.8911058 12.712884
14.3019943 14.3019943 17.4802151
15.8911058 12.712884 12.712884
17.4802151 17.4802151 17.4802151
15.8911058 15.8911058 15.8911058
17.4802151 14.3019943 14.3019943
3.178221 0.0 3.178221
1.5891104 1.5891104 1.5891104
3.178221 3.178221 0.0
1.5891104 4.7673316 4.7673316
0.0 0.0 0.0
4.7673316 1.5891104 4.7673316
0.0 3.178221 3.178221
4.7673316 4.7673316 1.5891104
3.178221 0.0 9.5346632
1.5891104 1.5891104 7.9455524
3.178221 3.178221 6.356442
1.5891104 4.7673316 11.1237736
0.0 0.0 6.356442
4.7673316 1.5891104 11.1237736
0.0 3.178221 9.5346632
4.7673316 4.7673316 7.9455524
3.178221 0.0 15.8911058
1.5891104 1.5891104 14.3019943
3.178221 3.178221 12.712884
1.5891104 4.7673316 17.4802151
0.0 0.0 12.712884
4.7673316 1.5891104 17.4802151
0.0 3.178221 15.8911058
4.7673316 4.7673316 14.3019943
3.178221 6.356442 3.178221
1.5891104 7.9455524 1.5891104
3.178221 9.5346632 0.0
1.5891104 11.1237736 4.7673316
0.0 6.356442 0.0
4.7673316 7.9455524 4.7673316
0.0 9.5346632 3.178221
4.7673316 11.1237736 1.5891104
3.178221 6.356442 9.5346632
1.5891104 7.9455524 7.9455524
3.178221 9.5346632 6.356442
1.5891104 11.1237736 11.1237736
0.0 6.356442 6.356442
4.7673316 7.9455524 11.1237736
0.0 9.5346632 9.5346632
4.7673316 11.1237736 7.9455524
3.178221 6.356442 15.8911058
1.5891104 7.9455524 14.3019943
3.178221 9.5346632 12.712884
1.5891104 11.1237736 17.4802151
0.0 6.356442 12.712884
4.7673316 7.9455524 17.4802151
0.0 9.5346632 15.8911058
4.7673316 11.1237736 14.3019943
3.178221 12.712884 3.178221
1.5891104 14.3019943 1.5891104
3.178221 15.8911058 0.0
1.5891104 17.4802151 4.7673316
0.0 12.712884 0.0
4.7673316 14.3019943 4.7673316
0.0 15.8911058 3.178221
4.7673316 17.4802151 1.5891104
3.178221 12.712884 9.5346632
1.5891104 14.3019943 7.9455524
3.178221 15.8911058 6.356442
1.5891104 17.4802151 11.1237736
0.0 12.712884 6.356442
4.7673316 14.3019943 11.1237736
0.0 15.8911058 9.5346632
4.7673316 17.4802151 7.9455524
3.178221 12.712884 15.8911058
1.5891104 14.3019943 14.3019943
3.178221 15.8911058 12.712884
1.5891104 17.4802151 17.4802151
0.0 12.712884 12.712884
4.7673316 14.3019943 17.4802151
0.0 15.8911058 15.8911058
4.7673316 17.4802151 14.3019943
9.5346632 0.0 3.178221
7.9455524 1.5891104 1.5891104
9.5346632 3.178221 0.0
7.9455524 4.7673316 4.7673316
6.356442 0.0 0.0
11.1237736 1.5891104 4.7673316
6.356442 3.178221 3.178221
11.1237736 4.7673316 1.5891104
9.5346632 0.0 9.5346632
7.9455524 1.5891104 7.9455524
9.5346632 3.178221 6.356442
7.9455524 4.7673316 11.1237736
6.356442 0.0 6.356442
11.1237736 1.5891104 11.1237736
6.356442 3.178221 9.5346632
11.1237736 4.7673316 7.9455524
9.5346632 0.0 15.8911058
7.9455524 1.5891104 14.3019943
9.5346632 3.178221 12.712884
7.9455524 4.7673316 17.4802151
6.356442 0.0 12.712884
11.1237736 1.5891104 17.4802151
6.356442 3.178221 15.8911058
11.1237736 4.7673316 14.3019943
9.5346632 6.356442 3.178221
7.9455524 7.9455524 1.5891104
9.5346632 9.5346632 0.0
7.9455524 11.1237736 4.7673316
6.356442 6.356442 0.0
11.1237736 7.9455524 4.7673316
6.356442 9.5346632 3.178221
11.1237736 11.1237736 1.5891104
9.5346632 6.356442 9.5346632
7.9455524 7.9455524 7.9455524
9.5346632 9.5346632 6.356442
7.9455524 11.1237736 11.1237736
6.356442 6.356442 6.356442
11.1237736 7.9455524 11.1237736
6.356442 9.5346632 9.5346632
11.1237736 11.1237736 7.9455524
9.5346632 6.356442 15.8911058
7.9455524 7.9455524 14.3019943
9.5346632 9.5346632 12.712884
7.9455524 11.1237736 17.4802151
6.356442 6.356442 12.712884
11.1237736 7.9455524 17.4802151
6.356442 9.5346632 15.8911058
11.1237736 11.1237736 14.3019943
9.5346632 12.712884 3.178221
7.9455524 14.3019943 1.5891104
9.5346632 15.8911058 0.0
7.9455524 17.4802151 4.7673316
6.356442 12.712884 0.0
11.1237736 14.3019943 4.7673316
6.356442 15.8911058 3.178221
11.1237736 17.4802151 1.5891104
9.5346632 12.712884 9.5346632
7.9455524 14.3019943 7.9455524
9.5346632 15.8911058 6.356442
7.9455524 17.4802151 11.1237736
6.356442 12.712884 6.356442
11.1237736 14.3019943 11.1237736
6.356442 15.8911058 9.5346632
11.1237736 17.4802151 7.9455524
9.5346632 12.712884 15.8911058
7.9455524 14.3019943 14.3019943
9.5346632 15.8911058 12.712884
7.9455524 17.4802151 17.4802151
6.356442 12.712884 12.712884
11.1237736 14.3019943 17.4802151
6.356442 15.8911058 15.8911058
11.1237736 17.4802151 14.3019943
15.8911058 0.0 3.178221
14.3019943 1.5891104 1.5891104
15.8911058 3.178221 0.0
14.3019943 4.7673316 4.7673316
12.712884 0.0 0.0
17.4802151 1.5891104 4.7673316
12.712884 3.178221 3.178221
17.4802151 4.7673316 1.5891104
15.8911058 0.0 9.5346632
14.3019943 1.5891104 7.9455524
15.8911058 3.178221 6.356442
14.3019943 4.7673316 11.1237736
12.712884 0.0 6.356442
17.4802151 1.5891104 11.1237736
12.712884 3.178221 9.5346632
17.4802151 4.7673316 7.9455524
15.8911058 0.0 15.8911058
14.3019943 1.5891104 14.3019943
15.8911058 3.178221 12.712884
14.3019943 4.7673316 17.4802151
12.712884 0.0 12.712884
17.4802151 1.5891104 17.4802151
12.712884 3.178221 15.8911058
17.4802151 4.7673316 14.3019943
15.8911058 6.356442 3.178221
14.3019943 7.9455524 1.5891104
15.8911058 9.5346632 0.0
14.3019943 11.1237736 4.7673316
12.712884 6.356442 0.0
17.4802151 7.9455524 4.7673316
12.712884 9.5346632 3.178221
17.4802151 11.1237736 1.5891104
15.8911058 6.356442 9.5346632
14.3019943 7.9455524 7.9455524
15.8911058 9.5346632 6.356442
14.3019943 11.1237736 11.1237736
12.712884 6.356442 6.356442
17.4802151 7.9455524 11.1237736
12.712884 9.5346632 9.5346632
17.4802151 11.1237736 7.9455524
15.8911058 6.356442 15.8911058
14.3019943 7.9455524 14.3019943
15.8911058 9.5346632 12.712884
14.3019943 11.1237736 17.4802151
12.712884 6.356442 12.712884
17.4802151 7.9455524 17.4802151
12.712884 9.5346632 15.8911058
17.4802151 11.1237736 14.3019943
15.8911058 12.712884 3.178221
14.3019943 14.3019943 1.5891104
15.8911058 15.8911058 0.0
14.3019943 17.4802151 4.7673316
12.712884 12.712884 0.0
17.4802151 14.3019943 4.7673316
12.712884 15.8911058 3.178221
17.4802151 17.4802151 1.5891104
15.8911058 12.712884 9.5346632
14.3019943 14.3019943 7.9455524
15.8911058 15.8911058 6.356442
14.3019943 17.4802151 11.1237736
12.712884 12.712884 6.356442
17.4802151 14.3019943 11.1237736
12.712884 15.8911058 9.5346632
17.4802151 17.4802151 7.9455524
15.8911058 12.712884 15.8911058
14.3019943 14.3019943 14.3019943
15.8911058 15.8911058 12.712884
14.3019943 17.4802151 17.4802151
12.712884 12.712884 12.712884
17.4802151 14.3019943 17.4802151
12.712884 15.8911058 15.8911058
17.4802151 17.4802151 14.3019943
,id,status,chemicalformula,job,subjob,project,timestart,timestop,totalcputime,computer,hamilton,hamversion,parentid,masterid
0,0,finished,,x0_sol,/x0_sol,lial/lial_thermodynamics_composition,2022-05-27 00:15:29.733653,2022-05-27 00:21:34.589072,364.0,pyiron@cmleo26#4,Calphy,0.4,,
1,1,finished,,x0_lqd,/x0_lqd,lial/lial_thermodynamics_composition,2022-05-27 00:21:34.911022,2022-05-27 00:26:39.285689,304.0,pyiron@cmleo26#4,Calphy,0.4,,
2,2,finished,,x0_alli,/x0_alli,lial/lial_thermodynamics_composition,2022-05-27 00:26:39.609501,2022-05-27 00:29:36.121032,176.0,pyiron@cmleo26#4,Calphy,0.4,,
3,3,finished,,x1_sol,/x1_sol,lial/lial_thermodynamics_composition,2022-05-27 00:29:36.439161,2022-05-27 00:34:08.102581,271.0,pyiron@cmleo26#4,Calphy,0.4,,
4,4,finished,,x1_lqd,/x1_lqd,lial/lial_thermodynamics_composition,2022-05-27 00:34:08.393575,2022-05-27 00:39:53.247222,344.0,pyiron@cmleo26#4,Calphy,0.4,,
5,5,finished,,x1_alli,/x1_alli,lial/lial_thermodynamics_composition,2022-05-27 00:39:53.742922,2022-05-27 00:44:11.875476,258.0,pyiron@cmleo26#4,Calphy,0.4,,
6,6,finished,,x2_sol,/x2_sol,lial/lial_thermodynamics_composition,2022-05-27 00:44:12.178900,2022-05-27 00:50:18.355354,366.0,pyiron@cmleo26#4,Calphy,0.4,,
7,7,finished,,x2_lqd,/x2_lqd,lial/lial_thermodynamics_composition,2022-05-27 00:50:18.664603,2022-05-27 00:54:28.207543,249.0,pyiron@cmleo26#4,Calphy,0.4,,
8,8,finished,,x2_alli,/x2_alli,lial/lial_thermodynamics_composition,2022-05-27 00:54:28.696677,2022-05-27 01:01:56.467409,447.0,pyiron@cmleo26#4,Calphy,0.4,,
9,9,finished,,x3_sol,/x3_sol,lial/lial_thermodynamics_composition,2022-05-27 01:01:56.729048,2022-05-27 01:07:48.331324,351.0,pyiron@cmleo26#4,Calphy,0.4,,
10,10,finished,,x3_lqd,/x3_lqd,lial/lial_thermodynamics_composition,2022-05-27 01:07:48.548404,2022-05-27 01:13:14.236686,325.0,pyiron@cmleo26#4,Calphy,0.4,,
11,11,finished,,x3_alli,/x3_alli,lial/lial_thermodynamics_composition,2022-05-27 01:13:14.712876,2022-05-27 01:18:11.052385,296.0,pyiron@cmleo26#4,Calphy,0.4,,
12,12,finished,,x4_sol,/x4_sol,lial/lial_thermodynamics_composition,2022-05-27 01:18:11.514232,2022-05-27 01:24:25.968831,374.0,pyiron@cmleo26#4,Calphy,0.4,,
13,13,finished,,x4_lqd,/x4_lqd,lial/lial_thermodynamics_composition,2022-05-27 01:24:26.355495,2022-05-27 01:29:27.170347,300.0,pyiron@cmleo26#4,Calphy,0.4,,
14,14,finished,,x4_alli,/x4_alli,lial/lial_thermodynamics_composition,2022-05-27 01:29:27.552810,2022-05-27 01:59:49.532453,1821.0,pyiron@cmleo26#4,Calphy,0.4,,
15,15,finished,,xp_sol,/xp_sol,lial/lial_thermodynamics_composition,2022-05-27 06:49:08.217437,2022-05-27 06:51:56.469011,168.0,pyiron@cmleo26#4,Calphy,0.4,,
16,16,finished,,xp_lqd,/xp_lqd,lial/lial_thermodynamics_composition,2022-05-27 06:51:56.705974,2022-05-27 06:54:42.587704,165.0,pyiron@cmleo26#4,Calphy,0.4,,
17,17,finished,,xp_alli,/xp_alli,lial/lial_thermodynamics_composition,2022-05-27 07:20:21.591321,2022-05-27 07:22:29.775974,128.0,pyiron@cmleo26#4,Calphy,0.4,,
import pandas as pd import pandas as pd
import os import os
import numpy as np
from calphy.integrators import kb
from scipy.optimize import fsolve
file_location = "../potentials/AlLi.eam.fs" file_location = "../potentials/AlLi.eam.fs"
pot_al = pd.DataFrame({ pot_al = pd.DataFrame({
...@@ -23,5 +26,93 @@ pot_alli = pd.DataFrame({ ...@@ -23,5 +26,93 @@ pot_alli = pd.DataFrame({
'Species': [['Al', 'Li']], 'Species': [['Al', 'Li']],
'Config': [['pair_style eam/fs\n', 'pair_coeff * * AlLi.eam.fs Al Li\n']] 'Config': [['pair_style eam/fs\n', 'pair_coeff * * AlLi.eam.fs Al Li\n']]
}) })
pot_lial = pd.DataFrame({
'Name': ['LiAl_eam'],
'Filename': [[os.path.abspath(file_location)]],
'Model': ["EAM"],
'Species': [['Li', 'Al']],
'Config': [['pair_style eam/fs\n', 'pair_coeff * * AlLi.eam.fs Li Al\n']]
})
potential_list = [pot_al, pot_li, pot_alli, pot_lial]
def fe_at(p, temp, threshold=1E-1):
"""
Get the free energy at a given temperature
Parameters
----------
p: pyiron Job
Pyiron job with calculated free energy and temperature
temp: float
Required temperature
threshold: optional, default 1E-1
Minimum difference needed between required temperature and temperature found in pyiron job
Returns
-------
float: free energy value at required temperature
"""
arg = np.argsort(np.abs(p.output.temperature-temp))[0]
th = np.abs(p.output.temperature-temp)[arg]
if th > threshold:
raise ValueError("not a close match, threshold %f"%th)
return p.output.energy_free[arg]
def normalise_fe(fe_arr, conc_arr):
"""
Get the enthalpy of mixing by fitting and subtracting a straight line connecting the end points.
Parameters
----------
fe_arr: list of floats
array of free energy values as function of composition
conc_arr: list of floats
array of composition values
Returns
-------
norm: list of floats
normalised free energy
m: float
slope of the fitted line
c: float
intercept of the fitted line
"""
m = (fe_arr[-1]-fe_arr[0])/(conc_arr[-1]-conc_arr[0])
c = fe_arr[-1]-m*(conc_arr[-1]-conc_arr[0])
norm = fe_arr-(m*conc_arr+c)
return norm, m, c
potential_list = [pot_al, pot_li, pot_alli] def find_common_tangent(fe1, fe2, guess_range):
\ No newline at end of file """
Do a common tangent construction between two free energy curves.
Parameters
----------
fe1: numpy array
first free energy curve
fe2: numpy array
second free energy curve
guess_range: list of floats length 2
The guess range to find end points of the common tangent
Returns
-------
res: list of floats length 2
The end points of the common tangent
"""
def _ct(x, p1, p2):
p1der = np.polyder(p1)
p2der = np.polyder(p2)
term1 = np.polyval(p1der, x[0])-np.polyval(p2der, x[1])
term2 = (np.polyval(p1, x[0]) - np.polyval(p2, x[1]))/(x[0]-x[1]) - np.polyval(p1der, x[0])
return [term1, term2]
res = fsolve(_ct, guess_range, args=(fe1, fe2))
return res
\ No newline at end of file
phase_diagram/img/Picture1.png

715 KiB

phase_diagram/img/Picture2.png

47.6 KiB

phase_diagram/img/calphy_logo.png

92.2 KiB

phase_diagram/img/cimg1.png

180 KiB

phase_diagram/img/cimg2.png

70.2 KiB

phase_diagram/img/cimg3.png

170 KiB

phase_diagram/img/cimg4.png

53.7 KiB

phase_diagram/img/cimg5.png

57 KiB

phase_diagram/img/fig1.png

52.9 KiB

phase_diagram/img/logo.png

21.1 KiB

phase_diagram/img/phase_dia_1.png

184 KiB

phase_diagram/img/potentials_logo.png

140 KiB

%% Cell type:markdown id:10444b16-f852-48eb-ab46-b5ce43e962b3 tags:
<table border="0">
<tr>
<td style="width:30%"><img src="img/potentials_logo.png" width="100%" align="justify"></td>
<td style="width:70%"> <p style="width:100%;color:#B71C1C;font-size:24px;text-align:justify"> From electrons to phase diagrams </p> <p style="width:100%,font-size:16px">Day 03 Tutorial</td>
</tr>
</table>
%% Cell type:markdown id:ad615a36-1703-4c42-822f-062109a99e3b tags:
In this notebook, we will use the potentials fitted in the previous days for the calculation of thermodynamic properties such as Helmholtz and Gibbs free energies, which in turn can be used for the calculation of phase diagrams. We will discuss calphy, the tool for automated calculation of free energies, and the methology involved.
%% Cell type:markdown id:9b8152d6-5edb-4be2-9d7b-2b80017f70bb tags:
---
%% Cell type:markdown id:bfdfcbbf-cc13-4b43-8b6e-31bc25cd4212 tags:
### <font style="color:#B71C1C" face="Helvetica" > Phase diagrams and how to calculate them </font>
%% Cell type:markdown id:c53d510c-cd30-4e38-9a42-1d84132c0e19 tags:
<table border="0">
<tr>
<td style="width:40%"><img src="img/phase_dia_1.png" width="100%" align="justify"></td>
<td style="width:60%"> <p style="font-size:14px">Phase diagrams provide a wealth of information such as: coexisting lines, melting temperature, phase stability, nucleation mechanism. </p></td>
</tr>
</table>
%% Cell type:markdown id:61ecb35b-a285-45d8-a8e5-a6a1f62d6459 tags:
### <font style="color:#B71C1C" face="Helvetica" > Calculation of phase diagrams: the essential ingredients</font>
%% Cell type:markdown id:7d819917-9a56-4589-9627-baff1e4296f3 tags:
<table border="0">
<tr>
<td style="width:50%"><img src="img/cimg4.png" width="100%" align="justify"></td>
<td style="width:50%"> <p style="font-size:14px">Phase diagrams can be evaluated from free energy diagrams. <br> <br>
The required input are: <br> <br>
&#9679; $G(P, T)$ for unary systems <br>
&#9679; $G(x, T)$ for binary systems </p></td>
</tr>
</table>
%% Cell type:markdown id:6198fc41-3bc2-4436-a272-1a168e44307a tags:
### <font style="color:#B71C1C" face="Helvetica" > Calculation of free energies: Thermodynamic integration </font>
%% Cell type:markdown id:607f3c8d-4e49-4fb6-be8d-39999eba5f7b tags:
<img src="img/fig1.png" width="1000">
%% Cell type:markdown id:8bab199b-a1a0-42eb-a595-cd545d23873a tags:
- free energy of reference system are known: Einstein crystal, [Uhlenbeck-Ford model](https://doi.org/10.1063/1.4967775)
- the two systems are coupled by
$$
H(\lambda) = \lambda H_f + (1-\lambda)\lambda H_i
$$
- Run calculations for each $\lambda$ and integrate
$$
G_f = G_i + \int_{\lambda=0}^1 d\lambda \bigg \langle \frac{\partial H(\lambda)}{\partial \lambda } \bigg \rangle
$$
%% Cell type:markdown id:4756bb61-6a01-48f8-98b1-9d076b7dccc0 tags:
To calculate $F$,
- for each phase
- for each pressure
- for each temperature
- for each $\lambda$
If we choose 100 different $\lambda$ values; 100 calculations are needed for each temperature and pressure!
**Dimensionality: (phase, $P$, $T$, $\lambda$)**
%% Cell type:markdown id:6ab61ee6-2273-408b-aad5-329601bf79a3 tags:
### <font style="color:#B71C1C" face="Helvetica" > Speeding things up: Non-equilibrium calculations </font>
%% Cell type:markdown id:c4a61c05-3f8c-47ff-b01a-8ae2c3672998 tags:
##### Non-Equilibrium Hamiltonian Interpolation
<img src="img/cimg5.png" width="600">
%% Cell type:markdown id:bb228e05-ae48-4150-a033-9e0004f09db6 tags:
In this method:
- Discrete $\lambda$ parameter is replaced by a time dependent $\lambda(t)$
- Instead of running calculations at each $\lambda$, run a single, short, non-equilibrium calculation
%% Cell type:code id:7968c6d8-f410-499f-9341-5abb6243f0a2 tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment