gebpy 1.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. gebpy/__init__.py +55 -0
  2. gebpy/__pycache__/__init__.cpython-310.pyc +0 -0
  3. gebpy/adapters/__init__.py +0 -0
  4. gebpy/cli/__init__.py +0 -0
  5. gebpy/core/__init__.py +0 -0
  6. gebpy/core/chemistry/__init__.py +0 -0
  7. gebpy/core/chemistry/common.py +1369 -0
  8. gebpy/core/chemistry/elements.py +317 -0
  9. gebpy/core/chemistry/geochemistry.py +1728 -0
  10. gebpy/core/fluids/__init__.py +0 -0
  11. gebpy/core/io/__init__.py +0 -0
  12. gebpy/core/mathematics/__init__.py +0 -0
  13. gebpy/core/minerals/__init__.py +0 -0
  14. gebpy/core/minerals/carbonates.py +412 -0
  15. gebpy/core/minerals/common.py +555 -0
  16. gebpy/core/minerals/config.py +77 -0
  17. gebpy/core/minerals/cyclosilicates.py +0 -0
  18. gebpy/core/minerals/halides.py +0 -0
  19. gebpy/core/minerals/inosilicates.py +0 -0
  20. gebpy/core/minerals/nesosilicates.py +0 -0
  21. gebpy/core/minerals/organics.py +0 -0
  22. gebpy/core/minerals/oxides.py +589 -0
  23. gebpy/core/minerals/phosphates.py +0 -0
  24. gebpy/core/minerals/phospides.py +0 -0
  25. gebpy/core/minerals/phyllosilicates.py +436 -0
  26. gebpy/core/minerals/sorosilicates.py +0 -0
  27. gebpy/core/minerals/sulfates.py +0 -0
  28. gebpy/core/minerals/sulfides.py +459 -0
  29. gebpy/core/minerals/synthesis.py +201 -0
  30. gebpy/core/minerals/tectosilicates.py +433 -0
  31. gebpy/core/physics/__init__.py +0 -0
  32. gebpy/core/physics/common.py +53 -0
  33. gebpy/core/physics/geophysics.py +351 -0
  34. gebpy/core/rocks/__init__.py +0 -0
  35. gebpy/core/rocks/anisotropic_rocks.py +395 -0
  36. gebpy/core/rocks/common.py +95 -0
  37. gebpy/core/rocks/config.py +77 -0
  38. gebpy/core/rocks/isotropic_rocks.py +395 -0
  39. gebpy/core/rocks/sedimentary.py +385 -0
  40. gebpy/core/subsurface/__init__.py +0 -0
  41. gebpy/data_minerals/__init__.py +0 -0
  42. gebpy/data_minerals/albite.yaml +59 -0
  43. gebpy/data_minerals/anatase.yaml +43 -0
  44. gebpy/data_minerals/ankerite.yaml +47 -0
  45. gebpy/data_minerals/annite.yaml +57 -0
  46. gebpy/data_minerals/anorthite.yaml +59 -0
  47. gebpy/data_minerals/antigorite.yaml +53 -0
  48. gebpy/data_minerals/aragonite.yaml +48 -0
  49. gebpy/data_minerals/argutite.yaml +43 -0
  50. gebpy/data_minerals/arsenolite.yaml +40 -0
  51. gebpy/data_minerals/au3oxide.yaml +46 -0
  52. gebpy/data_minerals/avicennite.yaml +40 -0
  53. gebpy/data_minerals/azurite.yaml +53 -0
  54. gebpy/data_minerals/baddeleyite.yaml +49 -0
  55. gebpy/data_minerals/bismite.yaml +49 -0
  56. gebpy/data_minerals/boehmite.yaml +48 -0
  57. gebpy/data_minerals/brookite.yaml +46 -0
  58. gebpy/data_minerals/brucite.yaml +45 -0
  59. gebpy/data_minerals/bunsenite.yaml +40 -0
  60. gebpy/data_minerals/calcite.yaml +45 -0
  61. gebpy/data_minerals/cassiterite.yaml +43 -0
  62. gebpy/data_minerals/cerussite.yaml +48 -0
  63. gebpy/data_minerals/chamosite.yaml +56 -0
  64. gebpy/data_minerals/chlorite.yaml +75 -0
  65. gebpy/data_minerals/chromite.yaml +42 -0
  66. gebpy/data_minerals/chrysotile.yaml +53 -0
  67. gebpy/data_minerals/claudetite.yaml +49 -0
  68. gebpy/data_minerals/clinochlore.yaml +55 -0
  69. gebpy/data_minerals/cochromite.yaml +42 -0
  70. gebpy/data_minerals/corundum.yaml +43 -0
  71. gebpy/data_minerals/crocoite.yaml +51 -0
  72. gebpy/data_minerals/cuprite.yaml +40 -0
  73. gebpy/data_minerals/cuprospinel.yaml +42 -0
  74. gebpy/data_minerals/diaspore.yaml +48 -0
  75. gebpy/data_minerals/dolomite.yaml +47 -0
  76. gebpy/data_minerals/eastonite.yaml +57 -0
  77. gebpy/data_minerals/eskolaite.yaml +43 -0
  78. gebpy/data_minerals/fechlorite.yaml +61 -0
  79. gebpy/data_minerals/fecolumbite.yaml +48 -0
  80. gebpy/data_minerals/ferberite.yaml +51 -0
  81. gebpy/data_minerals/fetantalite.yaml +48 -0
  82. gebpy/data_minerals/franklinite.yaml +42 -0
  83. gebpy/data_minerals/gahnite.yaml +42 -0
  84. gebpy/data_minerals/galaxite.yaml +42 -0
  85. gebpy/data_minerals/geikielite.yaml +45 -0
  86. gebpy/data_minerals/gibbsite.yaml +51 -0
  87. gebpy/data_minerals/glauconite.yaml +69 -0
  88. gebpy/data_minerals/goethite.yaml +48 -0
  89. gebpy/data_minerals/groutite.yaml +48 -0
  90. gebpy/data_minerals/hematite.yaml +43 -0
  91. gebpy/data_minerals/hercynite.yaml +42 -0
  92. gebpy/data_minerals/huebnerite.yaml +51 -0
  93. gebpy/data_minerals/ikaite.yaml +53 -0
  94. gebpy/data_minerals/illite.yaml +55 -0
  95. gebpy/data_minerals/ilmenite.yaml +45 -0
  96. gebpy/data_minerals/jacobsite.yaml +42 -0
  97. gebpy/data_minerals/kalsilite.yaml +47 -0
  98. gebpy/data_minerals/kaolinite.yaml +59 -0
  99. gebpy/data_minerals/karelianite.yaml +43 -0
  100. gebpy/data_minerals/lime.yaml +40 -0
  101. gebpy/data_minerals/litharge.yaml +43 -0
  102. gebpy/data_minerals/magnesiochromite.yaml +42 -0
  103. gebpy/data_minerals/magnesioferrite.yaml +42 -0
  104. gebpy/data_minerals/magnesite.yaml +45 -0
  105. gebpy/data_minerals/magnetite.yaml +41 -0
  106. gebpy/data_minerals/malachite.yaml +53 -0
  107. gebpy/data_minerals/manganite.yaml +51 -0
  108. gebpy/data_minerals/manganochromite.yaml +42 -0
  109. gebpy/data_minerals/manganosite.yaml +40 -0
  110. gebpy/data_minerals/marialite.yaml +49 -0
  111. gebpy/data_minerals/massicot.yaml +46 -0
  112. gebpy/data_minerals/meionite.yaml +49 -0
  113. gebpy/data_minerals/mgchlorite.yaml +61 -0
  114. gebpy/data_minerals/mgcolumbite.yaml +48 -0
  115. gebpy/data_minerals/mgtantalite.yaml +48 -0
  116. gebpy/data_minerals/microcline.yaml +59 -0
  117. gebpy/data_minerals/minium.yaml +44 -0
  118. gebpy/data_minerals/mnchlorite.yaml +61 -0
  119. gebpy/data_minerals/mncolumbite.yaml +48 -0
  120. gebpy/data_minerals/mntantalite.yaml +48 -0
  121. gebpy/data_minerals/monteponite.yaml +40 -0
  122. gebpy/data_minerals/montmorillonite.yaml +77 -0
  123. gebpy/data_minerals/muscovite.yaml +55 -0
  124. gebpy/data_minerals/nanepheline.yaml +47 -0
  125. gebpy/data_minerals/nichlorite.yaml +61 -0
  126. gebpy/data_minerals/nichromite.yaml +42 -0
  127. gebpy/data_minerals/nimite.yaml +55 -0
  128. gebpy/data_minerals/nontronite.yaml +73 -0
  129. gebpy/data_minerals/orthoclase.yaml +53 -0
  130. gebpy/data_minerals/paratellurite.yaml +43 -0
  131. gebpy/data_minerals/pennantite.yaml +61 -0
  132. gebpy/data_minerals/periclase.yaml +40 -0
  133. gebpy/data_minerals/phlogopite.yaml +57 -0
  134. gebpy/data_minerals/plattnerite.yaml +43 -0
  135. gebpy/data_minerals/powellite.yaml +45 -0
  136. gebpy/data_minerals/pyrite.yaml +40 -0
  137. gebpy/data_minerals/pyrolusite.yaml +43 -0
  138. gebpy/data_minerals/pyrophanite.yaml +45 -0
  139. gebpy/data_minerals/pyrophyllite.yaml +59 -0
  140. gebpy/data_minerals/quartz.yaml +43 -0
  141. gebpy/data_minerals/rhodochrosite.yaml +45 -0
  142. gebpy/data_minerals/rutile.yaml +43 -0
  143. gebpy/data_minerals/saponite.yaml +77 -0
  144. gebpy/data_minerals/scheelite.yaml +45 -0
  145. gebpy/data_minerals/scrutinyite.yaml +46 -0
  146. gebpy/data_minerals/senarmontite.yaml +40 -0
  147. gebpy/data_minerals/siderite.yaml +45 -0
  148. gebpy/data_minerals/siderophyllite.yaml +57 -0
  149. gebpy/data_minerals/smithsonite.yaml +45 -0
  150. gebpy/data_minerals/spinel.yaml +42 -0
  151. gebpy/data_minerals/stishovite.yaml +43 -0
  152. gebpy/data_minerals/stolzite.yaml +45 -0
  153. gebpy/data_minerals/talc.yaml +53 -0
  154. gebpy/data_minerals/tistarite.yaml +43 -0
  155. gebpy/data_minerals/trevorite.yaml +42 -0
  156. gebpy/data_minerals/ulvoespinel.yaml +42 -0
  157. gebpy/data_minerals/uraninite.yaml +40 -0
  158. gebpy/data_minerals/valentinite.yaml +46 -0
  159. gebpy/data_minerals/vermiculite.yaml +69 -0
  160. gebpy/data_minerals/wulfenite.yaml +45 -0
  161. gebpy/data_minerals/wustite.yaml +40 -0
  162. gebpy/data_minerals/zincite.yaml +43 -0
  163. gebpy/data_minerals/zincochromite.yaml +42 -0
  164. gebpy/data_rocks/__init__.py +0 -0
  165. gebpy/data_rocks/dolostone.yaml +40 -0
  166. gebpy/data_rocks/limestone.yaml +40 -0
  167. gebpy/data_rocks/marl.yaml +50 -0
  168. gebpy/data_rocks/sandstone.yaml +39 -0
  169. gebpy/data_rocks/shale.yaml +50 -0
  170. gebpy/gebpy_app.py +8732 -0
  171. gebpy/gui/__init__.py +0 -0
  172. gebpy/lib/images/GebPy_Header.png +0 -0
  173. gebpy/lib/images/GebPy_Icon.png +0 -0
  174. gebpy/lib/images/GebPy_Logo.png +0 -0
  175. gebpy/main.py +29 -0
  176. gebpy/modules/__init__.py +0 -0
  177. gebpy/modules/__pycache__/__init__.cpython-310.pyc +0 -0
  178. gebpy/modules/__pycache__/metamorphics.cpython-310.pyc +0 -0
  179. gebpy/modules/__pycache__/silicates.cpython-310.pyc +0 -0
  180. gebpy/modules/carbonates.py +2658 -0
  181. gebpy/modules/chemistry.py +1369 -0
  182. gebpy/modules/core.py +1805 -0
  183. gebpy/modules/elements.py +317 -0
  184. gebpy/modules/evaporites.py +1299 -0
  185. gebpy/modules/exploration.py +1145 -0
  186. gebpy/modules/fluids.py +339 -0
  187. gebpy/modules/geochemistry.py +1727 -0
  188. gebpy/modules/geophysics.py +351 -0
  189. gebpy/modules/gui.py +9093 -0
  190. gebpy/modules/gui_elements.py +145 -0
  191. gebpy/modules/halides.py +485 -0
  192. gebpy/modules/igneous.py +2241 -0
  193. gebpy/modules/metamorphics.py +3222 -0
  194. gebpy/modules/mineralogy.py +442 -0
  195. gebpy/modules/minerals.py +7954 -0
  196. gebpy/modules/ore.py +1648 -0
  197. gebpy/modules/organics.py +530 -0
  198. gebpy/modules/oxides.py +9057 -0
  199. gebpy/modules/petrophysics.py +98 -0
  200. gebpy/modules/phosphates.py +589 -0
  201. gebpy/modules/phospides.py +194 -0
  202. gebpy/modules/plotting.py +619 -0
  203. gebpy/modules/pyllosilicates.py +380 -0
  204. gebpy/modules/sedimentary_rocks.py +908 -0
  205. gebpy/modules/sequences.py +2166 -0
  206. gebpy/modules/series.py +1625 -0
  207. gebpy/modules/silicates.py +11102 -0
  208. gebpy/modules/siliciclastics.py +1846 -0
  209. gebpy/modules/subsurface_2d.py +179 -0
  210. gebpy/modules/sulfates.py +1629 -0
  211. gebpy/modules/sulfides.py +4786 -0
  212. gebpy/plotting/__init__.py +0 -0
  213. gebpy/ui_nb/__init__.py +0 -0
  214. gebpy/user_data/.gitkeep +0 -0
  215. gebpy-1.1.3.dist-info/LICENSE +165 -0
  216. gebpy-1.1.3.dist-info/METADATA +207 -0
  217. gebpy-1.1.3.dist-info/RECORD +254 -0
  218. gebpy-1.1.3.dist-info/WHEEL +5 -0
  219. gebpy-1.1.3.dist-info/entry_points.txt +2 -0
  220. gebpy-1.1.3.dist-info/top_level.txt +1 -0
  221. modules/__init__.py +0 -0
  222. modules/carbonates.py +2658 -0
  223. modules/chemistry.py +1369 -0
  224. modules/core.py +1805 -0
  225. modules/elements.py +317 -0
  226. modules/evaporites.py +1299 -0
  227. modules/exploration.py +765 -0
  228. modules/fluids.py +339 -0
  229. modules/geochemistry.py +1727 -0
  230. modules/geophysics.py +337 -0
  231. modules/gui.py +9093 -0
  232. modules/gui_elements.py +145 -0
  233. modules/halides.py +485 -0
  234. modules/igneous.py +2196 -0
  235. modules/metamorphics.py +2699 -0
  236. modules/mineralogy.py +442 -0
  237. modules/minerals.py +7954 -0
  238. modules/ore.py +1628 -0
  239. modules/organics.py +530 -0
  240. modules/oxides.py +9057 -0
  241. modules/petrophysics.py +98 -0
  242. modules/phosphates.py +589 -0
  243. modules/phospides.py +194 -0
  244. modules/plotting.py +619 -0
  245. modules/pyllosilicates.py +380 -0
  246. modules/sedimentary_rocks.py +908 -0
  247. modules/sequences.py +2166 -0
  248. modules/series.py +1625 -0
  249. modules/silicates.py +11102 -0
  250. modules/siliciclastics.py +1830 -0
  251. modules/subsurface_2d.py +179 -0
  252. modules/sulfates.py +1629 -0
  253. modules/sulfides.py +4786 -0
  254. notebooks/__init__.py +0 -0
@@ -0,0 +1,4786 @@
1
+ #!/usr/bin/env python
2
+ # -*-coding: utf-8 -*-
3
+
4
+ # -----------------------------------------------
5
+
6
+ # Name: sulfides.py
7
+ # Author: Maximilian A. Beeskow
8
+ # Version: 1.0
9
+ # Date: 09.10.2023
10
+
11
+ # -----------------------------------------------
12
+
13
+ # MODULES
14
+ import numpy as np
15
+ import random as rd
16
+ from modules.chemistry import PeriodicSystem, DataProcessing
17
+ from modules.minerals import CrystalPhysics
18
+ from modules.geophysics import BoreholeGeophysics as bg
19
+ from modules.geophysics import WellLog as wg
20
+ from modules.geochemistry import MineralChemistry, TraceElements
21
+
22
+ # Sulfides
23
+ class Sulfides():
24
+ """ Class that generates geophysical and geochemical data of sulfide minerals"""
25
+ #
26
+ def __init__(self, traces_list=[], impurity="pure", data_type=False, mineral=None):
27
+ self.traces_list = traces_list
28
+ self.impurity = impurity
29
+ self.data_type = data_type
30
+ self.mineral = mineral
31
+
32
+ # Chemistry
33
+ self.boron = ["B", 5, 10.806]
34
+ self.carbon = ["C", 6, 12.011]
35
+ self.oxygen = ["O", 8, 15.999]
36
+ self.sodium = ["Na", 11, 22.990]
37
+ self.aluminium = ["Al", 13, 26.982]
38
+ self.silicon = ["Si", 14, 28.085]
39
+ self.sulfur = ["S", 16, 32.059]
40
+ self.chlorine = ["Cl", 17, 35.450]
41
+ self.potassium = ["K", 19, 39.098]
42
+ self.calcium = ["Ca", 20, 40.078]
43
+ self.manganese = ["Mn", 25, 54.938]
44
+ self.iron = ["Fe", 26, 55.845]
45
+ self.copper = ["Cu", 29, 63.546]
46
+ self.arsenic = ["As", 33, 74.922]
47
+ self.antimony = ["Sb", 51, 121.76]
48
+ self.tungsten = ["W", 74, 183.84]
49
+
50
+ def get_data(self, number=1): # ["Pyrite", "Chalcopyrite", "Bornite", "Covellite", "Molybdenite", "Sphalerite", "Galena", "Fahlore"]
51
+ if self.mineral in ["Py", "Pyrite"]:
52
+ if number > 1:
53
+ data = [self.create_pyrite() for n in range(number)]
54
+ else:
55
+ data = self.create_pyrite()
56
+ elif self.mineral in ["Ccp", "Chalcopyrite"]:
57
+ if number > 1:
58
+ data = [self.create_chalcopyrite() for n in range(number)]
59
+ else:
60
+ data = self.create_chalcopyrite()
61
+ elif self.mineral in ["Bn", "Bornite"]:
62
+ if number > 1:
63
+ data = [self.create_bornite() for n in range(number)]
64
+ else:
65
+ data = self.create_bornite()
66
+ elif self.mineral in ["Cv", "Covellite"]:
67
+ if number > 1:
68
+ data = [self.create_covellite() for n in range(number)]
69
+ else:
70
+ data = self.create_covellite()
71
+ elif self.mineral in ["Mol", "Molybdenite"]:
72
+ if number > 1:
73
+ data = [self.create_molybdenite() for n in range(number)]
74
+ else:
75
+ data = self.create_molybdenite()
76
+ elif self.mineral in ["Sp", "Sphalerite"]:
77
+ if number > 1:
78
+ data = [self.create_sphalerite() for n in range(number)]
79
+ else:
80
+ data = self.create_sphalerite()
81
+ elif self.mineral in ["Gn", "Galena"]:
82
+ if number > 1:
83
+ data = [self.create_galena() for n in range(number)]
84
+ else:
85
+ data = self.create_galena()
86
+ elif self.mineral in ["Fh", "Fahlore"]:
87
+ if number > 1:
88
+ data = [self.create_fahlore() for n in range(number)]
89
+ else:
90
+ data = self.create_fahlore()
91
+ elif self.mineral in ["Cbt", "Cobaltite"]:
92
+ if number > 1:
93
+ data = [self.create_cobaltite() for n in range(number)]
94
+ else:
95
+ data = self.create_cobaltite()
96
+ elif self.mineral in ["Marmatite"]:
97
+ if number > 1:
98
+ data = [self.create_marmatite() for n in range(number)]
99
+ else:
100
+ data = self.create_marmatite()
101
+ #
102
+ return data
103
+ #
104
+ def generate_dataset(self, number):
105
+ dataset = {}
106
+ #
107
+ for index in range(number):
108
+ if self.mineral == "Pyrite":
109
+ data_mineral = self.create_pyrite()
110
+ elif self.mineral == "Chalcopyrite":
111
+ data_mineral = self.create_chalcopyrite()
112
+ elif self.mineral == "Galena":
113
+ data_mineral = self.create_galena()
114
+ elif self.mineral == "Acanthite":
115
+ data_mineral = self.create_acanthite()
116
+ elif self.mineral == "Chalcocite":
117
+ data_mineral = self.create_chalcocite()
118
+ elif self.mineral == "Bornite":
119
+ data_mineral = self.create_bornite()
120
+ elif self.mineral == "Pyrrhotite":
121
+ data_mineral = self.create_pyrrhotite()
122
+ elif self.mineral == "Millerite":
123
+ data_mineral = self.create_millerite()
124
+ #
125
+ # Sphalerite Group
126
+ elif self.mineral == "Sphalerite":
127
+ data_mineral = self.create_sphalerite()
128
+ elif self.mineral == "Marmatite":
129
+ data_mineral = self.create_marmatite()
130
+ #
131
+ elif self.mineral == "Pentlandite":
132
+ data_mineral = self.create_pentlandite()
133
+ elif self.mineral == "Covellite":
134
+ data_mineral = self.create_covellite()
135
+ elif self.mineral == "Cinnabar":
136
+ data_mineral = self.create_cinnabar()
137
+ elif self.mineral == "Realgar":
138
+ data_mineral = self.create_realgar()
139
+ elif self.mineral == "Orpiment":
140
+ data_mineral = self.create_orpiment()
141
+ elif self.mineral == "Stibnite":
142
+ data_mineral = self.create_stibnite()
143
+ elif self.mineral == "Marcasite":
144
+ data_mineral = self.create_marcasite()
145
+ elif self.mineral == "Molybdenite":
146
+ data_mineral = self.create_molybdenite()
147
+ elif self.mineral == "Fahlore":
148
+ data_mineral = self.create_fahlore()
149
+ elif self.mineral == "Gallite":
150
+ data_mineral = self.create_gallite()
151
+ elif self.mineral == "Roquesite":
152
+ data_mineral = self.create_roquesite()
153
+ elif self.mineral == "Lenaite":
154
+ data_mineral = self.create_lenaite()
155
+ elif self.mineral == "Laforetite":
156
+ data_mineral = self.create_laforetite()
157
+ elif self.mineral == "Vaesite":
158
+ data_mineral = self.create_vaesite()
159
+ elif self.mineral == "Cattierite":
160
+ data_mineral = self.create_cattierite()
161
+ elif self.mineral == "Cobaltite":
162
+ data_mineral = self.create_cobaltite()
163
+ #
164
+ for key, value in data_mineral.items():
165
+ if key in ["M", "rho", "rho_e", "V", "vP", "vS", "vP/vS", "K", "G", "E", "nu", "GR", "PE", "U",
166
+ "p"]:
167
+ if key not in dataset:
168
+ dataset[key] = [value]
169
+ else:
170
+ dataset[key].append(value)
171
+ elif key in ["mineral", "state", "trace elements"] and key not in dataset:
172
+ dataset[key] = value
173
+ elif key in ["chemistry"]:
174
+ if key not in dataset:
175
+ dataset[key] = {}
176
+ for key_2, value_2 in value.items():
177
+ dataset[key][key_2] = [value_2]
178
+ else:
179
+ for key_2, value_2 in value.items():
180
+ dataset[key][key_2].append(value_2)
181
+ #
182
+ return dataset
183
+ #
184
+ def create_cinnabar(self):
185
+ #
186
+ name = "Ci"
187
+ #
188
+ # Major elements
189
+ sulfur = PeriodicSystem(name="S").get_data()
190
+ mercury = PeriodicSystem(name="Hg").get_data()
191
+ majors_name = ["S", "Hg"]
192
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Hg", mercury[1], 1, mercury[2]]], dtype=object)
193
+ # Minor elements
194
+ traces_data = []
195
+ if len(self.traces_list) > 0:
196
+ self.impurity = "impure"
197
+ if self.impurity == "pure":
198
+ var_state = "fixed"
199
+ else:
200
+ var_state = "variable"
201
+ if self.impurity == "random":
202
+ self.traces_list = []
203
+ minors = [None]
204
+ n = rd.randint(1, len(minors))
205
+ while len(self.traces_list) < n:
206
+ selection = rd.choice(minors)
207
+ if selection not in self.traces_list and selection not in majors_name:
208
+ self.traces_list.append(selection)
209
+ else:
210
+ continue
211
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
212
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
213
+ for i in range(len(self.traces_list)):
214
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
215
+ if len(traces_data) > 0:
216
+ traces_data = np.array(traces_data, dtype=object)
217
+ traces_data = traces_data[traces_data[:, 1].argsort()]
218
+ #
219
+ # Molar mass
220
+ molar_mass_pure = mercury[2] + sulfur[2]
221
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
222
+ majors=majors_data).calculate_molar_mass()
223
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
224
+ # Density
225
+ dataV = CrystalPhysics([[4.149, 9.495], [], "trigonal"])
226
+ V = dataV.calculate_volume()
227
+ dataRho = CrystalPhysics([molar_mass, 3, V])
228
+ rho = dataRho.calculate_bulk_density()
229
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
230
+ # Bulk modulus
231
+ K = 8*10**9
232
+ # Shear modulus
233
+ G = 7*10**9
234
+ # Young's modulus
235
+ E = (9*K*G)/(3*K + G)
236
+ # Poisson's ratio
237
+ nu = (3*K - 2*G)/(2*(3*K + G))
238
+ # vP/vS
239
+ vPvS = ((K + 4/3*G)/G)**0.5
240
+ # P-wave velocity
241
+ vP = ((K + 4/3*G)/rho)**0.5
242
+ # S-wave velocity
243
+ vS = (G/rho)**0.5
244
+ # Gamma ray
245
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
246
+ # Photoelectricity
247
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
248
+ U = pe*rho_e*10**(-3)
249
+ # Electrical resistivity
250
+ p = None
251
+ # Thermodynamics
252
+ thermodynamics = {}
253
+ thermodynamics["Gibbs Energy"] = -45734 # J/mol
254
+ thermodynamics["Enthalpy"] = -53346 # J/mol
255
+ thermodynamics["Entropy"] = 82.425 # J/(mol K)
256
+ thermodynamics["Heat Capacity"] = 48.41 # J/(mol K)
257
+ #
258
+ if self.data_type == False:
259
+ data = []
260
+ data.append(name)
261
+ data.append(round(molar_mass, 3))
262
+ data.append(round(rho, 2))
263
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
264
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
265
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
266
+ data.append(amounts)
267
+ #
268
+ return data
269
+ else:
270
+ #
271
+ results = {}
272
+ results["mineral"] = name
273
+ results["M"] = molar_mass
274
+ element_list = np.array(amounts)[:, 0]
275
+ results["chemistry"] = {}
276
+ for index, element in enumerate(element_list, start=0):
277
+ results["chemistry"][element] = amounts[index][2]
278
+ results["rho"] = round(rho, 4)
279
+ results["rho_e"] = round(rho_e, 4)
280
+ results["V"] = round(V, 4)
281
+ results["vP"] = round(vP, 4)
282
+ results["vS"] = round(vS, 4)
283
+ results["vP/vS"] = round(vPvS, 4)
284
+ results["G"] = round(G*10**(-9), 4)
285
+ results["K"] = round(K*10**(-9), 4)
286
+ results["E"] = round(E*10**(-9), 4)
287
+ results["nu"] = round(nu, 4)
288
+ results["GR"] = round(gamma_ray, 4)
289
+ results["PE"] = round(pe, 4)
290
+ results["U"] = round(U, 4)
291
+ results["thermodynamics"] = thermodynamics
292
+ if p != None:
293
+ results["p"] = round(p, 4)
294
+ else:
295
+ results["p"] = p
296
+ #
297
+ return results
298
+ #
299
+ def create_pyrite(self):
300
+ # Major elements
301
+ sulfur = PeriodicSystem(name="S").get_data()
302
+ iron = PeriodicSystem(name="Fe").get_data()
303
+ majors_name = ["S", "Fe"]
304
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 1, iron[2]]], dtype=object)
305
+ # Trace elements
306
+ elements_traces = ["Ni", "Co", "As", "Cu", "Zn", "Ag", "Au", "Tl", "Se", "V"]
307
+ traces_data = []
308
+ if len(self.traces_list) > 0:
309
+ self.impurity = "impure"
310
+ if self.impurity == "pure":
311
+ var_state = "fixed"
312
+ else:
313
+ var_state = "variable"
314
+ if self.impurity == "random":
315
+ self.traces_list = []
316
+ minors = ["Ni", "Co", "As", "Cu", "Zn", "Ag", "Au", "Tl", "Se", "V"]
317
+ n = rd.randint(1, len(minors))
318
+ while len(self.traces_list) < n:
319
+ selection = rd.choice(minors)
320
+ if selection not in self.traces_list and selection not in majors_name:
321
+ self.traces_list.append(selection)
322
+ else:
323
+ continue
324
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
325
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
326
+ for i in range(len(self.traces_list)):
327
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
328
+ if len(traces_data) > 0:
329
+ traces_data = np.array(traces_data, dtype=object)
330
+ traces_data = traces_data[traces_data[:, 1].argsort()]
331
+ #
332
+ data = []
333
+ mineral = "Py"
334
+ #
335
+ # Molar mass
336
+ molar_mass_pure = iron[2] + 2*sulfur[2]
337
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
338
+ majors=majors_data).calculate_molar_mass()
339
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
340
+ # Density
341
+ dataV = CrystalPhysics([[5.417], [], "cubic"])
342
+ V = dataV.calculate_volume()
343
+ dataRho = CrystalPhysics([molar_mass, 4, V])
344
+ rho = dataRho.calculate_bulk_density()
345
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
346
+ # Bulk modulus
347
+ K = 146*10**9
348
+ # Shear modulus
349
+ G = 135*10**9
350
+ # Young's modulus
351
+ E = (9*K*G)/(3*K + G)
352
+ # Poisson's ratio
353
+ nu = (3*K - 2*G)/(2*(3*K + G))
354
+ # vP/vS
355
+ vPvS = ((K + 4/3*G)/G)**0.5
356
+ # P-wave velocity
357
+ vP = ((K + 4/3*G)/rho)**0.5
358
+ # S-wave velocity
359
+ vS = (G/rho)**0.5
360
+ # Gamma ray
361
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
362
+ # Photoelectricity
363
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
364
+ U = pe*rho_e*10**(-3)
365
+ # Electrical resistivity
366
+ p = 3*10**(-1)
367
+ # Thermodynamics
368
+ thermodynamics = {}
369
+ thermodynamics["Gibbs Energy"] = -159572 # J/mol
370
+ thermodynamics["Enthalpy"] = -171050 # J/mol
371
+ thermodynamics["Entropy"] = 52.930 # J/(mol K)
372
+ thermodynamics["Heat Capacity"] = 62.19 # J/(mol K)
373
+ #
374
+ if self.data_type == False:
375
+ data.append(mineral)
376
+ data.append(round(molar_mass, 3))
377
+ data.append(round(rho, 2))
378
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
379
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
380
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
381
+ data.append(amounts)
382
+ #
383
+ return data
384
+ else:
385
+ #
386
+ results = {}
387
+ results["mineral"] = "Py"
388
+ results["state"] = var_state
389
+ results["M"] = molar_mass
390
+ element_list = np.array(amounts)[:, 0]
391
+ results["chemistry"] = {}
392
+ for index, element in enumerate(element_list, start=0):
393
+ results["chemistry"][element] = amounts[index][2]
394
+ results["rho"] = round(rho, 4)
395
+ results["rho_e"] = round(rho_e, 4)
396
+ results["V"] = round(V, 4)
397
+ results["vP"] = round(vP, 4)
398
+ results["vS"] = round(vS, 4)
399
+ results["vP/vS"] = round(vPvS, 4)
400
+ results["G"] = round(G*10**(-9), 4)
401
+ results["K"] = round(K*10**(-9), 4)
402
+ results["E"] = round(E*10**(-9), 4)
403
+ results["nu"] = round(nu, 4)
404
+ results["GR"] = round(gamma_ray, 4)
405
+ results["PE"] = round(pe, 4)
406
+ results["U"] = round(U, 4)
407
+ results["thermodynamics"] = thermodynamics
408
+ results["trace elements"] = elements_traces
409
+ if p != None:
410
+ results["p"] = round(p, 4)
411
+ else:
412
+ results["p"] = p
413
+ #
414
+ return results
415
+ #
416
+ def create_bornite(self):
417
+ # Major elements
418
+ sulfur = PeriodicSystem(name="S").get_data()
419
+ iron = PeriodicSystem(name="Fe").get_data()
420
+ copper = PeriodicSystem(name="Cu").get_data()
421
+ majors_name = ["S", "Fe", "Cu"]
422
+ majors_data = np.array([["S", sulfur[1], 4, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
423
+ ["Cu", copper[1], 5, copper[2]]], dtype=object)
424
+ # Minor elements
425
+ traces_data = []
426
+ if len(self.traces_list) > 0:
427
+ self.impurity = "impure"
428
+ if self.impurity == "pure":
429
+ var_state = "fixed"
430
+ else:
431
+ var_state = "variable"
432
+ if self.impurity == "random":
433
+ self.traces_list = []
434
+ minors = ["Ag", "Ge", "Bi", "In", "Pb"]
435
+ n = rd.randint(1, len(minors))
436
+ while len(self.traces_list) < n:
437
+ selection = rd.choice(minors)
438
+ if selection not in self.traces_list and selection not in majors_name:
439
+ self.traces_list.append(selection)
440
+ else:
441
+ continue
442
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
443
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
444
+ for i in range(len(self.traces_list)):
445
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
446
+ if len(traces_data) > 0:
447
+ traces_data = np.array(traces_data, dtype=object)
448
+ traces_data = traces_data[traces_data[:, 1].argsort()]
449
+ #
450
+ data = []
451
+ mineral = "Bn"
452
+ #
453
+ # Molar mass
454
+ molar_mass_pure = 5*copper[2] + iron[2] + 4*sulfur[2]
455
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
456
+ majors=majors_data).calculate_molar_mass()
457
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
458
+ # Density
459
+ dataV = CrystalPhysics([[10.95, 21.862, 10.95], [], "orthorhombic"])
460
+ V = dataV.calculate_volume()
461
+ dataRho = CrystalPhysics([molar_mass, 16, V])
462
+ rho = dataRho.calculate_bulk_density()
463
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
464
+ # Bulk modulus
465
+ K = 92.29*10**9
466
+ # Shear modulus
467
+ G = 36.85*10**9
468
+ # Young's modulus
469
+ E = (9*K*G)/(3*K + G)
470
+ # Poisson's ratio
471
+ nu = (3*K - 2*G)/(2*(3*K + G))
472
+ # vP/vS
473
+ vPvS = ((K + 4/3*G)/G)**0.5
474
+ # P-wave velocity
475
+ vP = ((K + 4/3*G)/rho)**0.5
476
+ # S-wave velocity
477
+ vS = (G/rho)**0.5
478
+ # Gamma ray
479
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
480
+ # Photoelectricity
481
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
482
+ U = pe*rho_e*10**(-3)
483
+ # Electrical resistivity
484
+ p = None
485
+ # Thermodynamics
486
+ thermodynamics = {}
487
+ thermodynamics["Gibbs Energy"] = -394621 # J/mol
488
+ thermodynamics["Enthalpy"] = -371600 # J/mol
489
+ thermodynamics["Entropy"] = 398.500 # J/(mol K)
490
+ thermodynamics["Heat Capacity"] = 245.60 # J/(mol K)
491
+ #
492
+ if self.data_type == False:
493
+ data.append(mineral)
494
+ data.append(round(molar_mass, 3))
495
+ data.append(round(rho, 2))
496
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
497
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
498
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
499
+ data.append(amounts)
500
+ #
501
+ return data
502
+ else:
503
+ #
504
+ results = {}
505
+ results["mineral"] = mineral
506
+ results["state"] = var_state
507
+ results["M"] = molar_mass
508
+ element_list = np.array(amounts)[:, 0]
509
+ results["chemistry"] = {}
510
+ for index, element in enumerate(element_list, start=0):
511
+ results["chemistry"][element] = amounts[index][2]
512
+ results["rho"] = round(rho, 4)
513
+ results["rho_e"] = round(rho_e, 4)
514
+ results["V"] = round(V, 4)
515
+ results["vP"] = round(vP, 4)
516
+ results["vS"] = round(vS, 4)
517
+ results["vP/vS"] = round(vPvS, 4)
518
+ results["G"] = round(G*10**(-9), 4)
519
+ results["K"] = round(K*10**(-9), 4)
520
+ results["E"] = round(E*10**(-9), 4)
521
+ results["nu"] = round(nu, 4)
522
+ results["GR"] = round(gamma_ray, 4)
523
+ results["PE"] = round(pe, 4)
524
+ results["U"] = round(U, 4)
525
+ results["thermodynamics"] = thermodynamics
526
+ if p != None:
527
+ results["p"] = round(p, 4)
528
+ else:
529
+ results["p"] = p
530
+ #
531
+ return results
532
+ #
533
+ def create_galena(self):
534
+ # Major elements
535
+ sulfur = PeriodicSystem(name="S").get_data()
536
+ lead = PeriodicSystem(name="Pb").get_data()
537
+ majors_name = ["S", "Pb"]
538
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Pb", lead[1], 1, lead[2]]], dtype=object)
539
+ # Minor elements
540
+ traces_data = []
541
+ if len(self.traces_list) > 0:
542
+ self.impurity = "impure"
543
+ if self.impurity == "pure":
544
+ var_state = "fixed"
545
+ else:
546
+ var_state = "variable"
547
+ if self.impurity == "random":
548
+ self.traces_list = []
549
+ minors = ["Ag", "Cu", "Fe", "Bi"]
550
+ n = rd.randint(1, len(minors))
551
+ while len(self.traces_list) < n:
552
+ selection = rd.choice(minors)
553
+ if selection not in self.traces_list and selection not in majors_name:
554
+ self.traces_list.append(selection)
555
+ else:
556
+ continue
557
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
558
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
559
+ for i in range(len(self.traces_list)):
560
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
561
+ if len(traces_data) > 0:
562
+ traces_data = np.array(traces_data, dtype=object)
563
+ traces_data = traces_data[traces_data[:, 1].argsort()]
564
+ #
565
+ data = []
566
+ mineral = "Gn"
567
+ #
568
+ # Molar mass
569
+ molar_mass_pure = lead[2] + sulfur[2]
570
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
571
+ majors=majors_data).calculate_molar_mass()
572
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
573
+ # Density
574
+ dataV = CrystalPhysics([[5.936], [], "cubic"])
575
+ V = dataV.calculate_volume()
576
+ dataRho = CrystalPhysics([molar_mass, 4, V])
577
+ rho = dataRho.calculate_bulk_density()
578
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
579
+ # Bulk modulus
580
+ K = 52*10**9
581
+ # Shear modulus
582
+ G = 29*10**9
583
+ # Young's modulus
584
+ E = (9*K*G)/(3*K + G)
585
+ # Poisson's ratio
586
+ nu = (3*K - 2*G)/(2*(3*K + G))
587
+ # vP/vS
588
+ vPvS = ((K + 4/3*G)/G)**0.5
589
+ # P-wave velocity
590
+ vP = ((K + 4/3*G)/rho)**0.5
591
+ # S-wave velocity
592
+ vS = (G/rho)**0.5
593
+ # Gamma ray
594
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
595
+ # Photoelectricity
596
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
597
+ U = pe*rho_e*10**(-3)
598
+ # Electrical resistivity
599
+ p = None
600
+ # Thermodynamics
601
+ thermodynamics = {}
602
+ thermodynamics["Gibbs Energy"] = -96676 # J/mol
603
+ thermodynamics["Enthalpy"] = -98320 # J/mol
604
+ thermodynamics["Entropy"] = 91.340 # J/(mol K)
605
+ thermodynamics["Heat Capacity"] = 49.44 # J/(mol K)
606
+ #
607
+ if self.data_type == False:
608
+ data.append(mineral)
609
+ data.append(round(molar_mass, 3))
610
+ data.append(round(rho, 2))
611
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
612
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
613
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
614
+ data.append(amounts)
615
+ #
616
+ return data
617
+ else:
618
+ #
619
+ results = {}
620
+ results["mineral"] = "Gn"
621
+ results["state"] = var_state
622
+ results["M"] = molar_mass
623
+ element_list = np.array(amounts)[:, 0]
624
+ results["chemistry"] = {}
625
+ for index, element in enumerate(element_list, start=0):
626
+ results["chemistry"][element] = amounts[index][2]
627
+ results["rho"] = round(rho, 4)
628
+ results["rho_e"] = round(rho_e, 4)
629
+ results["V"] = round(V, 4)
630
+ results["vP"] = round(vP, 4)
631
+ results["vS"] = round(vS, 4)
632
+ results["vP/vS"] = round(vPvS, 4)
633
+ results["G"] = round(G*10**(-9), 4)
634
+ results["K"] = round(K*10**(-9), 4)
635
+ results["E"] = round(E*10**(-9), 4)
636
+ results["nu"] = round(nu, 4)
637
+ results["GR"] = round(gamma_ray, 4)
638
+ results["PE"] = round(pe, 4)
639
+ results["U"] = round(U, 4)
640
+ results["thermodynamics"] = thermodynamics
641
+ if p != None:
642
+ results["p"] = round(p, 4)
643
+ else:
644
+ results["p"] = p
645
+ #
646
+ return results
647
+ #
648
+ def create_chalcopyrite(self):
649
+ # Major elements
650
+ sulfur = PeriodicSystem(name="S").get_data()
651
+ iron = PeriodicSystem(name="Fe").get_data()
652
+ copper = PeriodicSystem(name="Cu").get_data()
653
+ majors_name = ["S", "Fe", "Cu"]
654
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
655
+ ["Cu", copper[1], 1, copper[2]]], dtype=object)
656
+ # Minor elements
657
+ traces_data = []
658
+ if len(self.traces_list) > 0:
659
+ self.impurity = "impure"
660
+ if self.impurity == "pure":
661
+ var_state = "fixed"
662
+ else:
663
+ var_state = "variable"
664
+ if self.impurity == "random":
665
+ self.traces_list = []
666
+ minors = ["Ag", "Au", "In", "Tl", "Se", "Te"]
667
+ n = rd.randint(1, len(minors))
668
+ while len(self.traces_list) < n:
669
+ selection = rd.choice(minors)
670
+ if selection not in self.traces_list and selection not in majors_name:
671
+ self.traces_list.append(selection)
672
+ else:
673
+ continue
674
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
675
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
676
+ for i in range(len(self.traces_list)):
677
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
678
+ if len(traces_data) > 0:
679
+ traces_data = np.array(traces_data, dtype=object)
680
+ traces_data = traces_data[traces_data[:, 1].argsort()]
681
+ #
682
+ data = []
683
+ mineral = "Ccp"
684
+ #
685
+ # Molar mass
686
+ molar_mass_pure = copper[2] + iron[2] + 2*sulfur[2]
687
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
688
+ majors=majors_data).calculate_molar_mass()
689
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
690
+ # Density
691
+ dataV = CrystalPhysics([[5.28, 10.41], [], "tetragonal"])
692
+ V = dataV.calculate_volume()
693
+ dataRho = CrystalPhysics([molar_mass, 4, V])
694
+ rho = dataRho.calculate_bulk_density()
695
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
696
+ # Bulk modulus
697
+ K = 56*10**9
698
+ # Shear modulus
699
+ G = 19*10**9
700
+ # Young's modulus
701
+ E = (9*K*G)/(3*K + G)
702
+ # Poisson's ratio
703
+ nu = (3*K - 2*G)/(2*(3*K + G))
704
+ # vP/vS
705
+ vPvS = ((K + 4/3*G)/G)**0.5
706
+ # P-wave velocity
707
+ vP = ((K + 4/3*G)/rho)**0.5
708
+ # S-wave velocity
709
+ vS = (G/rho)**0.5
710
+ # Gamma ray
711
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
712
+ # Photoelectricity
713
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
714
+ U = pe*rho_e*10**(-3)
715
+ # Electrical resistivity
716
+ p = None
717
+ # Thermodynamics
718
+ thermodynamics = {}
719
+ thermodynamics["Gibbs Energy"] = -194996 # J/mol
720
+ thermodynamics["Enthalpy"] = -194900 # J/mol
721
+ thermodynamics["Entropy"] = 124.900 # J/(mol K)
722
+ thermodynamics["Heat Capacity"] = 96.65 # J/(mol K)
723
+ #
724
+ if self.data_type == False:
725
+ data.append(mineral)
726
+ data.append(round(molar_mass, 3))
727
+ data.append(round(rho, 2))
728
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
729
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
730
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
731
+ data.append(amounts)
732
+ #
733
+ return data
734
+ else:
735
+ #
736
+ results = {}
737
+ results["mineral"] = "Ccp"
738
+ results["state"] = var_state
739
+ results["M"] = molar_mass
740
+ element_list = np.array(amounts)[:, 0]
741
+ results["chemistry"] = {}
742
+ for index, element in enumerate(element_list, start=0):
743
+ results["chemistry"][element] = amounts[index][2]
744
+ results["rho"] = round(rho, 4)
745
+ results["rho_e"] = round(rho_e, 4)
746
+ results["V"] = round(V, 4)
747
+ results["vP"] = round(vP, 4)
748
+ results["vS"] = round(vS, 4)
749
+ results["vP/vS"] = round(vPvS, 4)
750
+ results["G"] = round(G*10**(-9), 4)
751
+ results["K"] = round(K*10**(-9), 4)
752
+ results["E"] = round(E*10**(-9), 4)
753
+ results["nu"] = round(nu, 4)
754
+ results["GR"] = round(gamma_ray, 4)
755
+ results["PE"] = round(pe, 4)
756
+ results["U"] = round(U, 4)
757
+ results["thermodynamics"] = thermodynamics
758
+ if p != None:
759
+ results["p"] = round(p, 4)
760
+ else:
761
+ results["p"] = p
762
+ #
763
+ return results
764
+ #
765
+ def create_molybdenite(self):
766
+ # Major elements
767
+ sulfur = PeriodicSystem(name="S").get_data()
768
+ molybdenum = PeriodicSystem(name="Mo").get_data()
769
+ majors_name = ["S", "Mo"]
770
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Mo", molybdenum[1], 1, molybdenum[2]]], dtype=object)
771
+ # Minor elements
772
+ traces_data = []
773
+ if len(self.traces_list) > 0:
774
+ self.impurity = "impure"
775
+ if self.impurity == "pure":
776
+ var_state = "fixed"
777
+ else:
778
+ var_state = "variable"
779
+ if self.impurity == "random":
780
+ self.traces_list = []
781
+ minors = [None]
782
+ n = rd.randint(1, len(minors))
783
+ while len(self.traces_list) < n:
784
+ selection = rd.choice(minors)
785
+ if selection not in self.traces_list and selection not in majors_name:
786
+ self.traces_list.append(selection)
787
+ else:
788
+ continue
789
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
790
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
791
+ for i in range(len(self.traces_list)):
792
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
793
+ if len(traces_data) > 0:
794
+ traces_data = np.array(traces_data, dtype=object)
795
+ traces_data = traces_data[traces_data[:, 1].argsort()]
796
+ #
797
+ name = "Mol"
798
+ #
799
+ # Molar mass
800
+ molar_mass_pure = molybdenum[2] + 2*sulfur[2]
801
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
802
+ majors=majors_data).calculate_molar_mass()
803
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
804
+ # Density
805
+ dataV = CrystalPhysics([[3.16, 12.3], [], "hexagonal"])
806
+ V = dataV.calculate_volume()
807
+ dataRho = CrystalPhysics([molar_mass, 2, V*10**(6)])
808
+ rho = dataRho.calculate_bulk_density()
809
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
810
+ # Bulk modulus
811
+ K = 25*10**9
812
+ # Shear modulus
813
+ G = 17*10**9
814
+ # Young's modulus
815
+ E = (9*K*G)/(3*K + G)
816
+ # Poisson's ratio
817
+ nu = (3*K - 2*G)/(2*(3*K + G))
818
+ # vP/vS
819
+ vPvS = ((K + 4/3*G)/G)**0.5
820
+ # P-wave velocity
821
+ vP = ((K + 4/3*G)/rho)**0.5
822
+ # S-wave velocity
823
+ vS = (G/rho)**0.5
824
+ # Gamma ray
825
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
826
+ # Photoelectricity
827
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
828
+ U = pe*rho_e*10**(-3)
829
+ # Electrical resistivity
830
+ p = None
831
+ #
832
+ if self.data_type == False:
833
+ data = []
834
+ data.append(name)
835
+ data.append(round(molar_mass, 3))
836
+ data.append(round(rho, 2))
837
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
838
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
839
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
840
+ data.append(amounts)
841
+ #
842
+ return data
843
+ else:
844
+ #
845
+ results = {}
846
+ results["mineral"] = name
847
+ results["state"] = var_state
848
+ results["M"] = molar_mass
849
+ element_list = np.array(amounts)[:, 0]
850
+ results["chemistry"] = {}
851
+ for index, element in enumerate(element_list, start=0):
852
+ results["chemistry"][element] = amounts[index][2]
853
+ results["rho"] = round(rho, 4)
854
+ results["rho_e"] = round(rho_e, 4)
855
+ results["V"] = round(V, 4)
856
+ results["vP"] = round(vP, 4)
857
+ results["vS"] = round(vS, 4)
858
+ results["vP/vS"] = round(vPvS, 4)
859
+ results["G"] = round(G*10**(-9), 4)
860
+ results["K"] = round(K*10**(-9), 4)
861
+ results["E"] = round(E*10**(-9), 4)
862
+ results["nu"] = round(nu, 4)
863
+ results["GR"] = round(gamma_ray, 4)
864
+ results["PE"] = round(pe, 4)
865
+ results["U"] = round(U, 4)
866
+ if p != None:
867
+ results["p"] = round(p, 4)
868
+ else:
869
+ results["p"] = p
870
+ #
871
+ return results
872
+ #
873
+ def create_sphalerite(self):
874
+ # Major elements
875
+ sulfur = PeriodicSystem(name="S").get_data()
876
+ zinc = PeriodicSystem(name="Zn").get_data()
877
+ majors_name = ["S", "Zn"]
878
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Zn", zinc[1], 1, zinc[2]]], dtype=object)
879
+ # Minor elements
880
+ traces_data = []
881
+ if len(self.traces_list) > 0:
882
+ self.impurity = "impure"
883
+ if self.impurity == "pure":
884
+ var_state = "fixed"
885
+ else:
886
+ var_state = "variable"
887
+ if self.impurity == "random":
888
+ self.traces_list = []
889
+ minors = ["Mn", "Cd", "Hg", "In", "Tl", "Ga", "Ge", "Sb", "Sn", "Pb", "Ag", "Co"]
890
+ n = rd.randint(1, len(minors))
891
+ while len(self.traces_list) < n:
892
+ selection = rd.choice(minors)
893
+ if selection not in self.traces_list and selection not in majors_name:
894
+ self.traces_list.append(selection)
895
+ else:
896
+ continue
897
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
898
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
899
+ for i in range(len(self.traces_list)):
900
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
901
+ if len(traces_data) > 0:
902
+ traces_data = np.array(traces_data, dtype=object)
903
+ traces_data = traces_data[traces_data[:, 1].argsort()]
904
+ #
905
+ data = []
906
+ mineral = "Sp"
907
+ #
908
+ # Molar mass
909
+ molar_mass_pure = zinc[2] + sulfur[2]
910
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
911
+ majors=majors_data).calculate_molar_mass()
912
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
913
+ # Density
914
+ dataV = CrystalPhysics([[5.406], [], "cubic"])
915
+ V = dataV.calculate_volume()
916
+ dataRho = CrystalPhysics([molar_mass, 4, V])
917
+ rho = dataRho.calculate_bulk_density()
918
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
919
+ # Bulk modulus
920
+ K = 68*10**9
921
+ # Shear modulus
922
+ G = 33*10**9
923
+ # Young's modulus
924
+ E = (9*K*G)/(3*K + G)
925
+ # Poisson's ratio
926
+ nu = (3*K - 2*G)/(2*(3*K + G))
927
+ # vP/vS
928
+ vPvS = ((K + 4/3*G)/G)**0.5
929
+ # P-wave velocity
930
+ vP = ((K + 4/3*G)/rho)**0.5
931
+ # S-wave velocity
932
+ vS = (G/rho)**0.5
933
+ # Gamma ray
934
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
935
+ # Photoelectricity
936
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
937
+ U = pe*rho_e*10**(-3)
938
+ # Electrical resistivity
939
+ p = None
940
+ # Thermodynamics
941
+ thermodynamics = {}
942
+ thermodynamics["Gibbs Energy"] = -198600 # J/mol
943
+ thermodynamics["Enthalpy"] = -203107 # J/mol
944
+ thermodynamics["Entropy"] = 58.655 # J/(mol K)
945
+ thermodynamics["Heat Capacity"] = 45.76 # J/(mol K)
946
+ #
947
+ if self.data_type == False:
948
+ data.append(mineral)
949
+ data.append(round(molar_mass, 3))
950
+ data.append(round(rho, 2))
951
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
952
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
953
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
954
+ data.append(amounts)
955
+ #
956
+ return data
957
+ else:
958
+ #
959
+ results = {}
960
+ results["mineral"] = mineral
961
+ results["state"] = var_state
962
+ results["M"] = molar_mass
963
+ element_list = np.array(amounts)[:, 0]
964
+ results["chemistry"] = {}
965
+ for index, element in enumerate(element_list, start=0):
966
+ results["chemistry"][element] = amounts[index][2]
967
+ results["rho"] = round(rho, 4)
968
+ results["rho_e"] = round(rho_e, 4)
969
+ results["V"] = round(V, 4)
970
+ results["vP"] = round(vP, 4)
971
+ results["vS"] = round(vS, 4)
972
+ results["vP/vS"] = round(vPvS, 4)
973
+ results["G"] = round(G*10**(-9), 4)
974
+ results["K"] = round(K*10**(-9), 4)
975
+ results["E"] = round(E*10**(-9), 4)
976
+ results["nu"] = round(nu, 4)
977
+ results["GR"] = round(gamma_ray, 4)
978
+ results["PE"] = round(pe, 4)
979
+ results["U"] = round(U, 4)
980
+ results["thermodynamics"] = thermodynamics
981
+ if p != None:
982
+ results["p"] = round(p, 4)
983
+ else:
984
+ results["p"] = p
985
+ #
986
+ return results
987
+ #
988
+ def create_stibnite(self):
989
+ # Major elements
990
+ sulfur = PeriodicSystem(name="S").get_data()
991
+ antimony = PeriodicSystem(name="Sb").get_data()
992
+ majors_name = ["S", "Sb"]
993
+ majors_data = np.array([["S", sulfur[1], 3, sulfur[2]], ["Sb", antimony[1], 2, antimony[2]]], dtype=object)
994
+ # Minor elements
995
+ traces_data = []
996
+ if len(self.traces_list) > 0:
997
+ self.impurity = "impure"
998
+ if self.impurity == "pure":
999
+ var_state = "fixed"
1000
+ else:
1001
+ var_state = "variable"
1002
+ if self.impurity == "random":
1003
+ self.traces_list = []
1004
+ minors = [None]
1005
+ n = rd.randint(1, len(minors))
1006
+ while len(self.traces_list) < n:
1007
+ selection = rd.choice(minors)
1008
+ if selection not in self.traces_list and selection not in majors_name:
1009
+ self.traces_list.append(selection)
1010
+ else:
1011
+ continue
1012
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1013
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1014
+ for i in range(len(self.traces_list)):
1015
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1016
+ if len(traces_data) > 0:
1017
+ traces_data = np.array(traces_data, dtype=object)
1018
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1019
+ #
1020
+ name = "Stbn"
1021
+ #
1022
+ # Molar mass
1023
+ molar_mass_pure = 2*antimony[2] + 3*sulfur[2]
1024
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1025
+ majors=majors_data).calculate_molar_mass()
1026
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1027
+ # Density
1028
+ dataV = CrystalPhysics([[11.229,11.31, 3.893], [], "orthorhombic"])
1029
+ V = dataV.calculate_volume()
1030
+ dataRho = CrystalPhysics([molar_mass, 4, V])
1031
+ rho = dataRho.calculate_bulk_density()
1032
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1033
+ # Bulk modulus
1034
+ K = 16*10**9
1035
+ # Shear modulus
1036
+ G = 9*10**9
1037
+ # Young's modulus
1038
+ E = (9*K*G)/(3*K + G)
1039
+ # Poisson's ratio
1040
+ nu = (3*K - 2*G)/(2*(3*K + G))
1041
+ # vP/vS
1042
+ vPvS = ((K + 4/3*G)/G)**0.5
1043
+ # P-wave velocity
1044
+ vP = ((K + 4/3*G)/rho)**0.5
1045
+ # S-wave velocity
1046
+ vS = (G/rho)**0.5
1047
+ # Gamma ray
1048
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1049
+ # Photoelectricity
1050
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1051
+ U = pe*rho_e*10**(-3)
1052
+ # Electrical resistivity
1053
+ p = None
1054
+ # Thermodynamics
1055
+ thermodynamics = {}
1056
+ thermodynamics["Gibbs Energy"] = -149980 # J/mol
1057
+ thermodynamics["Enthalpy"] = -151529 # J/mol
1058
+ thermodynamics["Entropy"] = 182.004 # J/(mol K)
1059
+ thermodynamics["Heat Capacity"] = 225.19 # J/(mol K)
1060
+ #
1061
+ if self.data_type == False:
1062
+ data = []
1063
+ data.append(name)
1064
+ data.append(round(molar_mass, 3))
1065
+ data.append(round(rho, 2))
1066
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
1067
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
1068
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1069
+ data.append(amounts)
1070
+ #
1071
+ return data
1072
+ else:
1073
+ #
1074
+ results = {}
1075
+ results["mineral"] = name
1076
+ results["M"] = molar_mass
1077
+ element_list = np.array(amounts)[:, 0]
1078
+ results["chemistry"] = {}
1079
+ for index, element in enumerate(element_list, start=0):
1080
+ results["chemistry"][element] = amounts[index][2]
1081
+ results["rho"] = round(rho, 4)
1082
+ results["rho_e"] = round(rho_e, 4)
1083
+ results["V"] = round(V, 4)
1084
+ results["vP"] = round(vP, 4)
1085
+ results["vS"] = round(vS, 4)
1086
+ results["vP/vS"] = round(vPvS, 4)
1087
+ results["G"] = round(G*10**(-9), 4)
1088
+ results["K"] = round(K*10**(-9), 4)
1089
+ results["E"] = round(E*10**(-9), 4)
1090
+ results["nu"] = round(nu, 4)
1091
+ results["GR"] = round(gamma_ray, 4)
1092
+ results["PE"] = round(pe, 4)
1093
+ results["U"] = round(U, 4)
1094
+ results["thermodynamics"] = thermodynamics
1095
+ if p != None:
1096
+ results["p"] = round(p, 4)
1097
+ else:
1098
+ results["p"] = p
1099
+ #
1100
+ return results
1101
+ #
1102
+ def create_arsenopyrite(self):
1103
+ # Major elements
1104
+ sulfur = PeriodicSystem(name="S").get_data()
1105
+ iron = PeriodicSystem(name="Fe").get_data()
1106
+ arsenic = PeriodicSystem(name="As").get_data()
1107
+ majors_name = ["S", "Fe", "As"]
1108
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
1109
+ ["As", arsenic[1], 1, arsenic[2]]], dtype=object)
1110
+ # Minor elements
1111
+ traces_data = []
1112
+ if len(self.traces_list) > 0:
1113
+ self.impurity = "impure"
1114
+ if self.impurity == "pure":
1115
+ var_state = "fixed"
1116
+ else:
1117
+ var_state = "variable"
1118
+ if self.impurity == "random":
1119
+ self.traces_list = []
1120
+ minors = ["Ag", "Au", "Co", "Sn", "Ni", "Sb", "Bi", "Cu", "Pb"]
1121
+ n = rd.randint(1, len(minors))
1122
+ while len(self.traces_list) < n:
1123
+ selection = rd.choice(minors)
1124
+ if selection not in self.traces_list and selection not in majors_name:
1125
+ self.traces_list.append(selection)
1126
+ else:
1127
+ continue
1128
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1129
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1130
+ for i in range(len(self.traces_list)):
1131
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1132
+ if len(traces_data) > 0:
1133
+ traces_data = np.array(traces_data, dtype=object)
1134
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1135
+ #
1136
+ name = "Apy"
1137
+ #
1138
+ # Molar mass
1139
+ molar_mass_pure = iron[2] + arsenic[2] + sulfur[2]
1140
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1141
+ majors=majors_data).calculate_molar_mass()
1142
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1143
+ # Density
1144
+ dataV = CrystalPhysics([[5.74, 5.68, 5.79], [112.17], "monoclinic"])
1145
+ V = dataV.calculate_volume()
1146
+ dataRho = CrystalPhysics([molar_mass, 4, V])
1147
+ rho = dataRho.calculate_bulk_density()
1148
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1149
+ # Bulk modulus
1150
+ K = 143*10**9
1151
+ # Shear modulus
1152
+ G = 117*10**9
1153
+ # Young's modulus
1154
+ E = (9*K*G)/(3*K + G)
1155
+ # Poisson's ratio
1156
+ nu = (3*K - 2*G)/(2*(3*K + G))
1157
+ # vP/vS
1158
+ vPvS = ((K + 4/3*G)/G)**0.5
1159
+ # P-wave velocity
1160
+ vP = ((K + 4/3*G)/rho)**0.5
1161
+ # S-wave velocity
1162
+ vS = (G/rho)**0.5
1163
+ # Gamma ray
1164
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1165
+ # Photoelectricity
1166
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1167
+ U = pe*rho_e*10**(-3)
1168
+ # Electrical resistivity
1169
+ p = None
1170
+ # Thermodynamics
1171
+ thermodynamics = {}
1172
+ thermodynamics["Gibbs Energy"] = -136450 # J/mol
1173
+ thermodynamics["Enthalpy"] = -144370 # J/mol
1174
+ thermodynamics["Entropy"] = 68.500 # J/(mol K)
1175
+ thermodynamics["Heat Capacity"] = 68.45 # J/(mol K)
1176
+ #
1177
+ if self.data_type == False:
1178
+ data = []
1179
+ data.append(name)
1180
+ data.append(round(molar_mass, 2))
1181
+ data.append(round(rho, 1))
1182
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 2), round(vPvS, 2)])
1183
+ data.append([round(vP, 1), round(vS, 1)])
1184
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1185
+ data.append(amounts)
1186
+ #
1187
+ return data
1188
+ else:
1189
+ results = {}
1190
+ results["mineral"] = name
1191
+ results["M"] = molar_mass
1192
+ results["rho"] = round(rho, 4)
1193
+ results["rho_e"] = round(rho_e, 4)
1194
+ results["V"] = round(V, 4)
1195
+ results["vP"] = round(vP, 4)
1196
+ results["vS"] = round(vS, 4)
1197
+ results["vP/vS"] = round(vPvS, 4)
1198
+ results["G"] = round(G*10**(-9), 4)
1199
+ results["K"] = round(K*10**(-9), 4)
1200
+ results["E"] = round(E*10**(-9), 4)
1201
+ results["nu"] = round(nu, 4)
1202
+ results["GR"] = round(gamma_ray, 4)
1203
+ results["PE"] = round(pe, 4)
1204
+ results["U"] = round(U, 4)
1205
+ results["thermodynamics"] = thermodynamics
1206
+ try:
1207
+ results["p"] = round(p, 4)
1208
+ except:
1209
+ results["p"] = p
1210
+ element_list = np.array(amounts)[:, 0]
1211
+ results["chemistry"] = {}
1212
+ for index, element in enumerate(element_list, start=0):
1213
+ results["chemistry"][element] = amounts[index][2]
1214
+ #
1215
+ return results
1216
+ #
1217
+ def create_acanthite(self):
1218
+ #
1219
+ name = "Ach"
1220
+ #
1221
+ # Major elements
1222
+ sulfur = PeriodicSystem(name="S").get_data()
1223
+ silver = PeriodicSystem(name="Ag").get_data()
1224
+ majors_name = ["S", "Ag"]
1225
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Ag", silver[1], 2, silver[2]]], dtype=object)
1226
+ # Minor elements
1227
+ traces_data = []
1228
+ if len(self.traces_list) > 0:
1229
+ self.impurity = "impure"
1230
+ if self.impurity == "pure":
1231
+ var_state = "fixed"
1232
+ else:
1233
+ var_state = "variable"
1234
+ if self.impurity == "random":
1235
+ self.traces_list = []
1236
+ minors = ["Se"]
1237
+ n = rd.randint(1, len(minors))
1238
+ while len(self.traces_list) < n:
1239
+ selection = rd.choice(minors)
1240
+ if selection not in self.traces_list and selection not in majors_name:
1241
+ self.traces_list.append(selection)
1242
+ else:
1243
+ continue
1244
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1245
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1246
+ for i in range(len(self.traces_list)):
1247
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1248
+ if len(traces_data) > 0:
1249
+ traces_data = np.array(traces_data, dtype=object)
1250
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1251
+ #
1252
+ # Molar mass
1253
+ molar_mass_pure = 2*silver[2] + sulfur[2]
1254
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1255
+ majors=majors_data).calculate_molar_mass()
1256
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1257
+ # Density
1258
+ dataV = CrystalPhysics([[4.229, 6.931, 7.862], [99.61], "monoclinic"])
1259
+ V = dataV.calculate_volume()
1260
+ dataRho = CrystalPhysics([molar_mass, 4, V])
1261
+ rho = dataRho.calculate_bulk_density()
1262
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1263
+ # Bulk modulus
1264
+ K = 62.48*10**9
1265
+ # Shear modulus
1266
+ G = 22.59*10**9
1267
+ # Young's modulus
1268
+ E = (9*K*G)/(3*K + G)
1269
+ # Poisson's ratio
1270
+ nu = (3*K - 2*G)/(2*(3*K + G))
1271
+ # vP/vS
1272
+ vPvS = ((K + 4/3*G)/G)**0.5
1273
+ # P-wave velocity
1274
+ vP = ((K + 4/3*G)/rho)**0.5
1275
+ # S-wave velocity
1276
+ vS = (G/rho)**0.5
1277
+ # Gamma ray
1278
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1279
+ # Photoelectricity
1280
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1281
+ U = pe*rho_e*10**(-3)
1282
+ # Electrical resistivity
1283
+ p = None
1284
+ # Thermodynamics
1285
+ thermodynamics = {}
1286
+ thermodynamics["Gibbs Energy"] = -39448 # J/mol
1287
+ thermodynamics["Enthalpy"] = -31589 # J/mol
1288
+ thermodynamics["Entropy"] = 143.511 # J/(mol K)
1289
+ thermodynamics["Heat Capacity"] = 76.12 # J/(mol K)
1290
+ #
1291
+ if self.data_type == False:
1292
+ data = []
1293
+ data.append(name)
1294
+ data.append(round(molar_mass, 2))
1295
+ data.append(round(rho, 1))
1296
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 2), round(vPvS, 2)])
1297
+ data.append([round(vP, 1), round(vS, 1)])
1298
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1299
+ data.append(amounts)
1300
+ #
1301
+ return data
1302
+ else:
1303
+ results = {}
1304
+ results["mineral"] = name
1305
+ results["M"] = molar_mass
1306
+ results["rho"] = round(rho, 4)
1307
+ results["rho_e"] = round(rho_e, 4)
1308
+ results["V"] = round(V, 4)
1309
+ results["vP"] = round(vP, 4)
1310
+ results["vS"] = round(vS, 4)
1311
+ results["vP/vS"] = round(vPvS, 4)
1312
+ results["G"] = round(G*10**(-9), 4)
1313
+ results["K"] = round(K*10**(-9), 4)
1314
+ results["E"] = round(E*10**(-9), 4)
1315
+ results["nu"] = round(nu, 4)
1316
+ results["GR"] = round(gamma_ray, 4)
1317
+ results["PE"] = round(pe, 4)
1318
+ results["U"] = round(U, 4)
1319
+ results["thermodynamics"] = thermodynamics
1320
+ try:
1321
+ results["p"] = round(p, 4)
1322
+ except:
1323
+ results["p"] = p
1324
+ element_list = np.array(amounts)[:, 0]
1325
+ results["chemistry"] = {}
1326
+ for index, element in enumerate(element_list, start=0):
1327
+ results["chemistry"][element] = amounts[index][2]
1328
+ #
1329
+ return results
1330
+ #
1331
+ def create_argentite(self):
1332
+ # Major elements
1333
+ sulfur = PeriodicSystem(name="S").get_data()
1334
+ silver = PeriodicSystem(name="Ag").get_data()
1335
+ majors_name = ["S", "Ag"]
1336
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Ag", silver[1], 2, silver[2]]], dtype=object)
1337
+ # Minor elements
1338
+ traces_data = []
1339
+ if len(self.traces_list) > 0:
1340
+ self.impurity = "impure"
1341
+ if self.impurity == "pure":
1342
+ var_state = "fixed"
1343
+ else:
1344
+ var_state = "variable"
1345
+ if self.impurity == "random":
1346
+ self.traces_list = []
1347
+ minors = ["Se"]
1348
+ n = rd.randint(1, len(minors))
1349
+ while len(self.traces_list) < n:
1350
+ selection = rd.choice(minors)
1351
+ if selection not in self.traces_list and selection not in majors_name:
1352
+ self.traces_list.append(selection)
1353
+ else:
1354
+ continue
1355
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1356
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1357
+ for i in range(len(self.traces_list)):
1358
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1359
+ if len(traces_data) > 0:
1360
+ traces_data = np.array(traces_data, dtype=object)
1361
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1362
+ #
1363
+ data = []
1364
+ mineral = "Argt"
1365
+ #
1366
+ # Molar mass
1367
+ molar_mass_pure = 2*silver[2] + sulfur[2]
1368
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1369
+ majors=majors_data).calculate_molar_mass()
1370
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1371
+ # Density
1372
+ dataV = CrystalPhysics([[4.89], [], "cubic"])
1373
+ V = dataV.calculate_volume()
1374
+ dataRho = CrystalPhysics([molar_mass, 2, V])
1375
+ rho = dataRho.calculate_bulk_density()
1376
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1377
+ # Bulk modulus
1378
+ K = 63.37*10**9
1379
+ # Shear modulus
1380
+ G = 22.61*10**9
1381
+ # Young's modulus
1382
+ E = (9*K*G)/(3*K + G)
1383
+ # Poisson's ratio
1384
+ nu = (3*K - 2*G)/(2*(3*K + G))
1385
+ # vP/vS
1386
+ vPvS = ((K + 4/3*G)/G)**0.5
1387
+ # P-wave velocity
1388
+ vP = ((K + 4/3*G)/rho)**0.5
1389
+ # S-wave velocity
1390
+ vS = (G/rho)**0.5
1391
+ # Gamma ray
1392
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1393
+ # Photoelectricity
1394
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1395
+ U = pe*rho_e*10**(-3)
1396
+ # Electrical resistivity
1397
+ p = None
1398
+ #
1399
+ data.append(mineral)
1400
+ data.append(round(molar_mass, 3))
1401
+ data.append(round(rho, 2))
1402
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
1403
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
1404
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1405
+ data.append(amounts)
1406
+ #
1407
+ return data
1408
+ #
1409
+ def create_alabandite(self):
1410
+ # Major elements
1411
+ sulfur = PeriodicSystem(name="S").get_data()
1412
+ manganese = PeriodicSystem(name="Mn").get_data()
1413
+ majors_name = ["S", "Mn"]
1414
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Mn", manganese[1], 1, manganese[2]]], dtype=object)
1415
+ # Minor elements
1416
+ traces_data = []
1417
+ if len(self.traces_list) > 0:
1418
+ self.impurity = "impure"
1419
+ if self.impurity == "pure":
1420
+ var_state = "fixed"
1421
+ else:
1422
+ var_state = "variable"
1423
+ if self.impurity == "random":
1424
+ self.traces_list = []
1425
+ minors = ["Fe", "Mg", "Co"]
1426
+ n = rd.randint(1, len(minors))
1427
+ while len(self.traces_list) < n:
1428
+ selection = rd.choice(minors)
1429
+ if selection not in self.traces_list and selection not in majors_name:
1430
+ self.traces_list.append(selection)
1431
+ else:
1432
+ continue
1433
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1434
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1435
+ for i in range(len(self.traces_list)):
1436
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1437
+ if len(traces_data) > 0:
1438
+ traces_data = np.array(traces_data, dtype=object)
1439
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1440
+ #
1441
+ name = "Ab"
1442
+ #
1443
+ # Molar mass
1444
+ molar_mass_pure = manganese[2] + sulfur[2]
1445
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1446
+ majors=majors_data).calculate_molar_mass()
1447
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1448
+ # Density
1449
+ dataV = CrystalPhysics([[5.214], [99.61], "cubic"])
1450
+ V = dataV.calculate_volume()
1451
+ dataRho = CrystalPhysics([molar_mass, 4, V])
1452
+ rho = dataRho.calculate_bulk_density()
1453
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1454
+ # Bulk modulus
1455
+ K = 56*10**9
1456
+ # Shear modulus
1457
+ G = 39*10**9
1458
+ # Young's modulus
1459
+ E = (9*K*G)/(3*K + G)
1460
+ # Poisson's ratio
1461
+ nu = (3*K - 2*G)/(2*(3*K + G))
1462
+ # vP/vS
1463
+ vPvS = ((K + 4/3*G)/G)**0.5
1464
+ # P-wave velocity
1465
+ vP = ((K + 4/3*G)/rho)**0.5
1466
+ # S-wave velocity
1467
+ vS = (G/rho)**0.5
1468
+ # Gamma ray
1469
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1470
+ # Photoelectricity
1471
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1472
+ U = pe*rho_e*10**(-3)
1473
+ # Electrical resistivity
1474
+ p = None
1475
+ # Thermodynamics
1476
+ thermodynamics = {}
1477
+ thermodynamics["Gibbs Energy"] = -218313 # J/mol
1478
+ thermodynamics["Enthalpy"] = -213462 # J/mol
1479
+ thermodynamics["Entropy"] = 80.333 # J/(mol K)
1480
+ thermodynamics["Heat Capacity"] = 49.94 # J/(mol K)
1481
+ #
1482
+ if self.data_type == False:
1483
+ data = []
1484
+ data.append(name)
1485
+ data.append(round(molar_mass, 2))
1486
+ data.append(round(rho, 1))
1487
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 2), round(vPvS, 2)])
1488
+ data.append([round(vP, 1), round(vS, 1)])
1489
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1490
+ data.append(amounts)
1491
+ #
1492
+ return data
1493
+ else:
1494
+ results = {}
1495
+ results["mineral"] = name
1496
+ results["M"] = molar_mass
1497
+ results["rho"] = round(rho, 4)
1498
+ results["rho_e"] = round(rho_e, 4)
1499
+ results["V"] = round(V, 4)
1500
+ results["vP"] = round(vP, 4)
1501
+ results["vS"] = round(vS, 4)
1502
+ results["vP/vS"] = round(vPvS, 4)
1503
+ results["G"] = round(G*10**(-9), 4)
1504
+ results["K"] = round(K*10**(-9), 4)
1505
+ results["E"] = round(E*10**(-9), 4)
1506
+ results["nu"] = round(nu, 4)
1507
+ results["GR"] = round(gamma_ray, 4)
1508
+ results["PE"] = round(pe, 4)
1509
+ results["U"] = round(U, 4)
1510
+ results["thermodynamics"] = thermodynamics
1511
+ try:
1512
+ results["p"] = round(p, 4)
1513
+ except:
1514
+ results["p"] = p
1515
+ element_list = np.array(amounts)[:, 0]
1516
+ results["chemistry"] = {}
1517
+ for index, element in enumerate(element_list, start=0):
1518
+ results["chemistry"][element] = amounts[index][2]
1519
+ #
1520
+ return results
1521
+ #
1522
+ def create_berthierite(self):
1523
+ # Major elements
1524
+ sulfur = PeriodicSystem(name="S").get_data()
1525
+ iron = PeriodicSystem(name="Fe").get_data()
1526
+ antimony = PeriodicSystem(name="Sb").get_data()
1527
+ majors_name = ["S", "Fe", "Sb"]
1528
+ majors_data = np.array([["S", sulfur[1], 4, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
1529
+ ["Sb", antimony[1], 2, antimony[2]]], dtype=object)
1530
+ # Minor elements
1531
+ traces_data = []
1532
+ if len(self.traces_list) > 0:
1533
+ self.impurity = "impure"
1534
+ if self.impurity == "pure":
1535
+ var_state = "fixed"
1536
+ else:
1537
+ var_state = "variable"
1538
+ if self.impurity == "random":
1539
+ self.traces_list = []
1540
+ minors = ["Mn", "Cu", "Pb", "Ag"]
1541
+ n = rd.randint(1, len(minors))
1542
+ while len(self.traces_list) < n:
1543
+ selection = rd.choice(minors)
1544
+ if selection not in self.traces_list and selection not in majors_name:
1545
+ self.traces_list.append(selection)
1546
+ else:
1547
+ continue
1548
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1549
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1550
+ for i in range(len(self.traces_list)):
1551
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1552
+ if len(traces_data) > 0:
1553
+ traces_data = np.array(traces_data, dtype=object)
1554
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1555
+ #
1556
+ name = "Brt"
1557
+ #
1558
+ # Molar mass
1559
+ molar_mass_pure = iron[2] + 2*antimony[2] + 4*sulfur[2]
1560
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1561
+ majors=majors_data).calculate_molar_mass()
1562
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1563
+ # Density
1564
+ dataV = CrystalPhysics([[11.44, 14.12, 3.76], [], "orthorhombic"])
1565
+ V = dataV.calculate_volume()
1566
+ dataRho = CrystalPhysics([molar_mass, 4, V])
1567
+ rho = dataRho.calculate_bulk_density()
1568
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1569
+ # Bulk modulus
1570
+ K = 60.34*10**9
1571
+ # Shear modulus
1572
+ G = 24.92*10**9
1573
+ # Young's modulus
1574
+ E = (9*K*G)/(3*K + G)
1575
+ # Poisson's ratio
1576
+ nu = (3*K - 2*G)/(2*(3*K + G))
1577
+ # vP/vS
1578
+ vPvS = ((K + 4/3*G)/G)**0.5
1579
+ # P-wave velocity
1580
+ vP = ((K + 4/3*G)/rho)**0.5
1581
+ # S-wave velocity
1582
+ vS = (G/rho)**0.5
1583
+ # Gamma ray
1584
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1585
+ # Photoelectricity
1586
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1587
+ U = pe*rho_e*10**(-3)
1588
+ # Electrical resistivity
1589
+ p = None
1590
+ # Thermodynamics
1591
+ thermodynamics = {}
1592
+ thermodynamics["Gibbs Energy"] = -255960 # J/mol
1593
+ thermodynamics["Enthalpy"] = -256426 # J/mol
1594
+ thermodynamics["Entropy"] = 245.015 # J/(mol K)
1595
+ thermodynamics["Heat Capacity"] = 177.09 # J/(mol K)
1596
+ #
1597
+ if self.data_type == False:
1598
+ data = []
1599
+ data.append(name)
1600
+ data.append(round(molar_mass, 2))
1601
+ data.append(round(rho, 1))
1602
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 2), round(vPvS, 2)])
1603
+ data.append([round(vP, 1), round(vS, 1)])
1604
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1605
+ data.append(amounts)
1606
+ #
1607
+ return data
1608
+ else:
1609
+ results = {}
1610
+ results["mineral"] = name
1611
+ results["M"] = molar_mass
1612
+ results["rho"] = round(rho, 4)
1613
+ results["rho_e"] = round(rho_e, 4)
1614
+ results["V"] = round(V, 4)
1615
+ results["vP"] = round(vP, 4)
1616
+ results["vS"] = round(vS, 4)
1617
+ results["vP/vS"] = round(vPvS, 4)
1618
+ results["G"] = round(G*10**(-9), 4)
1619
+ results["K"] = round(K*10**(-9), 4)
1620
+ results["E"] = round(E*10**(-9), 4)
1621
+ results["nu"] = round(nu, 4)
1622
+ results["GR"] = round(gamma_ray, 4)
1623
+ results["PE"] = round(pe, 4)
1624
+ results["U"] = round(U, 4)
1625
+ results["thermodynamics"] = thermodynamics
1626
+ try:
1627
+ results["p"] = round(p, 4)
1628
+ except:
1629
+ results["p"] = p
1630
+ element_list = np.array(amounts)[:, 0]
1631
+ results["chemistry"] = {}
1632
+ for index, element in enumerate(element_list, start=0):
1633
+ results["chemistry"][element] = amounts[index][2]
1634
+ #
1635
+ return results
1636
+ #
1637
+ def create_pyrrhotite_group(self):
1638
+ # Major elements
1639
+ sulfur = PeriodicSystem(name="S").get_data()
1640
+ iron = PeriodicSystem(name="Fe").get_data()
1641
+ majors_name = ["S", "Fe"]
1642
+ n_Fe = [1, 7, 11]
1643
+ n_S = [1, 8, 12]
1644
+ i = rd.randint(0, 2)
1645
+ x = round(rd.uniform(0, 1), 4)
1646
+ n_Fe = 1 + 10*x
1647
+ n_S = 1 + 11*x
1648
+ majors_data = np.array([["S", sulfur[1], n_S, sulfur[2]], ["Fe", iron[1], n_Fe, iron[2]]], dtype=object)
1649
+ majors_data_low = np.array([["S", sulfur[1], 1, sulfur[2]], ["Fe", iron[1], 1, iron[2]]], dtype=object)
1650
+ majors_data_med = np.array([["S", sulfur[1], 8, sulfur[2]], ["Fe", iron[1], 7, iron[2]]], dtype=object)
1651
+ majors_data_high = np.array([["S", sulfur[1], 12, sulfur[2]], ["Fe", iron[1], 11, iron[2]]], dtype=object)
1652
+ # Minor elements
1653
+ traces_data = []
1654
+ if len(self.traces_list) > 0:
1655
+ self.impurity = "impure"
1656
+ if self.impurity == "pure":
1657
+ var_state = "fixed"
1658
+ else:
1659
+ var_state = "variable"
1660
+ if self.impurity == "random":
1661
+ self.traces_list = []
1662
+ minors = ["Ni", "Co", "Cu"]
1663
+ n = rd.randint(1, len(minors))
1664
+ while len(self.traces_list) < n:
1665
+ selection = rd.choice(minors)
1666
+ if selection not in self.traces_list and selection not in majors_name:
1667
+ self.traces_list.append(selection)
1668
+ else:
1669
+ continue
1670
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1671
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1672
+ for i in range(len(self.traces_list)):
1673
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1674
+ if len(traces_data) > 0:
1675
+ traces_data = np.array(traces_data, dtype=object)
1676
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1677
+ #
1678
+ data = []
1679
+ mineral = "Po"
1680
+ #
1681
+ # Molar mass
1682
+ molar_mass_pure = n_Fe*iron[2] + n_S*sulfur[2]
1683
+ molar_mass, amounts = MineralChemistry(
1684
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure, majors=majors_data).calculate_molar_mass()
1685
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1686
+ #
1687
+ molar_mass_pure_low = 1*iron[2] + 1*sulfur[2]
1688
+ molar_mass_low, amounts_low = MineralChemistry(
1689
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_low, majors=majors_data_low).calculate_molar_mass()
1690
+ element_low = [PeriodicSystem(name=amounts_low[i][0]).get_data() for i in range(len(amounts_low))]
1691
+ #
1692
+ molar_mass_pure_med = 7*iron[2] + 8*sulfur[2]
1693
+ molar_mass_med, amounts_med = MineralChemistry(
1694
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_med, majors=majors_data_med).calculate_molar_mass()
1695
+ element_med = [PeriodicSystem(name=amounts_med[i][0]).get_data() for i in range(len(amounts_med))]
1696
+ #
1697
+ molar_mass_pure_high = 11*iron[2] + 12*sulfur[2]
1698
+ molar_mass_high, amounts_high = MineralChemistry(
1699
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_high, majors=majors_data_high).calculate_molar_mass()
1700
+ element_high = [PeriodicSystem(name=amounts_high[i][0]).get_data() for i in range(len(amounts_high))]
1701
+ # Density
1702
+ dataV_low = CrystalPhysics([[3.407, 5.727], [], "hexagonal"])
1703
+ V_low = dataV_low.calculate_volume()
1704
+ dataRho_low = CrystalPhysics([molar_mass_pure_low, 2, V_low*10**(6)])
1705
+ rho_low = dataRho_low.calculate_bulk_density()
1706
+ rho_e_low = wg(amounts=amounts_low, elements=element_low, rho_b=rho_low).calculate_electron_density()
1707
+ #
1708
+ dataV_med = CrystalPhysics([[5.740, 6.151, 11.172], [83.295], "monoclinic"])
1709
+ V_med = dataV_med.calculate_volume()
1710
+ dataRho_med = CrystalPhysics([molar_mass_pure_med, 2, V_med])
1711
+ rho_med = dataRho_med.calculate_bulk_density()
1712
+ rho_e_med = wg(amounts=amounts_med, elements=element_med, rho_b=rho_med).calculate_electron_density()
1713
+ #
1714
+ dataV_high = CrystalPhysics([[6.624, 6.579, 16.231], [57.314], "monoclinic"])
1715
+ V_high = dataV_high.calculate_volume()
1716
+ dataRho_high = CrystalPhysics([molar_mass_pure_high, 2, V_high])
1717
+ rho_high = dataRho_high.calculate_bulk_density()
1718
+ rho_e_high = wg(amounts=amounts_high, elements=element_high, rho_b=rho_high).calculate_electron_density()
1719
+ #
1720
+ V = -65.31*(2*x + 1)**2 + 530.08*(2*x + 1) - 407.21
1721
+ rho = -166.29*(2*x + 1)**2 + 916.23*(2*x + 1) + 4320.97
1722
+ rho_e = -166.67*(2*x + 1)**2 + 910.38*(2*x + 1) + 4101.98
1723
+ # Bulk modulus
1724
+ K_l = 118.93*10**9
1725
+ K_m = 141.25*10**9
1726
+ K_h = 144.00*10**9
1727
+ K = (-9.785*(2*x + 1)**2 + 51.675*(2*x + 1) + 77.040)*10**9
1728
+ # Shear modulus
1729
+ G_l = 48.91*10**9
1730
+ G_m = 58.33*10**9
1731
+ G_h = 59.29*10**9
1732
+ G = (-4.230*(2*x + 1)**2 + 22.110*(2*x + 1) + 31.030)*10**9
1733
+ # Young's modulus
1734
+ E = (9*K*G)/(3*K + G)
1735
+ # Poisson's ratio
1736
+ nu = (3*K - 2*G)/(2*(3*K + G))
1737
+ # vP/vS
1738
+ vPvS = ((K + 4/3*G)/G)**0.5
1739
+ # P-wave velocity
1740
+ vP = ((K + 4/3*G)/rho)**0.5
1741
+ # S-wave velocity
1742
+ vS = (G/rho)**0.5
1743
+ # Gamma ray
1744
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1745
+ # Photoelectricity
1746
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1747
+ U = pe*rho_e*10**(-3)
1748
+ # Electrical resistivity
1749
+ p = None
1750
+ # Thermodynamics
1751
+ thermodynamics = {}
1752
+ thermodynamics["Gibbs Energy"] = -99289 # J/mol
1753
+ thermodynamics["Enthalpy"] = -96291 # J/mol
1754
+ thermodynamics["Entropy"] = 69.429 # J/(mol K)
1755
+ thermodynamics["Heat Capacity"] = 50.50 # J/(mol K)
1756
+ #
1757
+ if self.data_type == False:
1758
+ data.append(mineral)
1759
+ data.append(round(molar_mass, 3))
1760
+ data.append(round(rho, 2))
1761
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
1762
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
1763
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1764
+ data.append(amounts)
1765
+ #
1766
+ return data
1767
+ else:
1768
+ #
1769
+ results = {}
1770
+ results["mineral"] = mineral
1771
+ results["M"] = molar_mass
1772
+ element_list = np.array(amounts)[:, 0]
1773
+ results["chemistry"] = {}
1774
+ for index, element in enumerate(element_list, start=0):
1775
+ results["chemistry"][element] = amounts[index][2]
1776
+ results["rho"] = round(rho, 4)
1777
+ results["rho_e"] = round(rho_e, 4)
1778
+ results["V"] = round(V, 4)
1779
+ results["vP"] = round(vP, 4)
1780
+ results["vS"] = round(vS, 4)
1781
+ results["vP/vS"] = round(vPvS, 4)
1782
+ results["G"] = round(G*10**(-9), 4)
1783
+ results["K"] = round(K*10**(-9), 4)
1784
+ results["E"] = round(E*10**(-9), 4)
1785
+ results["nu"] = round(nu, 4)
1786
+ results["GR"] = round(gamma_ray, 4)
1787
+ results["PE"] = round(pe, 4)
1788
+ results["U"] = round(U, 4)
1789
+ results["thermodynamics"] = thermodynamics
1790
+ if p != None:
1791
+ results["p"] = round(p, 4)
1792
+ else:
1793
+ results["p"] = p
1794
+ #
1795
+ return results
1796
+ #
1797
+ def create_pyrrhotite(self):
1798
+ # Major elements
1799
+ sulfur = PeriodicSystem(name="S").get_data()
1800
+ iron = PeriodicSystem(name="Fe").get_data()
1801
+ majors_name = ["S", "Fe"]
1802
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Fe", iron[1], 1, iron[2]]], dtype=object)
1803
+ # Minor elements
1804
+ traces_data = []
1805
+ if len(self.traces_list) > 0:
1806
+ self.impurity = "impure"
1807
+ if self.impurity == "pure":
1808
+ var_state = "fixed"
1809
+ else:
1810
+ var_state = "variable"
1811
+ if self.impurity == "random":
1812
+ self.traces_list = []
1813
+ minors = ["Ni", "Co", "Cu"]
1814
+ n = rd.randint(1, len(minors))
1815
+ while len(self.traces_list) < n:
1816
+ selection = rd.choice(minors)
1817
+ if selection not in self.traces_list and selection not in majors_name:
1818
+ self.traces_list.append(selection)
1819
+ else:
1820
+ continue
1821
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1822
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1823
+ for i in range(len(self.traces_list)):
1824
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1825
+ if len(traces_data) > 0:
1826
+ traces_data = np.array(traces_data, dtype=object)
1827
+ traces_data = traces_data[traces_data[:, 1].argsort()]
1828
+ #
1829
+ data = []
1830
+ mineral = "Po"
1831
+ #
1832
+ # Molar mass
1833
+ x = round(rd.uniform(0, 0.17), 4)
1834
+ molar_mass_pure = (1-x)*iron[2] + sulfur[2]
1835
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1836
+ majors=majors_data).calculate_molar_mass()
1837
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1838
+ # Density
1839
+ dataV = CrystalPhysics([[12.811, 6.87, 11.885], [117, 3], "monoclinic"])
1840
+ V = dataV.calculate_volume()
1841
+ dataRho = CrystalPhysics([molar_mass_pure, 26, V])
1842
+ rho = dataRho.calculate_bulk_density()
1843
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1844
+ # Bulk modulus
1845
+ K = 143.18*10**9
1846
+ # Shear modulus
1847
+ G = 59.31*10**9
1848
+ # Young's modulus
1849
+ E = (9*K*G)/(3*K + G)
1850
+ # Poisson's ratio
1851
+ nu = (3*K - 2*G)/(2*(3*K + G))
1852
+ # vP/vS
1853
+ vPvS = ((K + 4/3*G)/G)**0.5
1854
+ # P-wave velocity
1855
+ vP = ((K + 4/3*G)/rho)**0.5
1856
+ # S-wave velocity
1857
+ vS = (G/rho)**0.5
1858
+ # Gamma ray
1859
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1860
+ # Photoelectricity
1861
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
1862
+ U = pe*rho_e*10**(-3)
1863
+ # Electrical resistivity
1864
+ p = None
1865
+ # Thermodynamics
1866
+ thermodynamics = {}
1867
+ thermodynamics["Gibbs Energy"] = -99289 # J/mol
1868
+ thermodynamics["Enthalpy"] = -96291 # J/mol
1869
+ thermodynamics["Entropy"] = 69.429 # J/(mol K)
1870
+ thermodynamics["Heat Capacity"] = 50.50 # J/(mol K)
1871
+ #
1872
+ if self.data_type == False:
1873
+ data.append(mineral)
1874
+ data.append(round(molar_mass, 3))
1875
+ data.append(round(rho, 2))
1876
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
1877
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
1878
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1879
+ data.append(amounts)
1880
+ #
1881
+ return data
1882
+ else:
1883
+ #
1884
+ results = {}
1885
+ results["mineral"] = mineral
1886
+ results["M"] = molar_mass
1887
+ element_list = np.array(amounts)[:, 0]
1888
+ results["chemistry"] = {}
1889
+ for index, element in enumerate(element_list, start=0):
1890
+ results["chemistry"][element] = amounts[index][2]
1891
+ results["rho"] = round(rho, 4)
1892
+ results["rho_e"] = round(rho_e, 4)
1893
+ results["V"] = round(V, 4)
1894
+ results["vP"] = round(vP, 4)
1895
+ results["vS"] = round(vS, 4)
1896
+ results["vP/vS"] = round(vPvS, 4)
1897
+ results["G"] = round(G*10**(-9), 4)
1898
+ results["K"] = round(K*10**(-9), 4)
1899
+ results["E"] = round(E*10**(-9), 4)
1900
+ results["nu"] = round(nu, 4)
1901
+ results["GR"] = round(gamma_ray, 4)
1902
+ results["PE"] = round(pe, 4)
1903
+ results["U"] = round(U, 4)
1904
+ results["thermodynamics"] = thermodynamics
1905
+ if p != None:
1906
+ results["p"] = round(p, 4)
1907
+ else:
1908
+ results["p"] = p
1909
+ #
1910
+ return results
1911
+ #
1912
+ # def create_cobaltite(self):
1913
+ # # Major elements
1914
+ # sulfur = PeriodicSystem(name="S").get_data()
1915
+ # cobalt = PeriodicSystem(name="Co").get_data()
1916
+ # arsenic = PeriodicSystem(name="As").get_data()
1917
+ # majors_name = ["S", "Co", "As"]
1918
+ # majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Co", cobalt[1], 1, cobalt[2]],
1919
+ # ["As", arsenic[1], 1, arsenic[2]]], dtype=object)
1920
+ # # Minor elements
1921
+ # traces_data = []
1922
+ # if len(self.traces_list) > 0:
1923
+ # self.impurity = "impure"
1924
+ # if self.impurity == "pure":
1925
+ # var_state = "fixed"
1926
+ # else:
1927
+ # var_state = "variable"
1928
+ # if self.impurity == "random":
1929
+ # self.traces_list = []
1930
+ # minors = ["Cu", "Pb", "Sb", "Fe", "Ni"]
1931
+ # n = rd.randint(1, len(minors))
1932
+ # while len(self.traces_list) < n:
1933
+ # selection = rd.choice(minors)
1934
+ # if selection not in self.traces_list and selection not in majors_name:
1935
+ # self.traces_list.append(selection)
1936
+ # else:
1937
+ # continue
1938
+ # traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
1939
+ # x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
1940
+ # for i in range(len(self.traces_list)):
1941
+ # traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
1942
+ # if len(traces_data) > 0:
1943
+ # traces_data = np.array(traces_data, dtype=object)
1944
+ # traces_data = traces_data[traces_data[:, 1].argsort()]
1945
+ # #
1946
+ # data = []
1947
+ # mineral = "Cob"
1948
+ # #
1949
+ # # Molar mass
1950
+ # molar_mass_pure = cobalt[2] + arsenic[2] + sulfur[2]
1951
+ # molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
1952
+ # majors=majors_data).calculate_molar_mass()
1953
+ # element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
1954
+ # # Density
1955
+ # dataV = CrystalPhysics([[5.57, 5.582, 5.582], [], "orthorhombic"])
1956
+ # V = dataV.calculate_volume()
1957
+ # dataRho = CrystalPhysics([molar_mass_pure, 4, V])
1958
+ # rho = dataRho.calculate_bulk_density()
1959
+ # rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
1960
+ # # Bulk modulus
1961
+ # K = 139*10**9
1962
+ # # Shear modulus
1963
+ # G = 104*10**9
1964
+ # # Young's modulus
1965
+ # E = (9*K*G)/(3*K + G)
1966
+ # # Poisson's ratio
1967
+ # nu = (3*K - 2*G)/(2*(3*K + G))
1968
+ # # vP/vS
1969
+ # vPvS = ((K + 4/3*G)/G)**0.5
1970
+ # # P-wave velocity
1971
+ # vP = ((K + 4/3*G)/rho)**0.5
1972
+ # # S-wave velocity
1973
+ # vS = (G/rho)**0.5
1974
+ # # Gamma ray
1975
+ # gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
1976
+ # # Photoelectricity
1977
+ # pe = wg(amounts=amounts, elements=element).calculate_pe()
1978
+ # U = pe*rho_e*10**(-3)
1979
+ # # Electrical resistivity
1980
+ # p = None
1981
+ # #
1982
+ # data.append(mineral)
1983
+ # data.append(round(molar_mass, 3))
1984
+ # data.append(round(rho, 2))
1985
+ # data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
1986
+ # data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
1987
+ # data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
1988
+ # data.append(amounts)
1989
+ # #
1990
+ # return data
1991
+ #
1992
+ def create_carrollite(self):
1993
+ # Major elements
1994
+ sulfur = PeriodicSystem(name="S").get_data()
1995
+ cobalt = PeriodicSystem(name="Co").get_data()
1996
+ copper = PeriodicSystem(name="Cu").get_data()
1997
+ majors_name = ["S", "Co", "Cu"]
1998
+ majors_data = np.array([["S", sulfur[1], 4, sulfur[2]], ["Co", cobalt[1], 2, cobalt[2]],
1999
+ ["Cu", copper[1], 1, copper[2]]], dtype=object)
2000
+ # Minor elements
2001
+ traces_data = []
2002
+ if len(self.traces_list) > 0:
2003
+ self.impurity = "impure"
2004
+ if self.impurity == "pure":
2005
+ var_state = "fixed"
2006
+ else:
2007
+ var_state = "variable"
2008
+ if self.impurity == "random":
2009
+ self.traces_list = []
2010
+ minors = [None]
2011
+ n = rd.randint(1, len(minors))
2012
+ while len(self.traces_list) < n:
2013
+ selection = rd.choice(minors)
2014
+ if selection not in self.traces_list and selection not in majors_name:
2015
+ self.traces_list.append(selection)
2016
+ else:
2017
+ continue
2018
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2019
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2020
+ for i in range(len(self.traces_list)):
2021
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2022
+ if len(traces_data) > 0:
2023
+ traces_data = np.array(traces_data, dtype=object)
2024
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2025
+ #
2026
+ data = []
2027
+ mineral = "Carr"
2028
+ #
2029
+ # Molar mass
2030
+ molar_mass_pure = copper[2] + 2*cobalt[2] + 4*sulfur[2]
2031
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2032
+ majors=majors_data).calculate_molar_mass()
2033
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2034
+ # Density
2035
+ dataV = CrystalPhysics([[9.477], [], "cubic"])
2036
+ V = dataV.calculate_volume()
2037
+ dataRho = CrystalPhysics([molar_mass_pure, 8, V])
2038
+ rho = dataRho.calculate_bulk_density()
2039
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2040
+ # Bulk modulus
2041
+ K = 106.49*10**9
2042
+ # Shear modulus
2043
+ G = 45.71*10**9
2044
+ # Young's modulus
2045
+ E = (9*K*G)/(3*K + G)
2046
+ # Poisson's ratio
2047
+ nu = (3*K - 2*G)/(2*(3*K + G))
2048
+ # vP/vS
2049
+ vPvS = ((K + 4/3*G)/G)**0.5
2050
+ # P-wave velocity
2051
+ vP = ((K + 4/3*G)/rho)**0.5
2052
+ # S-wave velocity
2053
+ vS = (G/rho)**0.5
2054
+ # Gamma ray
2055
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2056
+ # Photoelectricity
2057
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2058
+ U = pe*rho_e*10**(-3)
2059
+ # Electrical resistivity
2060
+ p = None
2061
+ #
2062
+ data.append(mineral)
2063
+ data.append(round(molar_mass, 3))
2064
+ data.append(round(rho, 2))
2065
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2066
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2067
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2068
+ data.append(amounts)
2069
+ #
2070
+ return data
2071
+ #
2072
+ def create_chalcocite(self):
2073
+ #
2074
+ name = "Cc"
2075
+ #
2076
+ # Major elements
2077
+ sulfur = PeriodicSystem(name="S").get_data()
2078
+ copper = PeriodicSystem(name="Cu").get_data()
2079
+ majors_name = ["S", "Cu"]
2080
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Cu", copper[1], 2, copper[2]]], dtype=object)
2081
+ # Minor elements
2082
+ traces_data = []
2083
+ if len(self.traces_list) > 0:
2084
+ self.impurity = "impure"
2085
+ if self.impurity == "pure":
2086
+ var_state = "fixed"
2087
+ else:
2088
+ var_state = "variable"
2089
+ if self.impurity == "random":
2090
+ self.traces_list = []
2091
+ minors = ["Fe"]
2092
+ n = rd.randint(1, len(minors))
2093
+ while len(self.traces_list) < n:
2094
+ selection = rd.choice(minors)
2095
+ if selection not in self.traces_list and selection not in majors_name:
2096
+ self.traces_list.append(selection)
2097
+ else:
2098
+ continue
2099
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2100
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2101
+ for i in range(len(self.traces_list)):
2102
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2103
+ if len(traces_data) > 0:
2104
+ traces_data = np.array(traces_data, dtype=object)
2105
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2106
+ #
2107
+ # Molar mass
2108
+ molar_mass_pure = 2*copper[2] + sulfur[2]
2109
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2110
+ majors=majors_data).calculate_molar_mass()
2111
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2112
+ # Density
2113
+ dataV = CrystalPhysics([[11.881, 27.323, 13.491], [116.35], "monoclinic"])
2114
+ V = dataV.calculate_volume()
2115
+ dataRho = CrystalPhysics([molar_mass_pure, 96, V])
2116
+ rho = dataRho.calculate_bulk_density()
2117
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2118
+ # Bulk modulus
2119
+ K = 101.98*10**9
2120
+ # Shear modulus
2121
+ G = 39.12*10**9
2122
+ # Young's modulus
2123
+ E = (9*K*G)/(3*K + G)
2124
+ # Poisson's ratio
2125
+ nu = (3*K - 2*G)/(2*(3*K + G))
2126
+ # vP/vS
2127
+ vPvS = ((K + 4/3*G)/G)**0.5
2128
+ # P-wave velocity
2129
+ vP = ((K + 4/3*G)/rho)**0.5
2130
+ # S-wave velocity
2131
+ vS = (G/rho)**0.5
2132
+ # Gamma ray
2133
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2134
+ # Photoelectricity
2135
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2136
+ U = pe*rho_e*10**(-3)
2137
+ # Electrical resistivity
2138
+ p = None
2139
+ # Thermodynamics
2140
+ thermodynamics = {}
2141
+ thermodynamics["Gibbs Energy"] = -84205 # J/mol
2142
+ thermodynamics["Enthalpy"] = -78884 # J/mol
2143
+ thermodynamics["Entropy"] = 116.200 # J/(mol K)
2144
+ thermodynamics["Heat Capacity"] = 76.32 # J/(mol K)
2145
+ #
2146
+ if self.data_type == False:
2147
+ data = []
2148
+ data.append(name)
2149
+ data.append(round(molar_mass, 2))
2150
+ data.append(round(rho, 1))
2151
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 2), round(vPvS, 2)])
2152
+ data.append([round(vP, 1), round(vS, 1)])
2153
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2154
+ data.append(amounts)
2155
+ #
2156
+ return data
2157
+ else:
2158
+ results = {}
2159
+ results["mineral"] = name
2160
+ results["M"] = molar_mass
2161
+ results["rho"] = round(rho, 4)
2162
+ results["rho_e"] = round(rho_e, 4)
2163
+ results["V"] = round(V, 4)
2164
+ results["vP"] = round(vP, 4)
2165
+ results["vS"] = round(vS, 4)
2166
+ results["vP/vS"] = round(vPvS, 4)
2167
+ results["G"] = round(G*10**(-9), 4)
2168
+ results["K"] = round(K*10**(-9), 4)
2169
+ results["E"] = round(E*10**(-9), 4)
2170
+ results["nu"] = round(nu, 4)
2171
+ results["GR"] = round(gamma_ray, 4)
2172
+ results["PE"] = round(pe, 4)
2173
+ results["U"] = round(U, 4)
2174
+ results["thermodynamics"] = thermodynamics
2175
+ try:
2176
+ results["p"] = round(p, 4)
2177
+ except:
2178
+ results["p"] = p
2179
+ element_list = np.array(amounts)[:, 0]
2180
+ results["chemistry"] = {}
2181
+ for index, element in enumerate(element_list, start=0):
2182
+ results["chemistry"][element] = amounts[index][2]
2183
+ #
2184
+ return results
2185
+ #
2186
+ def create_digenite(self):
2187
+ # Major elements
2188
+ sulfur = PeriodicSystem(name="S").get_data()
2189
+ copper = PeriodicSystem(name="Cu").get_data()
2190
+ majors_name = ["S", "Cu"]
2191
+ majors_data = np.array([["S", sulfur[1], 5, sulfur[2]], ["Cu", copper[1], 9, copper[2]]], dtype=object)
2192
+ # Minor elements
2193
+ traces_data = []
2194
+ if len(self.traces_list) > 0:
2195
+ self.impurity = "impure"
2196
+ if self.impurity == "pure":
2197
+ var_state = "fixed"
2198
+ else:
2199
+ var_state = "variable"
2200
+ if self.impurity == "random":
2201
+ self.traces_list = []
2202
+ minors = ["Fe"]
2203
+ n = rd.randint(1, len(minors))
2204
+ while len(self.traces_list) < n:
2205
+ selection = rd.choice(minors)
2206
+ if selection not in self.traces_list and selection not in majors_name:
2207
+ self.traces_list.append(selection)
2208
+ else:
2209
+ continue
2210
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2211
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2212
+ for i in range(len(self.traces_list)):
2213
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2214
+ if len(traces_data) > 0:
2215
+ traces_data = np.array(traces_data, dtype=object)
2216
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2217
+ #
2218
+ mineral = "Dg"
2219
+ #
2220
+ # Molar mass
2221
+ molar_mass_pure = 9*copper[2] + 5*sulfur[2]
2222
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2223
+ majors=majors_data).calculate_molar_mass()
2224
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2225
+ # Density
2226
+ dataV = CrystalPhysics([[3.919, 48], [], "trigonal"])
2227
+ V = dataV.calculate_volume()
2228
+ dataRho = CrystalPhysics([molar_mass_pure, 3, V])
2229
+ rho = dataRho.calculate_bulk_density()
2230
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2231
+ # Bulk modulus
2232
+ K = 101.13*10**9
2233
+ # Shear modulus
2234
+ G = 38.28*10**9
2235
+ # Young's modulus
2236
+ E = (9*K*G)/(3*K + G)
2237
+ # Poisson's ratio
2238
+ nu = (3*K - 2*G)/(2*(3*K + G))
2239
+ # vP/vS
2240
+ vPvS = ((K + 4/3*G)/G)**0.5
2241
+ # P-wave velocity
2242
+ vP = ((K + 4/3*G)/rho)**0.5
2243
+ # S-wave velocity
2244
+ vS = (G/rho)**0.5
2245
+ # Gamma ray
2246
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2247
+ # Photoelectricity
2248
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2249
+ U = pe*rho_e*10**(-3)
2250
+ # Electrical resistivity
2251
+ p = None
2252
+ #
2253
+ if self.data_type == False:
2254
+ data = []
2255
+ data.append(mineral)
2256
+ data.append(round(molar_mass, 3))
2257
+ data.append(round(rho, 2))
2258
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2259
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2260
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2261
+ data.append(amounts)
2262
+ #
2263
+ return data
2264
+ else:
2265
+ #
2266
+ results = {}
2267
+ results["mineral"] = mineral
2268
+ results["M"] = molar_mass
2269
+ element_list = np.array(amounts)[:, 0]
2270
+ results["chemistry"] = {}
2271
+ for index, element in enumerate(element_list, start=0):
2272
+ results["chemistry"][element] = amounts[index][2]
2273
+ results["rho"] = round(rho, 4)
2274
+ results["rho_e"] = round(rho_e, 4)
2275
+ results["V"] = round(V, 4)
2276
+ results["vP"] = round(vP, 4)
2277
+ results["vS"] = round(vS, 4)
2278
+ results["vP/vS"] = round(vPvS, 4)
2279
+ results["G"] = round(G*10**(-9), 4)
2280
+ results["K"] = round(K*10**(-9), 4)
2281
+ results["E"] = round(E*10**(-9), 4)
2282
+ results["nu"] = round(nu, 4)
2283
+ results["GR"] = round(gamma_ray, 4)
2284
+ results["PE"] = round(pe, 4)
2285
+ results["U"] = round(U, 4)
2286
+ if p != None:
2287
+ results["p"] = round(p, 4)
2288
+ else:
2289
+ results["p"] = p
2290
+ #
2291
+ return results
2292
+ #
2293
+ def create_tennantite(self):
2294
+ # Major elements
2295
+ sulfur = PeriodicSystem(name="S").get_data()
2296
+ copper = PeriodicSystem(name="Cu").get_data()
2297
+ arsenic = PeriodicSystem(name="As").get_data()
2298
+ majors_name = ["S", "Cu", "As"]
2299
+ majors_data = np.array([["S", sulfur[1], 13, sulfur[2]], ["Cu", copper[1], 12, copper[2]],
2300
+ ["As", arsenic[1], 4, arsenic[2]]], dtype=object)
2301
+ # Minor elements
2302
+ traces_data = []
2303
+ if len(self.traces_list) > 0:
2304
+ self.impurity = "impure"
2305
+ if self.impurity == "pure":
2306
+ var_state = "fixed"
2307
+ else:
2308
+ var_state = "variable"
2309
+ if self.impurity == "random":
2310
+ self.traces_list = []
2311
+ minors = ["Ag", "Fe", "Zn", "Pb"]
2312
+ n = rd.randint(1, len(minors))
2313
+ while len(self.traces_list) < n:
2314
+ selection = rd.choice(minors)
2315
+ if selection not in self.traces_list and selection not in majors_name:
2316
+ self.traces_list.append(selection)
2317
+ else:
2318
+ continue
2319
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2320
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2321
+ for i in range(len(self.traces_list)):
2322
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2323
+ if len(traces_data) > 0:
2324
+ traces_data = np.array(traces_data, dtype=object)
2325
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2326
+ #
2327
+ data = []
2328
+ mineral = "Tn"
2329
+ #
2330
+ # Molar mass
2331
+ molar_mass_pure = 12*copper[2] + 4*arsenic[2] + 13*sulfur[2]
2332
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2333
+ majors=majors_data).calculate_molar_mass()
2334
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2335
+ # Density
2336
+ dataV = CrystalPhysics([[10.186], [], "cubic"])
2337
+ V = dataV.calculate_volume()
2338
+ dataRho = CrystalPhysics([molar_mass_pure, 2, V])
2339
+ rho = dataRho.calculate_bulk_density()
2340
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2341
+ # Bulk modulus
2342
+ K = 70.29*10**9
2343
+ # Shear modulus
2344
+ G = 28.87*10**9
2345
+ # Young's modulus
2346
+ E = (9*K*G)/(3*K + G)
2347
+ # Poisson's ratio
2348
+ nu = (3*K - 2*G)/(2*(3*K + G))
2349
+ # vP/vS
2350
+ vPvS = ((K + 4/3*G)/G)**0.5
2351
+ # P-wave velocity
2352
+ vP = ((K + 4/3*G)/rho)**0.5
2353
+ # S-wave velocity
2354
+ vS = (G/rho)**0.5
2355
+ # Gamma ray
2356
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2357
+ # Photoelectricity
2358
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2359
+ U = pe*rho_e*10**(-3)
2360
+ # Electrical resistivity
2361
+ p = None
2362
+ #
2363
+ data.append(mineral)
2364
+ data.append(round(molar_mass, 3))
2365
+ data.append(round(rho, 2))
2366
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2367
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2368
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2369
+ data.append(amounts)
2370
+ #
2371
+ return data
2372
+ #
2373
+ def create_tetrahedrite(self):
2374
+ # Major elements
2375
+ sulfur = PeriodicSystem(name="S").get_data()
2376
+ copper = PeriodicSystem(name="Cu").get_data()
2377
+ antimony = PeriodicSystem(name="Sb").get_data()
2378
+ majors_name = ["S", "Cu", "Sb"]
2379
+ majors_data = np.array([["S", sulfur[1], 13, sulfur[2]], ["Cu", copper[1], 12, copper[2]],
2380
+ ["Sb", antimony[1], 4, antimony[2]]], dtype=object)
2381
+ # Minor elements
2382
+ traces_data = []
2383
+ if len(self.traces_list) > 0:
2384
+ self.impurity = "impure"
2385
+ if self.impurity == "pure":
2386
+ var_state = "fixed"
2387
+ else:
2388
+ var_state = "variable"
2389
+ if self.impurity == "random":
2390
+ self.traces_list = []
2391
+ minors = ["Ag", "Fe", "Zn", "Pb"]
2392
+ n = rd.randint(1, len(minors))
2393
+ while len(self.traces_list) < n:
2394
+ selection = rd.choice(minors)
2395
+ if selection not in self.traces_list and selection not in majors_name:
2396
+ self.traces_list.append(selection)
2397
+ else:
2398
+ continue
2399
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2400
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2401
+ for i in range(len(self.traces_list)):
2402
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2403
+ if len(traces_data) > 0:
2404
+ traces_data = np.array(traces_data, dtype=object)
2405
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2406
+ #
2407
+ data = []
2408
+ mineral = "Td"
2409
+ #
2410
+ # Molar mass
2411
+ molar_mass_pure = 12*copper[2] + 4*antimony[2] + 13*sulfur[2]
2412
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2413
+ majors=majors_data).calculate_molar_mass()
2414
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2415
+ # Density
2416
+ dataV = CrystalPhysics([[10.33], [], "cubic"])
2417
+ V = dataV.calculate_volume()
2418
+ dataRho = CrystalPhysics([molar_mass_pure, 2, V])
2419
+ rho = dataRho.calculate_bulk_density()
2420
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2421
+ # Bulk modulus
2422
+ K = 59*10**9
2423
+ # Shear modulus
2424
+ G = 13*10**9
2425
+ # Young's modulus
2426
+ E = (9*K*G)/(3*K + G)
2427
+ # Poisson's ratio
2428
+ nu = (3*K - 2*G)/(2*(3*K + G))
2429
+ # vP/vS
2430
+ vPvS = ((K + 4/3*G)/G)**0.5
2431
+ # P-wave velocity
2432
+ vP = ((K + 4/3*G)/rho)**0.5
2433
+ # S-wave velocity
2434
+ vS = (G/rho)**0.5
2435
+ # Gamma ray
2436
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2437
+ # Photoelectricity
2438
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2439
+ U = pe*rho_e*10**(-3)
2440
+ # Electrical resistivity
2441
+ p = None
2442
+ #
2443
+ data.append(mineral)
2444
+ data.append(round(molar_mass, 3))
2445
+ data.append(round(rho, 2))
2446
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2447
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2448
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2449
+ data.append(amounts)
2450
+ #
2451
+ return data
2452
+ #
2453
+ def create_tennantite_group(self):
2454
+ # Major elements
2455
+ sulfur = PeriodicSystem(name="S").get_data()
2456
+ iron = PeriodicSystem(name="Fe").get_data()
2457
+ copper = PeriodicSystem(name="Cu").get_data()
2458
+ zinc = PeriodicSystem(name="Zn").get_data()
2459
+ arsenic = PeriodicSystem(name="As").get_data()
2460
+ majors_name = ["S", "Fe", "Cu", "Zn", "As"]
2461
+ majors_data = np.array([["S", sulfur[1], 13, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
2462
+ ["Cu", copper[1], 10, copper[2]], ["Zn", zinc[1], 1, zinc[2]],
2463
+ ["As", arsenic[1], 4, arsenic[2]]], dtype=object)
2464
+ # Minor elements
2465
+ traces_data = []
2466
+ if len(self.traces_list) > 0:
2467
+ self.impurity = "impure"
2468
+ if self.impurity == "pure":
2469
+ var_state = "variable"
2470
+ else:
2471
+ var_state = "variable"
2472
+ if self.impurity == "random":
2473
+ self.traces_list = []
2474
+ minors = ["Ag", "Pb"]
2475
+ n = rd.randint(1, len(minors))
2476
+ while len(self.traces_list) < n:
2477
+ selection = rd.choice(minors)
2478
+ if selection not in self.traces_list and selection not in majors_name:
2479
+ self.traces_list.append(selection)
2480
+ else:
2481
+ continue
2482
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2483
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2484
+ for i in range(len(self.traces_list)):
2485
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2486
+ if len(traces_data) > 0:
2487
+ traces_data = np.array(traces_data, dtype=object)
2488
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2489
+ #
2490
+ data = []
2491
+ mineral = "Tn"
2492
+ #
2493
+ # Molar mass
2494
+ x = round(rd.uniform(0, 1), 4)
2495
+ molar_mass_pure = 10*copper[2] + 2*(x*iron[2] + (1-x)*zinc[2]) + 4*arsenic[2] + 13*sulfur[2]
2496
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2497
+ majors=majors_data).calculate_molar_mass()
2498
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2499
+ # Density
2500
+ dataV = CrystalPhysics([[10.186], [], "cubic"])
2501
+ V = dataV.calculate_volume()
2502
+ dataRho = CrystalPhysics([molar_mass_pure, 2, V])
2503
+ rho = dataRho.calculate_bulk_density()
2504
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2505
+ # Bulk modulus
2506
+ K = 70.29*10**9
2507
+ # Shear modulus
2508
+ G = 28.87*10**9
2509
+ # Young's modulus
2510
+ E = (9*K*G)/(3*K + G)
2511
+ # Poisson's ratio
2512
+ nu = (3*K - 2*G)/(2*(3*K + G))
2513
+ # vP/vS
2514
+ vPvS = ((K + 4/3*G)/G)**0.5
2515
+ # P-wave velocity
2516
+ vP = ((K + 4/3*G)/rho)**0.5
2517
+ # S-wave velocity
2518
+ vS = (G/rho)**0.5
2519
+ # Gamma ray
2520
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2521
+ # Photoelectricity
2522
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2523
+ U = pe*rho_e*10**(-3)
2524
+ # Electrical resistivity
2525
+ p = None
2526
+ #
2527
+ data.append(mineral)
2528
+ data.append([round(molar_mass, 3), x])
2529
+ data.append(round(rho, 2))
2530
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2531
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2532
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2533
+ data.append(amounts)
2534
+ #
2535
+ return data
2536
+ #
2537
+ def create_tetrahedrite_group(self):
2538
+ # Major elements
2539
+ sulfur = PeriodicSystem(name="S").get_data()
2540
+ iron = PeriodicSystem(name="Fe").get_data()
2541
+ copper = PeriodicSystem(name="Cu").get_data()
2542
+ zinc = PeriodicSystem(name="Zn").get_data()
2543
+ antimony = PeriodicSystem(name="Sb").get_data()
2544
+ majors_name = ["S", "Fe", "Cu", "Zn", "Sb"]
2545
+ majors_data = np.array([["S", sulfur[1], 13, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
2546
+ ["Cu", copper[1], 10, copper[2]], ["Zn", zinc[1], 1, zinc[2]],
2547
+ ["Sb", antimony[1], 4, antimony[2]]], dtype=object)
2548
+ # Minor elements
2549
+ traces_data = []
2550
+ if len(self.traces_list) > 0:
2551
+ self.impurity = "impure"
2552
+ if self.impurity == "pure":
2553
+ var_state = "variable"
2554
+ else:
2555
+ var_state = "variable"
2556
+ if self.impurity == "random":
2557
+ self.traces_list = []
2558
+ minors = ["Ag", "Pb"]
2559
+ n = rd.randint(1, len(minors))
2560
+ while len(self.traces_list) < n:
2561
+ selection = rd.choice(minors)
2562
+ if selection not in self.traces_list and selection not in majors_name:
2563
+ self.traces_list.append(selection)
2564
+ else:
2565
+ continue
2566
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2567
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2568
+ for i in range(len(self.traces_list)):
2569
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2570
+ if len(traces_data) > 0:
2571
+ traces_data = np.array(traces_data, dtype=object)
2572
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2573
+ #
2574
+ data = []
2575
+ mineral = "Td"
2576
+ #
2577
+ # Molar mass
2578
+ x = round(rd.uniform(0, 1), 4)
2579
+ molar_mass_pure = 10*copper[2] + 2*(x*iron[2] + (1-x)*zinc[2]) + 4*antimony[2] + 13*sulfur[2]
2580
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2581
+ majors=majors_data).calculate_molar_mass()
2582
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2583
+ # Density
2584
+ dataV = CrystalPhysics([[10.33], [], "cubic"])
2585
+ V = dataV.calculate_volume()
2586
+ dataRho = CrystalPhysics([molar_mass_pure, 2, V])
2587
+ rho = dataRho.calculate_bulk_density()
2588
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2589
+ # Bulk modulus
2590
+ K = 59*10**9
2591
+ # Shear modulus
2592
+ G = 13*10**9
2593
+ # Young's modulus
2594
+ E = (9*K*G)/(3*K + G)
2595
+ # Poisson's ratio
2596
+ nu = (3*K - 2*G)/(2*(3*K + G))
2597
+ # vP/vS
2598
+ vPvS = ((K + 4/3*G)/G)**0.5
2599
+ # P-wave velocity
2600
+ vP = ((K + 4/3*G)/rho)**0.5
2601
+ # S-wave velocity
2602
+ vS = (G/rho)**0.5
2603
+ # Gamma ray
2604
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2605
+ # Photoelectricity
2606
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2607
+ U = pe*rho_e*10**(-3)
2608
+ # Electrical resistivity
2609
+ p = None
2610
+ #
2611
+ data.append(mineral)
2612
+ data.append([round(molar_mass, 3), x])
2613
+ data.append(round(rho, 2))
2614
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2615
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2616
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2617
+ data.append(amounts)
2618
+ #
2619
+ return data
2620
+ #
2621
+ def create_fahlore(self):
2622
+ name = "Fh"
2623
+ # Major elements
2624
+ majors_name = ["S", "Fe", "Cu", "As", "Sb"]
2625
+ # Minor elements
2626
+ traces_data = []
2627
+ if len(self.traces_list) > 0:
2628
+ self.impurity = "impure"
2629
+ if self.impurity == "pure":
2630
+ var_state = "variable"
2631
+ else:
2632
+ var_state = "variable"
2633
+ if self.impurity == "random":
2634
+ self.traces_list = []
2635
+ minors = ["Ag", "Pb", "Zn"]
2636
+ n = rd.randint(1, len(minors))
2637
+ while len(self.traces_list) < n:
2638
+ selection = rd.choice(minors)
2639
+ if selection not in self.traces_list and selection not in majors_name:
2640
+ self.traces_list.append(selection)
2641
+ else:
2642
+ continue
2643
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2644
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2645
+ for i in range(len(self.traces_list)):
2646
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2647
+ if len(traces_data) > 0:
2648
+ traces_data = np.array(traces_data, dtype=object)
2649
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2650
+ # Molar mass
2651
+ x = round(rd.uniform(0.75, 0.925), 4)
2652
+ y = round(rd.uniform(0, 1), 4)
2653
+ majors_data = np.array([
2654
+ ["S", self.sulfur[1], 13, self.sulfur[2]], ["Fe", self.iron[1], 12*(1-x), self.iron[2]],
2655
+ ["Cu", self.copper[1], 12*x, self.copper[2]], ["As", self.arsenic[1], 4*y, self.arsenic[2]],
2656
+ ["Sb", self.antimony[1], 4*(1-y), self.antimony[2]]], dtype=object)
2657
+ molar_mass_pure = (12*(x*self.copper[2] + (1-x)*self.iron[2]) + 4*(y*self.arsenic[2] + (1-y)*self.antimony[2]) +
2658
+ 13*self.sulfur[2])
2659
+ molar_mass, amounts = MineralChemistry(
2660
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure, majors=majors_data).calculate_molar_mass()
2661
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2662
+
2663
+ majors_data_tn = np.array([
2664
+ ["S", self.sulfur[1], 13, self.sulfur[2]], ["Fe", self.iron[1], 0, self.iron[2]],
2665
+ ["Cu", self.copper[1], 12, self.copper[2]], ["As", self.arsenic[1], 4, self.arsenic[2]],
2666
+ ["Sb", self.antimony[1], 0, self.antimony[2]]], dtype=object)
2667
+ molar_mass_pure_tn = 12*self.copper[2] + 4*self.arsenic[2] + 13*self.sulfur[2]
2668
+ molar_mass_tn, amounts_tn = MineralChemistry(
2669
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_tn, majors=majors_data_tn).calculate_molar_mass()
2670
+ element_tn = [PeriodicSystem(name=amounts_tn[i][0]).get_data() for i in range(len(amounts_tn))]
2671
+
2672
+ majors_data_td = np.array([
2673
+ ["S", self.sulfur[1], 13, self.sulfur[2]], ["Fe", self.iron[1], 0, self.iron[2]],
2674
+ ["Cu", self.copper[1], 12, self.copper[2]], ["As", self.arsenic[1], 0, self.arsenic[2]],
2675
+ ["Sb", self.antimony[1], 4, self.antimony[2]]], dtype=object)
2676
+ molar_mass_pure_td = 12*self.copper[2] + 4*self.antimony[2] + 13*self.sulfur[2]
2677
+ molar_mass_td, amounts_td = MineralChemistry(
2678
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_td, majors=majors_data_td).calculate_molar_mass()
2679
+ element_td = [PeriodicSystem(name=amounts_td[i][0]).get_data() for i in range(len(amounts_td))]
2680
+ # Density
2681
+ dataV_tn = CrystalPhysics([[10.186], [], "cubic"])
2682
+ V_tn = dataV_tn.calculate_volume()
2683
+ Z_tn = 2
2684
+ V_m_tn = MineralChemistry().calculate_molar_volume(volume_cell=V_tn, z=Z_tn)
2685
+ dataRho_tn = CrystalPhysics([molar_mass_tn, Z_tn, V_tn])
2686
+ rho_tn = dataRho_tn.calculate_bulk_density()
2687
+ rho_e_tn = wg(amounts=amounts_tn, elements=element_tn, rho_b=rho_tn).calculate_electron_density()
2688
+
2689
+ dataV_td = CrystalPhysics([[10.33], [], "cubic"])
2690
+ V_td = dataV_td.calculate_volume()
2691
+ Z_td = 2
2692
+ V_m_td = MineralChemistry().calculate_molar_volume(volume_cell=V_td, z=Z_td)
2693
+ dataRho_td = CrystalPhysics([molar_mass_td, Z_td, V_td])
2694
+ rho_td = dataRho_td.calculate_bulk_density()
2695
+ rho_e_td = wg(amounts=amounts_td, elements=element_td, rho_b=rho_td).calculate_electron_density()
2696
+
2697
+ V_m = y*V_m_tn + (1 - y)*V_m_td
2698
+ rho = y*rho_tn + (1 - y)*rho_td
2699
+ rho_e = y*rho_e_tn + (1 - y)*rho_e_td
2700
+ # Bulk modulus
2701
+ K_tn = 70.29*10**9
2702
+ K_td = 59*10**9
2703
+ K = y*K_tn + (1-y)*K_td
2704
+ # Shear modulus
2705
+ G_tn = 28.87*10**9
2706
+ G_td = 13*10**9
2707
+ G = y*G_tn + (1-y)*G_td
2708
+ # Young's modulus
2709
+ E = (9*K*G)/(3*K + G)
2710
+ # Poisson's ratio
2711
+ nu = (3*K - 2*G)/(2*(3*K + G))
2712
+ # vP/vS
2713
+ vPvS = ((K + 4/3*G)/G)**0.5
2714
+ # P-wave velocity
2715
+ vP = ((K + 4/3*G)/rho)**0.5
2716
+ # S-wave velocity
2717
+ vS = (G/rho)**0.5
2718
+ # Gamma ray
2719
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2720
+ # Photoelectricity
2721
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2722
+ U = pe*rho_e*10**(-3)
2723
+ # Electrical resistivity
2724
+ p = None
2725
+ # Results
2726
+ results = {}
2727
+ results["mineral"] = name
2728
+ results["state"] = var_state
2729
+ results["M"] = molar_mass
2730
+ element_list = np.array(amounts)[:, 0]
2731
+ results["chemistry"] = {}
2732
+ for index, element in enumerate(element_list, start=0):
2733
+ results["chemistry"][element] = amounts[index][2]
2734
+ results["rho"] = round(rho, 4)
2735
+ results["rho_e"] = round(rho_e, 4)
2736
+ results["V"] = round(V_m, 4)
2737
+ results["vP"] = round(vP, 4)
2738
+ results["vS"] = round(vS, 4)
2739
+ results["vP/vS"] = round(vPvS, 4)
2740
+ results["G"] = round(G*10**(-9), 4)
2741
+ results["K"] = round(K*10**(-9), 4)
2742
+ results["E"] = round(E*10**(-9), 4)
2743
+ results["nu"] = round(nu, 4)
2744
+ results["GR"] = round(gamma_ray, 4)
2745
+ results["PE"] = round(pe, 4)
2746
+ results["U"] = round(U, 4)
2747
+ if p != None:
2748
+ results["p"] = round(p, 4)
2749
+ else:
2750
+ results["p"] = p
2751
+
2752
+ return results
2753
+
2754
+ def create_covellite(self):
2755
+ #
2756
+ name = "Cv"
2757
+ #
2758
+ # Major elements
2759
+ sulfur = PeriodicSystem(name="S").get_data()
2760
+ copper = PeriodicSystem(name="Cu").get_data()
2761
+ majors_name = ["S", "Cu"]
2762
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Cu", copper[1], 1, copper[2]]], dtype=object)
2763
+ # Minor elements
2764
+ traces_data = []
2765
+ if len(self.traces_list) > 0:
2766
+ self.impurity = "impure"
2767
+ if self.impurity == "pure":
2768
+ var_state = "fixed"
2769
+ else:
2770
+ var_state = "variable"
2771
+ if self.impurity == "random":
2772
+ self.traces_list = []
2773
+ minors = ["Fe", "Se", "Ag", "Pb"]
2774
+ n = rd.randint(1, len(minors))
2775
+ while len(self.traces_list) < n:
2776
+ selection = rd.choice(minors)
2777
+ if selection not in self.traces_list and selection not in majors_name:
2778
+ self.traces_list.append(selection)
2779
+ else:
2780
+ continue
2781
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2782
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2783
+ for i in range(len(self.traces_list)):
2784
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2785
+ if len(traces_data) > 0:
2786
+ traces_data = np.array(traces_data, dtype=object)
2787
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2788
+ #
2789
+ # Molar mass
2790
+ molar_mass_pure = copper[2] + sulfur[2]
2791
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2792
+ majors=majors_data).calculate_molar_mass()
2793
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2794
+ # Density
2795
+ dataV = CrystalPhysics([[3.792, 16.344], [], "hexagonal"])
2796
+ V = dataV.calculate_volume()
2797
+ dataRho = CrystalPhysics([molar_mass_pure, 6, V*10**(6)])
2798
+ rho = dataRho.calculate_bulk_density()
2799
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2800
+ # Bulk modulus
2801
+ K = 74*10**9
2802
+ # Shear modulus
2803
+ G = 24*10**9
2804
+ # Young's modulus
2805
+ E = (9*K*G)/(3*K + G)
2806
+ # Poisson's ratio
2807
+ nu = (3*K - 2*G)/(2*(3*K + G))
2808
+ # vP/vS
2809
+ vPvS = ((K + 4/3*G)/G)**0.5
2810
+ # P-wave velocity
2811
+ vP = ((K + 4/3*G)/rho)**0.5
2812
+ # S-wave velocity
2813
+ vS = (G/rho)**0.5
2814
+ # Gamma ray
2815
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2816
+ # Photoelectricity
2817
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2818
+ U = pe*rho_e*10**(-3)
2819
+ # Electrical resistivity
2820
+ p = None
2821
+ # Thermodynamics
2822
+ thermodynamics = {}
2823
+ thermodynamics["Gibbs Energy"] = -48636 # J/mol
2824
+ thermodynamics["Enthalpy"] = -47982 # J/mol
2825
+ thermodynamics["Entropy"] = 67.400 # J/(mol K)
2826
+ thermodynamics["Heat Capacity"] = 47.54 # J/(mol K)
2827
+ #
2828
+ if self.data_type == False:
2829
+ data = []
2830
+ data.append(name)
2831
+ data.append(round(molar_mass, 3))
2832
+ data.append(round(rho, 2))
2833
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2834
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2835
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2836
+ data.append(amounts)
2837
+ #
2838
+ return data
2839
+ else:
2840
+ #
2841
+ results = {}
2842
+ results["mineral"] = name
2843
+ results["state"] = var_state
2844
+ results["M"] = molar_mass
2845
+ element_list = np.array(amounts)[:, 0]
2846
+ results["chemistry"] = {}
2847
+ for index, element in enumerate(element_list, start=0):
2848
+ results["chemistry"][element] = amounts[index][2]
2849
+ results["rho"] = round(rho, 4)
2850
+ results["rho_e"] = round(rho_e, 4)
2851
+ results["V"] = round(V, 4)
2852
+ results["vP"] = round(vP, 4)
2853
+ results["vS"] = round(vS, 4)
2854
+ results["vP/vS"] = round(vPvS, 4)
2855
+ results["G"] = round(G*10**(-9), 4)
2856
+ results["K"] = round(K*10**(-9), 4)
2857
+ results["E"] = round(E*10**(-9), 4)
2858
+ results["nu"] = round(nu, 4)
2859
+ results["GR"] = round(gamma_ray, 4)
2860
+ results["PE"] = round(pe, 4)
2861
+ results["U"] = round(U, 4)
2862
+ results["thermodynamics"] = thermodynamics
2863
+ if p != None:
2864
+ results["p"] = round(p, 4)
2865
+ else:
2866
+ results["p"] = p
2867
+ #
2868
+ return results
2869
+ #
2870
+ def create_millerite(self):
2871
+ #
2872
+ name = "Mlr"
2873
+ #
2874
+ # Major elements
2875
+ sulfur = PeriodicSystem(name="S").get_data()
2876
+ nickel = PeriodicSystem(name="Ni").get_data()
2877
+ majors_name = ["S", "Ni"]
2878
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["Ni", nickel[1], 1, nickel[2]]], dtype=object)
2879
+ # Minor elements
2880
+ traces_data = []
2881
+ if len(self.traces_list) > 0:
2882
+ self.impurity = "impure"
2883
+ if self.impurity == "pure":
2884
+ var_state = "fixed"
2885
+ else:
2886
+ var_state = "variable"
2887
+ if self.impurity == "random":
2888
+ self.traces_list = []
2889
+ minors = ["Fe", "Co", "Cu"]
2890
+ n = rd.randint(1, len(minors))
2891
+ while len(self.traces_list) < n:
2892
+ selection = rd.choice(minors)
2893
+ if selection not in self.traces_list and selection not in majors_name:
2894
+ self.traces_list.append(selection)
2895
+ else:
2896
+ continue
2897
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
2898
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
2899
+ for i in range(len(self.traces_list)):
2900
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
2901
+ if len(traces_data) > 0:
2902
+ traces_data = np.array(traces_data, dtype=object)
2903
+ traces_data = traces_data[traces_data[:, 1].argsort()]
2904
+ #
2905
+ # Molar mass
2906
+ molar_mass_pure = nickel[2] + sulfur[2]
2907
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
2908
+ majors=majors_data).calculate_molar_mass()
2909
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
2910
+ # Density
2911
+ dataV = CrystalPhysics([[9.62, 3.149], [], "trigonal"])
2912
+ V = dataV.calculate_volume()
2913
+ dataRho = CrystalPhysics([molar_mass, 9, V])
2914
+ rho = dataRho.calculate_bulk_density()
2915
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
2916
+ # Bulk modulus
2917
+ K = 129.85*10**9
2918
+ # Shear modulus
2919
+ G = 53.78*10**9
2920
+ # Young's modulus
2921
+ E = (9*K*G)/(3*K + G)
2922
+ # Poisson's ratio
2923
+ nu = (3*K - 2*G)/(2*(3*K + G))
2924
+ # vP/vS
2925
+ vPvS = ((K + 4/3*G)/G)**0.5
2926
+ # P-wave velocity
2927
+ vP = ((K + 4/3*G)/rho)**0.5
2928
+ # S-wave velocity
2929
+ vS = (G/rho)**0.5
2930
+ # Gamma ray
2931
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
2932
+ # Photoelectricity
2933
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
2934
+ U = pe*rho_e*10**(-3)
2935
+ # Electrical resistivity
2936
+ p = None
2937
+ #
2938
+ if self.data_type == False:
2939
+ data = []
2940
+ data.append(name)
2941
+ data.append(round(molar_mass, 3))
2942
+ data.append(round(rho, 2))
2943
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
2944
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
2945
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
2946
+ data.append(amounts)
2947
+ #
2948
+ return data
2949
+ else:
2950
+ #
2951
+ results = {}
2952
+ results["mineral"] = name
2953
+ results["M"] = molar_mass
2954
+ element_list = np.array(amounts)[:, 0]
2955
+ results["chemistry"] = {}
2956
+ for index, element in enumerate(element_list, start=0):
2957
+ results["chemistry"][element] = amounts[index][2]
2958
+ results["rho"] = round(rho, 4)
2959
+ results["rho_e"] = round(rho_e, 4)
2960
+ results["V"] = round(V, 4)
2961
+ results["vP"] = round(vP, 4)
2962
+ results["vS"] = round(vS, 4)
2963
+ results["vP/vS"] = round(vPvS, 4)
2964
+ results["G"] = round(G*10**(-9), 4)
2965
+ results["K"] = round(K*10**(-9), 4)
2966
+ results["E"] = round(E*10**(-9), 4)
2967
+ results["nu"] = round(nu, 4)
2968
+ results["GR"] = round(gamma_ray, 4)
2969
+ results["PE"] = round(pe, 4)
2970
+ results["U"] = round(U, 4)
2971
+ if p != None:
2972
+ results["p"] = round(p, 4)
2973
+ else:
2974
+ results["p"] = p
2975
+ #
2976
+ return results
2977
+ #
2978
+ def create_pentlandite(self):
2979
+ #
2980
+ name = "Pn"
2981
+ #
2982
+ # Major elements
2983
+ sulfur = PeriodicSystem(name="S").get_data()
2984
+ iron = PeriodicSystem(name="Fe").get_data()
2985
+ nickel = PeriodicSystem(name="Ni").get_data()
2986
+ majors_name = ["S", "Fe", "Ni"]
2987
+ x = round(rd.uniform(0.4, 0.6), 4)
2988
+ majors_data = np.array([["S", sulfur[1], 8, sulfur[2]], ["Fe", iron[1], x*9, iron[2]],
2989
+ ["Ni", nickel[1], (1-x)*9, nickel[2]]], dtype=object)
2990
+ # Minor elements
2991
+ traces_data = []
2992
+ if len(self.traces_list) > 0:
2993
+ self.impurity = "impure"
2994
+ if self.impurity == "pure":
2995
+ var_state = "fixed"
2996
+ else:
2997
+ var_state = "variable"
2998
+ if self.impurity == "random":
2999
+ self.traces_list = []
3000
+ minors = ["Co", "Ag", "Cu"]
3001
+ n = rd.randint(1, len(minors))
3002
+ while len(self.traces_list) < n:
3003
+ selection = rd.choice(minors)
3004
+ if selection not in self.traces_list and selection not in majors_name:
3005
+ self.traces_list.append(selection)
3006
+ else:
3007
+ continue
3008
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3009
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3010
+ for i in range(len(self.traces_list)):
3011
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3012
+ if len(traces_data) > 0:
3013
+ traces_data = np.array(traces_data, dtype=object)
3014
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3015
+ #
3016
+ # Molar mass
3017
+ molar_mass_pure = 9*(x*iron[2] + (1-x)*nickel[2]) + 8*sulfur[2]
3018
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3019
+ majors=majors_data).calculate_molar_mass()
3020
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3021
+ # Density
3022
+ dataV = CrystalPhysics([[10.04], [], "cubic"])
3023
+ V = dataV.calculate_volume()
3024
+ dataRho = CrystalPhysics([molar_mass, 4, V])
3025
+ rho = dataRho.calculate_bulk_density()
3026
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3027
+ # Bulk modulus
3028
+ K = 113.02*10**9
3029
+ # Shear modulus
3030
+ G = 48.54*10**9
3031
+ # Young's modulus
3032
+ E = (9*K*G)/(3*K + G)
3033
+ # Poisson's ratio
3034
+ nu = (3*K - 2*G)/(2*(3*K + G))
3035
+ # vP/vS
3036
+ vPvS = ((K + 4/3*G)/G)**0.5
3037
+ # P-wave velocity
3038
+ vP = ((K + 4/3*G)/rho)**0.5
3039
+ # S-wave velocity
3040
+ vS = (G/rho)**0.5
3041
+ # Gamma ray
3042
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3043
+ # Photoelectricity
3044
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3045
+ U = pe*rho_e*10**(-3)
3046
+ # Electrical resistivity
3047
+ p = None
3048
+ #
3049
+ if self.data_type == False:
3050
+ data = []
3051
+ data.append(name)
3052
+ data.append(round(molar_mass, 3))
3053
+ data.append(round(rho, 2))
3054
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3055
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3056
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3057
+ data.append(amounts)
3058
+ #
3059
+ return data
3060
+ else:
3061
+ #
3062
+ results = {}
3063
+ results["mineral"] = name
3064
+ results["M"] = molar_mass
3065
+ element_list = np.array(amounts)[:, 0]
3066
+ results["chemistry"] = {}
3067
+ for index, element in enumerate(element_list, start=0):
3068
+ results["chemistry"][element] = amounts[index][2]
3069
+ results["rho"] = round(rho, 4)
3070
+ results["rho_e"] = round(rho_e, 4)
3071
+ results["V"] = round(V, 4)
3072
+ results["vP"] = round(vP, 4)
3073
+ results["vS"] = round(vS, 4)
3074
+ results["vP/vS"] = round(vPvS, 4)
3075
+ results["G"] = round(G*10**(-9), 4)
3076
+ results["K"] = round(K*10**(-9), 4)
3077
+ results["E"] = round(E*10**(-9), 4)
3078
+ results["nu"] = round(nu, 4)
3079
+ results["GR"] = round(gamma_ray, 4)
3080
+ results["PE"] = round(pe, 4)
3081
+ results["U"] = round(U, 4)
3082
+ if p != None:
3083
+ results["p"] = round(p, 4)
3084
+ else:
3085
+ results["p"] = p
3086
+ #
3087
+ return results
3088
+ #
3089
+ def create_realgar(self):
3090
+ #
3091
+ name = "Rl"
3092
+ #
3093
+ # Major elements
3094
+ sulfur = PeriodicSystem(name="S").get_data()
3095
+ arsenic = PeriodicSystem(name="As").get_data()
3096
+ majors_name = ["S", "As"]
3097
+ majors_data = np.array([["S", sulfur[1], 1, sulfur[2]], ["As", arsenic[1], 1, arsenic[2]]], dtype=object)
3098
+ # Minor elements
3099
+ traces_data = []
3100
+ if len(self.traces_list) > 0:
3101
+ self.impurity = "impure"
3102
+ if self.impurity == "pure":
3103
+ var_state = "fixed"
3104
+ else:
3105
+ var_state = "variable"
3106
+ if self.impurity == "random":
3107
+ self.traces_list = []
3108
+ minors = [None]
3109
+ n = rd.randint(1, len(minors))
3110
+ while len(self.traces_list) < n:
3111
+ selection = rd.choice(minors)
3112
+ if selection not in self.traces_list and selection not in majors_name:
3113
+ self.traces_list.append(selection)
3114
+ else:
3115
+ continue
3116
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3117
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3118
+ for i in range(len(self.traces_list)):
3119
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3120
+ if len(traces_data) > 0:
3121
+ traces_data = np.array(traces_data, dtype=object)
3122
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3123
+ #
3124
+ # Molar mass
3125
+ molar_mass_pure = arsenic[2] + sulfur[2]
3126
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3127
+ majors=majors_data).calculate_molar_mass()
3128
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3129
+ # Density
3130
+ dataV = CrystalPhysics([[9.29, 13.53, 6.57], [106.883], "monoclinic"])
3131
+ V = dataV.calculate_volume()
3132
+ dataRho = CrystalPhysics([molar_mass, 16, V])
3133
+ rho = dataRho.calculate_bulk_density()
3134
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3135
+ # Bulk modulus
3136
+ K = 25.6*10**9
3137
+ # Shear modulus
3138
+ G = 13.64*10**9
3139
+ # Young's modulus
3140
+ E = (9*K*G)/(3*K + G)
3141
+ # Poisson's ratio
3142
+ nu = (3*K - 2*G)/(2*(3*K + G))
3143
+ # vP/vS
3144
+ vPvS = ((K + 4/3*G)/G)**0.5
3145
+ # P-wave velocity
3146
+ vP = ((K + 4/3*G)/rho)**0.5
3147
+ # S-wave velocity
3148
+ vS = (G/rho)**0.5
3149
+ # Gamma ray
3150
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3151
+ # Photoelectricity
3152
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3153
+ U = pe*rho_e*10**(-3)
3154
+ # Electrical resistivity
3155
+ p = None
3156
+ # Thermodynamics
3157
+ thermodynamics = {}
3158
+ thermodynamics["Gibbs Energy"] = -30519 # J/mol
3159
+ thermodynamics["Enthalpy"] = -32417 # J/mol
3160
+ thermodynamics["Entropy"] = 61.379 # J/(mol K)
3161
+ thermodynamics["Heat Capacity"] = 60.70 # J/(mol K)
3162
+ #
3163
+ if self.data_type == False:
3164
+ data = []
3165
+ data.append(name)
3166
+ data.append(round(molar_mass, 3))
3167
+ data.append(round(rho, 2))
3168
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3169
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3170
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3171
+ data.append(amounts)
3172
+ #
3173
+ return data
3174
+ else:
3175
+ #
3176
+ results = {}
3177
+ results["mineral"] = name
3178
+ results["M"] = molar_mass
3179
+ element_list = np.array(amounts)[:, 0]
3180
+ results["chemistry"] = {}
3181
+ for index, element in enumerate(element_list, start=0):
3182
+ results["chemistry"][element] = amounts[index][2]
3183
+ results["rho"] = round(rho, 4)
3184
+ results["rho_e"] = round(rho_e, 4)
3185
+ results["V"] = round(V, 4)
3186
+ results["vP"] = round(vP, 4)
3187
+ results["vS"] = round(vS, 4)
3188
+ results["vP/vS"] = round(vPvS, 4)
3189
+ results["G"] = round(G*10**(-9), 4)
3190
+ results["K"] = round(K*10**(-9), 4)
3191
+ results["E"] = round(E*10**(-9), 4)
3192
+ results["nu"] = round(nu, 4)
3193
+ results["GR"] = round(gamma_ray, 4)
3194
+ results["PE"] = round(pe, 4)
3195
+ results["U"] = round(U, 4)
3196
+ results["thermodynamics"] = thermodynamics
3197
+ if p != None:
3198
+ results["p"] = round(p, 4)
3199
+ else:
3200
+ results["p"] = p
3201
+ #
3202
+ return results
3203
+ #
3204
+ def create_orpiment(self):
3205
+ #
3206
+ name = "Orp"
3207
+ #
3208
+ # Major elements
3209
+ sulfur = PeriodicSystem(name="S").get_data()
3210
+ arsenic = PeriodicSystem(name="As").get_data()
3211
+ majors_name = ["S", "As"]
3212
+ majors_data = np.array([["S", sulfur[1], 3, sulfur[2]], ["As", arsenic[1], 2, arsenic[2]]], dtype=object)
3213
+ # Minor elements
3214
+ traces_data = []
3215
+ if len(self.traces_list) > 0:
3216
+ self.impurity = "impure"
3217
+ if self.impurity == "pure":
3218
+ var_state = "fixed"
3219
+ else:
3220
+ var_state = "variable"
3221
+ if self.impurity == "random":
3222
+ self.traces_list = []
3223
+ minors = ["Hg", "Ge", "Sb"]
3224
+ n = rd.randint(1, len(minors))
3225
+ while len(self.traces_list) < n:
3226
+ selection = rd.choice(minors)
3227
+ if selection not in self.traces_list and selection not in majors_name:
3228
+ self.traces_list.append(selection)
3229
+ else:
3230
+ continue
3231
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3232
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3233
+ for i in range(len(self.traces_list)):
3234
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3235
+ if len(traces_data) > 0:
3236
+ traces_data = np.array(traces_data, dtype=object)
3237
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3238
+ #
3239
+ # Molar mass
3240
+ molar_mass_pure = 2*arsenic[2] + 3*sulfur[2]
3241
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3242
+ majors=majors_data).calculate_molar_mass()
3243
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3244
+ # Density
3245
+ dataV = CrystalPhysics([[11.49, 9.59, 4.25], [90.45], "monoclinic"])
3246
+ V = dataV.calculate_volume()
3247
+ dataRho = CrystalPhysics([molar_mass, 4, V])
3248
+ rho = dataRho.calculate_bulk_density()
3249
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3250
+ # Bulk modulus
3251
+ K = 27.89*10**9
3252
+ # Shear modulus
3253
+ G = 14.22*10**9
3254
+ # Young's modulus
3255
+ E = (9*K*G)/(3*K + G)
3256
+ # Poisson's ratio
3257
+ nu = (3*K - 2*G)/(2*(3*K + G))
3258
+ # vP/vS
3259
+ vPvS = ((K + 4/3*G)/G)**0.5
3260
+ # P-wave velocity
3261
+ vP = ((K + 4/3*G)/rho)**0.5
3262
+ # S-wave velocity
3263
+ vS = (G/rho)**0.5
3264
+ # Gamma ray
3265
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3266
+ # Photoelectricity
3267
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3268
+ U = pe*rho_e*10**(-3)
3269
+ # Electrical resistivity
3270
+ p = None
3271
+ # Thermodynamics
3272
+ thermodynamics = {}
3273
+ thermodynamics["Gibbs Energy"] = -85981 # J/mol
3274
+ thermodynamics["Enthalpy"] = -87158 # J/mol
3275
+ thermodynamics["Entropy"] = 163.594 # J/(mol K)
3276
+ thermodynamics["Heat Capacity"] = 115.19 # J/(mol K)
3277
+ #
3278
+ if self.data_type == False:
3279
+ data = []
3280
+ data.append(name)
3281
+ data.append(round(molar_mass, 3))
3282
+ data.append(round(rho, 2))
3283
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3284
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3285
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3286
+ data.append(amounts)
3287
+ #
3288
+ return data
3289
+ else:
3290
+ #
3291
+ results = {}
3292
+ results["mineral"] = name
3293
+ results["M"] = molar_mass
3294
+ element_list = np.array(amounts)[:, 0]
3295
+ results["chemistry"] = {}
3296
+ for index, element in enumerate(element_list, start=0):
3297
+ results["chemistry"][element] = amounts[index][2]
3298
+ results["rho"] = round(rho, 4)
3299
+ results["rho_e"] = round(rho_e, 4)
3300
+ results["V"] = round(V, 4)
3301
+ results["vP"] = round(vP, 4)
3302
+ results["vS"] = round(vS, 4)
3303
+ results["vP/vS"] = round(vPvS, 4)
3304
+ results["G"] = round(G*10**(-9), 4)
3305
+ results["K"] = round(K*10**(-9), 4)
3306
+ results["E"] = round(E*10**(-9), 4)
3307
+ results["nu"] = round(nu, 4)
3308
+ results["GR"] = round(gamma_ray, 4)
3309
+ results["PE"] = round(pe, 4)
3310
+ results["U"] = round(U, 4)
3311
+ results["thermodynamics"] = thermodynamics
3312
+ if p != None:
3313
+ results["p"] = round(p, 4)
3314
+ else:
3315
+ results["p"] = p
3316
+ #
3317
+ return results
3318
+ #
3319
+ def create_marcasite(self):
3320
+ #
3321
+ name = "Mr"
3322
+ #
3323
+ # Major elements
3324
+ sulfur = PeriodicSystem(name="S").get_data()
3325
+ iron = PeriodicSystem(name="Fe").get_data()
3326
+ majors_name = ["S", "Fe"]
3327
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 1, iron[2]]], dtype=object)
3328
+ # Minor elements
3329
+ traces_data = []
3330
+ if len(self.traces_list) > 0:
3331
+ self.impurity = "impure"
3332
+ if self.impurity == "pure":
3333
+ var_state = "fixed"
3334
+ else:
3335
+ var_state = "variable"
3336
+ if self.impurity == "random":
3337
+ self.traces_list = []
3338
+ minors = ["Cu", "As"]
3339
+ n = rd.randint(1, len(minors))
3340
+ while len(self.traces_list) < n:
3341
+ selection = rd.choice(minors)
3342
+ if selection not in self.traces_list and selection not in majors_name:
3343
+ self.traces_list.append(selection)
3344
+ else:
3345
+ continue
3346
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3347
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3348
+ for i in range(len(self.traces_list)):
3349
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3350
+ if len(traces_data) > 0:
3351
+ traces_data = np.array(traces_data, dtype=object)
3352
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3353
+ #
3354
+ # Molar mass
3355
+ molar_mass_pure = iron[2] + 2*sulfur[2]
3356
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3357
+ majors=majors_data).calculate_molar_mass()
3358
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3359
+ # Density
3360
+ dataV = CrystalPhysics([[4.445, 5.425, 3.388], [], "orthorhombic"])
3361
+ V = dataV.calculate_volume()
3362
+ dataRho = CrystalPhysics([molar_mass, 2, V])
3363
+ rho = dataRho.calculate_bulk_density()
3364
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3365
+ # Bulk modulus
3366
+ K = 150*10**9
3367
+ # Shear modulus
3368
+ G = 125*10**9
3369
+ # Young's modulus
3370
+ E = (9*K*G)/(3*K + G)
3371
+ # Poisson's ratio
3372
+ nu = (3*K - 2*G)/(2*(3*K + G))
3373
+ # vP/vS
3374
+ vPvS = ((K + 4/3*G)/G)**0.5
3375
+ # P-wave velocity
3376
+ vP = ((K + 4/3*G)/rho)**0.5
3377
+ # S-wave velocity
3378
+ vS = (G/rho)**0.5
3379
+ # Gamma ray
3380
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3381
+ # Photoelectricity
3382
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3383
+ U = pe*rho_e*10**(-3)
3384
+ # Electrical resistivity
3385
+ p = None
3386
+ # Thermodynamics
3387
+ thermodynamics = {}
3388
+ thermodynamics["Gibbs Energy"] = -155411 # J/mol
3389
+ thermodynamics["Enthalpy"] = -166600 # J/mol
3390
+ thermodynamics["Entropy"] = 53.900 # J/(mol K)
3391
+ thermodynamics["Heat Capacity"] = 62.43 # J/(mol K)
3392
+ #
3393
+ if self.data_type == False:
3394
+ data = []
3395
+ data.append(name)
3396
+ data.append(round(molar_mass, 3))
3397
+ data.append(round(rho, 2))
3398
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3399
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3400
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3401
+ data.append(amounts)
3402
+ #
3403
+ return data
3404
+ else:
3405
+ #
3406
+ results = {}
3407
+ results["mineral"] = name
3408
+ results["M"] = molar_mass
3409
+ element_list = np.array(amounts)[:, 0]
3410
+ results["chemistry"] = {}
3411
+ for index, element in enumerate(element_list, start=0):
3412
+ results["chemistry"][element] = amounts[index][2]
3413
+ results["rho"] = round(rho, 4)
3414
+ results["rho_e"] = round(rho_e, 4)
3415
+ results["V"] = round(V, 4)
3416
+ results["vP"] = round(vP, 4)
3417
+ results["vS"] = round(vS, 4)
3418
+ results["vP/vS"] = round(vPvS, 4)
3419
+ results["G"] = round(G*10**(-9), 4)
3420
+ results["K"] = round(K*10**(-9), 4)
3421
+ results["E"] = round(E*10**(-9), 4)
3422
+ results["nu"] = round(nu, 4)
3423
+ results["GR"] = round(gamma_ray, 4)
3424
+ results["PE"] = round(pe, 4)
3425
+ results["U"] = round(U, 4)
3426
+ results["thermodynamics"] = thermodynamics
3427
+ if p != None:
3428
+ results["p"] = round(p, 4)
3429
+ else:
3430
+ results["p"] = p
3431
+ #
3432
+ return results
3433
+ #
3434
+ def create_chalcopyrite_group(self):
3435
+ #
3436
+ name = "Ccp"
3437
+ #
3438
+ # Major elements
3439
+ sulfur = PeriodicSystem(name="S").get_data()
3440
+ iron = PeriodicSystem(name="Fe").get_data()
3441
+ copper = PeriodicSystem(name="Cu").get_data()
3442
+ gallium = PeriodicSystem(name="Ga").get_data()
3443
+ silver = PeriodicSystem(name="Ag").get_data()
3444
+ indium = PeriodicSystem(name="In").get_data()
3445
+ #
3446
+ majors_name = ["S", "Fe", "Cu", "Ga", "Ag", "In"]
3447
+ #
3448
+ a = rd.uniform(0.0, 1.0)
3449
+ a1 = round(a, 4)
3450
+ a2 = round(1 - a, 4)
3451
+ b = rd.uniform(0.0, 1.0)
3452
+ c = rd.uniform(0.0, 1.0-b)
3453
+ b1 = round(b, 4)
3454
+ b2 = round(c, 4)
3455
+ b3 = round(1 - b1 - b2, 4)
3456
+ c = rd.uniform(0.0, 1.0)
3457
+ c1 = round(c, 4)
3458
+ c2 = round(1 - c, 4)
3459
+ #
3460
+ majors_data = np.array(
3461
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], b1, iron[2]], ["Cu", copper[1], a1, copper[2]],
3462
+ ["Ga", gallium[1], b3, gallium[2]], ["Ag", silver[1], a2, silver[2]],
3463
+ ["In", indium[1], b2, indium[2]]], dtype=object)
3464
+ majors_data = np.array(
3465
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], a1*b1 + a2*c1, iron[2]], ["Cu", copper[1], a1, copper[2]],
3466
+ ["Ga", gallium[1], b3, gallium[2]], ["Ag", silver[1], a2, silver[2]],
3467
+ ["In", indium[1], a1*b2 + a2*c2, indium[2]]], dtype=object)
3468
+ majors_data_Ccp = np.array(
3469
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 1, iron[2]], ["Cu", copper[1], 1, copper[2]],
3470
+ ["Ga", gallium[1], 0, gallium[2]], ["Ag", silver[1], 0, silver[2]],
3471
+ ["In", indium[1], 0, indium[2]]], dtype=object)
3472
+ majors_data_Rqt = np.array(
3473
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 0, iron[2]], ["Cu", copper[1], 1, copper[2]],
3474
+ ["Ga", gallium[1], 0, gallium[2]], ["Ag", silver[1], 0, silver[2]],
3475
+ ["In", indium[1], 1, indium[2]]], dtype=object)
3476
+ majors_data_Glt = np.array(
3477
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 0, iron[2]], ["Cu", copper[1], 1, copper[2]],
3478
+ ["Ga", gallium[1], 1, gallium[2]], ["Ag", silver[1], 0, silver[2]],
3479
+ ["In", indium[1], 0, indium[2]]], dtype=object)
3480
+ majors_data_Lnt = np.array(
3481
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 1, iron[2]], ["Cu", copper[1], 0, copper[2]],
3482
+ ["Ga", gallium[1], 0, gallium[2]], ["Ag", silver[1], 1, silver[2]],
3483
+ ["In", indium[1], 0, indium[2]]], dtype=object)
3484
+ majors_data_Lft = np.array(
3485
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 0, iron[2]], ["Cu", copper[1], 0, copper[2]],
3486
+ ["Ga", gallium[1], 0, gallium[2]], ["Ag", silver[1], 1, silver[2]],
3487
+ ["In", indium[1], 1, indium[2]]], dtype=object)
3488
+ #
3489
+ # Minor elements
3490
+ traces_data = []
3491
+ if len(self.traces_list) > 0:
3492
+ self.impurity = "impure"
3493
+ if self.impurity == "pure":
3494
+ var_state = "fixed"
3495
+ else:
3496
+ var_state = "variable"
3497
+ if self.impurity == "random":
3498
+ self.traces_list = []
3499
+ minors = ["Ni"]
3500
+ n = rd.randint(1, len(minors))
3501
+ while len(self.traces_list) < n:
3502
+ selection = rd.choice(minors)
3503
+ if selection not in self.traces_list and selection not in majors_name:
3504
+ self.traces_list.append(selection)
3505
+ else:
3506
+ continue
3507
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3508
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3509
+ for i in range(len(self.traces_list)):
3510
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3511
+ if len(traces_data) > 0:
3512
+ traces_data = np.array(traces_data, dtype=object)
3513
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3514
+ #
3515
+ # Molar mass
3516
+ molar_mass_pure = a1*copper[2] + a2*silver[2] + (b1 + c1)*iron[2] + (b2 + c2)*indium[2] + b3*gallium[2] + 2*sulfur[2]
3517
+ molar_mass, amounts = MineralChemistry(
3518
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure, majors=majors_data).calculate_molar_mass()
3519
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3520
+ #
3521
+ molar_mass_pure_Ccp = copper[2] + iron[2] + 2*sulfur[2]
3522
+ molar_mass_Ccp, amounts_Ccp = MineralChemistry(
3523
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_Ccp, majors=majors_data_Ccp).calculate_molar_mass()
3524
+ element_Ccp = [PeriodicSystem(name=amounts_Ccp[i][0]).get_data() for i in range(len(amounts_Ccp))]
3525
+ #
3526
+ molar_mass_pure_Rqt = copper[2] + indium[2] + 2*sulfur[2]
3527
+ molar_mass_Rqt, amounts_Rqt = MineralChemistry(
3528
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_Rqt, majors=majors_data_Rqt).calculate_molar_mass()
3529
+ element_Rqt = [PeriodicSystem(name=amounts_Rqt[i][0]).get_data() for i in range(len(amounts_Rqt))]
3530
+ #
3531
+ molar_mass_pure_Glt = copper[2] + gallium[2] + 2*sulfur[2]
3532
+ molar_mass_Glt, amounts_Glt = MineralChemistry(
3533
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_Glt, majors=majors_data_Glt).calculate_molar_mass()
3534
+ element_Glt = [PeriodicSystem(name=amounts_Glt[i][0]).get_data() for i in range(len(amounts_Glt))]
3535
+ #
3536
+ molar_mass_pure_Lnt = silver[2] + iron[2] + 2*sulfur[2]
3537
+ molar_mass_Lnt, amounts_Lnt = MineralChemistry(
3538
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_Lnt, majors=majors_data_Lnt).calculate_molar_mass()
3539
+ element_Lnt = [PeriodicSystem(name=amounts_Lnt[i][0]).get_data() for i in range(len(amounts_Lnt))]
3540
+ #
3541
+ molar_mass_pure_Lft = silver[2] + indium[2] + 2*sulfur[2]
3542
+ molar_mass_Lft, amounts_Lft = MineralChemistry(
3543
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure_Lft, majors=majors_data_Lft).calculate_molar_mass()
3544
+ element_Lft = [PeriodicSystem(name=amounts_Lft[i][0]).get_data() for i in range(len(amounts_Lft))]
3545
+ #
3546
+ # Density
3547
+ dataV_Ccp = CrystalPhysics([[5.28, 10.41], [], "tetragonal"])
3548
+ V_Ccp = dataV_Ccp.calculate_volume()
3549
+ dataRho_Ccp = CrystalPhysics([molar_mass_Ccp, 4, V_Ccp])
3550
+ rho_Ccp = dataRho_Ccp.calculate_bulk_density()
3551
+ rho_e_Ccp = wg(amounts=amounts_Ccp, elements=element_Ccp, rho_b=rho_Ccp).calculate_electron_density()
3552
+ #
3553
+ dataV_Glt = CrystalPhysics([[5.35, 10.48], [], "tetragonal"])
3554
+ V_Glt = dataV_Glt.calculate_volume()
3555
+ dataRho_Glt = CrystalPhysics([molar_mass_Glt, 4, V_Glt])
3556
+ rho_Glt = dataRho_Glt.calculate_bulk_density()
3557
+ rho_e_Glt = wg(amounts=amounts_Glt, elements=element_Glt, rho_b=rho_Glt).calculate_electron_density()
3558
+ #
3559
+ dataV_Rqt = CrystalPhysics([[5.51, 11.05], [], "tetragonal"])
3560
+ V_Rqt = dataV_Rqt.calculate_volume()
3561
+ dataRho_Rqt = CrystalPhysics([molar_mass_Rqt, 4, V_Rqt])
3562
+ rho_Rqt = dataRho_Rqt.calculate_bulk_density()
3563
+ rho_e_Rqt = wg(amounts=amounts_Rqt, elements=element_Rqt, rho_b=rho_Rqt).calculate_electron_density()
3564
+ #
3565
+ dataV_Lft = CrystalPhysics([[5.88, 11.21], [], "tetragonal"])
3566
+ V_Lft = dataV_Lft.calculate_volume()
3567
+ dataRho_Lft = CrystalPhysics([molar_mass_Lft, 4, V_Lft])
3568
+ rho_Lft = dataRho_Lft.calculate_bulk_density()
3569
+ rho_e_Lft = wg(amounts=amounts_Lft, elements=element_Lft, rho_b=rho_Lft).calculate_electron_density()
3570
+ #
3571
+ dataV_Lnt = CrystalPhysics([[5.4371, 10.8479], [], "tetragonal"])
3572
+ V_Lnt = dataV_Lnt.calculate_volume()
3573
+ dataRho_Lnt = CrystalPhysics([molar_mass_Lnt, 4, V_Lnt])
3574
+ rho_Lnt = dataRho_Lnt.calculate_bulk_density()
3575
+ rho_e_Lnt = wg(amounts=amounts_Lnt, elements=element_Lnt, rho_b=rho_Lnt).calculate_electron_density()
3576
+ #
3577
+ V = (a*b)*V_Ccp + ((1-a)*b)*V_Lnt + (a*c)*V_Rqt + (a*(1-b-c))*V_Glt + ((1-a)*c)*V_Lft
3578
+ rho = a1*(b1*rho_Ccp + b2*rho_Rqt + b3*rho_Glt) + a2*(c1*rho_Lnt + c2*rho_Lft)
3579
+ rho_e = (a*b)*rho_e_Ccp + ((1-a)*b)*rho_e_Lnt + (a*c)*rho_e_Rqt + (a*(1-b-c))*rho_e_Glt + ((1-a)*c)*rho_e_Lft
3580
+ #
3581
+ # Bulk modulus
3582
+ K_Ccp = 56*10**9
3583
+ K_Lnt = 58*10**9
3584
+ K_Rqt = 64*10**9
3585
+ K_Glt = 75*10**9
3586
+ K_Lft = 52*10**9
3587
+ K = a1*(b1*K_Ccp + b2*K_Rqt + b3*K_Glt) + a2*(c1*K_Lnt + c2*K_Lft)
3588
+ # Shear modulus
3589
+ G_Ccp = 19*10**9
3590
+ G_Lnt = 15*10**9
3591
+ G_Rqt = 25*10**9
3592
+ G_Glt = 36*10**9
3593
+ G_Lft = 16*10**9
3594
+ G = a1*(b1*G_Ccp + b2*G_Rqt + b3*G_Glt) + a2*(c1*G_Lnt + c2*G_Lft)
3595
+ # Young's modulus
3596
+ E = (9*K*G)/(3*K + G)
3597
+ # Poisson's ratio
3598
+ nu = (3*K - 2*G)/(2*(3*K + G))
3599
+ # vP/vS
3600
+ vPvS = ((K + 4/3*G)/G)**0.5
3601
+ # P-wave velocity
3602
+ vP = ((K + 4/3*G)/rho)**0.5
3603
+ # S-wave velocity
3604
+ vS = (G/rho)**0.5
3605
+ # Gamma ray
3606
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3607
+ # Photoelectricity
3608
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3609
+ U = pe*rho_e*10**(-3)
3610
+ # Electrical resistivity
3611
+ p = None
3612
+ # Thermodynamics
3613
+ thermodynamics = {}
3614
+ thermodynamics["Gibbs Energy"] = None # J/mol
3615
+ thermodynamics["Enthalpy"] = None # J/mol
3616
+ thermodynamics["Entropy"] = None # J/(mol K)
3617
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
3618
+ #
3619
+ if self.data_type == False:
3620
+ data = []
3621
+ data.append(name)
3622
+ data.append(round(molar_mass, 3))
3623
+ data.append(round(rho, 2))
3624
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3625
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3626
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3627
+ data.append(amounts)
3628
+ #
3629
+ return data
3630
+ else:
3631
+ #
3632
+ results = {}
3633
+ results["mineral"] = name
3634
+ results["M"] = molar_mass
3635
+ element_list = np.array(amounts)[:, 0]
3636
+ results["chemistry"] = {}
3637
+ for index, element in enumerate(element_list, start=0):
3638
+ results["chemistry"][element] = amounts[index][2]
3639
+ results["rho"] = round(rho, 4)
3640
+ results["rho_e"] = round(rho_e, 4)
3641
+ results["V"] = round(V, 4)
3642
+ results["vP"] = round(vP, 4)
3643
+ results["vS"] = round(vS, 4)
3644
+ results["vP/vS"] = round(vPvS, 4)
3645
+ results["G"] = round(G*10**(-9), 4)
3646
+ results["K"] = round(K*10**(-9), 4)
3647
+ results["E"] = round(E*10**(-9), 4)
3648
+ results["nu"] = round(nu, 4)
3649
+ results["GR"] = round(gamma_ray, 4)
3650
+ results["PE"] = round(pe, 4)
3651
+ results["U"] = round(U, 4)
3652
+ results["thermodynamics"] = thermodynamics
3653
+ if p != None:
3654
+ results["p"] = round(p, 4)
3655
+ else:
3656
+ results["p"] = p
3657
+ #
3658
+ return results
3659
+ #
3660
+ def create_gallite(self):
3661
+ #
3662
+ name = "Glt"
3663
+ #
3664
+ # Major elements
3665
+ sulfur = PeriodicSystem(name="S").get_data()
3666
+ copper = PeriodicSystem(name="Cu").get_data()
3667
+ gallium = PeriodicSystem(name="Ga").get_data()
3668
+ majors_name = ["S", "Cu", "Ga"]
3669
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Cu", copper[1], 1, copper[2]],
3670
+ ["Ga", gallium[1], 1, gallium[2]]], dtype=object)
3671
+ # Minor elements
3672
+ traces_data = []
3673
+ if len(self.traces_list) > 0:
3674
+ self.impurity = "impure"
3675
+ if self.impurity == "pure":
3676
+ var_state = "fixed"
3677
+ else:
3678
+ var_state = "variable"
3679
+ if self.impurity == "random":
3680
+ self.traces_list = []
3681
+ minors = ["Pb", "Zn", "Fe", "Ge"]
3682
+ n = rd.randint(1, len(minors))
3683
+ while len(self.traces_list) < n:
3684
+ selection = rd.choice(minors)
3685
+ if selection not in self.traces_list and selection not in majors_name:
3686
+ self.traces_list.append(selection)
3687
+ else:
3688
+ continue
3689
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3690
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3691
+ for i in range(len(self.traces_list)):
3692
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3693
+ if len(traces_data) > 0:
3694
+ traces_data = np.array(traces_data, dtype=object)
3695
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3696
+ #
3697
+ # Molar mass
3698
+ molar_mass_pure = copper[2] + gallium[2] + 2*sulfur[2]
3699
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3700
+ majors=majors_data).calculate_molar_mass()
3701
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3702
+ # Density
3703
+ dataV = CrystalPhysics([[5.35, 10.48], [], "tetragonal"])
3704
+ V = dataV.calculate_volume()
3705
+ dataRho = CrystalPhysics([molar_mass, 4, V])
3706
+ rho = dataRho.calculate_bulk_density()
3707
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3708
+ # Bulk modulus
3709
+ K = 75*10**9
3710
+ # Shear modulus
3711
+ G = 36*10**9
3712
+ # Young's modulus
3713
+ E = (9*K*G)/(3*K + G)
3714
+ # Poisson's ratio
3715
+ nu = (3*K - 2*G)/(2*(3*K + G))
3716
+ # vP/vS
3717
+ vPvS = ((K + 4/3*G)/G)**0.5
3718
+ # P-wave velocity
3719
+ vP = ((K + 4/3*G)/rho)**0.5
3720
+ # S-wave velocity
3721
+ vS = (G/rho)**0.5
3722
+ # Gamma ray
3723
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3724
+ # Photoelectricity
3725
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3726
+ U = pe*rho_e*10**(-3)
3727
+ # Electrical resistivity
3728
+ p = None
3729
+ # Thermodynamics
3730
+ thermodynamics = {}
3731
+ thermodynamics["Gibbs Energy"] = None # J/mol
3732
+ thermodynamics["Enthalpy"] = None # J/mol
3733
+ thermodynamics["Entropy"] = None # J/(mol K)
3734
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
3735
+ #
3736
+ if self.data_type == False:
3737
+ data = []
3738
+ data.append(name)
3739
+ data.append(round(molar_mass, 3))
3740
+ data.append(round(rho, 2))
3741
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3742
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3743
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3744
+ data.append(amounts)
3745
+ #
3746
+ return data
3747
+ else:
3748
+ #
3749
+ results = {}
3750
+ results["mineral"] = name
3751
+ results["M"] = molar_mass
3752
+ element_list = np.array(amounts)[:, 0]
3753
+ results["chemistry"] = {}
3754
+ for index, element in enumerate(element_list, start=0):
3755
+ results["chemistry"][element] = amounts[index][2]
3756
+ results["rho"] = round(rho, 4)
3757
+ results["rho_e"] = round(rho_e, 4)
3758
+ results["V"] = round(V, 4)
3759
+ results["vP"] = round(vP, 4)
3760
+ results["vS"] = round(vS, 4)
3761
+ results["vP/vS"] = round(vPvS, 4)
3762
+ results["G"] = round(G*10**(-9), 4)
3763
+ results["K"] = round(K*10**(-9), 4)
3764
+ results["E"] = round(E*10**(-9), 4)
3765
+ results["nu"] = round(nu, 4)
3766
+ results["GR"] = round(gamma_ray, 4)
3767
+ results["PE"] = round(pe, 4)
3768
+ results["U"] = round(U, 4)
3769
+ results["thermodynamics"] = thermodynamics
3770
+ if p != None:
3771
+ results["p"] = round(p, 4)
3772
+ else:
3773
+ results["p"] = p
3774
+ #
3775
+ return results
3776
+ #
3777
+ def create_roquesite(self):
3778
+ #
3779
+ name = "Rqt"
3780
+ #
3781
+ # Major elements
3782
+ sulfur = PeriodicSystem(name="S").get_data()
3783
+ copper = PeriodicSystem(name="Cu").get_data()
3784
+ indium = PeriodicSystem(name="In").get_data()
3785
+ majors_name = ["S", "Cu", "In"]
3786
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Cu", copper[1], 1, copper[2]],
3787
+ ["In", indium[1], 1, indium[2]]], dtype=object)
3788
+ # Minor elements
3789
+ traces_data = []
3790
+ if len(self.traces_list) > 0:
3791
+ self.impurity = "impure"
3792
+ if self.impurity == "pure":
3793
+ var_state = "fixed"
3794
+ else:
3795
+ var_state = "variable"
3796
+ if self.impurity == "random":
3797
+ self.traces_list = []
3798
+ minors = ["Fe"]
3799
+ n = rd.randint(1, len(minors))
3800
+ while len(self.traces_list) < n:
3801
+ selection = rd.choice(minors)
3802
+ if selection not in self.traces_list and selection not in majors_name:
3803
+ self.traces_list.append(selection)
3804
+ else:
3805
+ continue
3806
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3807
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3808
+ for i in range(len(self.traces_list)):
3809
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3810
+ if len(traces_data) > 0:
3811
+ traces_data = np.array(traces_data, dtype=object)
3812
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3813
+ #
3814
+ # Molar mass
3815
+ molar_mass_pure = copper[2] + indium[2] + 2*sulfur[2]
3816
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3817
+ majors=majors_data).calculate_molar_mass()
3818
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3819
+ # Density
3820
+ dataV = CrystalPhysics([[5.51, 11.05], [], "tetragonal"])
3821
+ V = dataV.calculate_volume()
3822
+ dataRho = CrystalPhysics([molar_mass, 4, V])
3823
+ rho = dataRho.calculate_bulk_density()
3824
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3825
+ # Bulk modulus
3826
+ K = 64*10**9
3827
+ # Shear modulus
3828
+ G = 25*10**9
3829
+ # Young's modulus
3830
+ E = (9*K*G)/(3*K + G)
3831
+ # Poisson's ratio
3832
+ nu = (3*K - 2*G)/(2*(3*K + G))
3833
+ # vP/vS
3834
+ vPvS = ((K + 4/3*G)/G)**0.5
3835
+ # P-wave velocity
3836
+ vP = ((K + 4/3*G)/rho)**0.5
3837
+ # S-wave velocity
3838
+ vS = (G/rho)**0.5
3839
+ # Gamma ray
3840
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3841
+ # Photoelectricity
3842
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3843
+ U = pe*rho_e*10**(-3)
3844
+ # Electrical resistivity
3845
+ p = None
3846
+ # Thermodynamics
3847
+ thermodynamics = {}
3848
+ thermodynamics["Gibbs Energy"] = None # J/mol
3849
+ thermodynamics["Enthalpy"] = None # J/mol
3850
+ thermodynamics["Entropy"] = None # J/(mol K)
3851
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
3852
+ #
3853
+ if self.data_type == False:
3854
+ data = []
3855
+ data.append(name)
3856
+ data.append(round(molar_mass, 3))
3857
+ data.append(round(rho, 2))
3858
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3859
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3860
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3861
+ data.append(amounts)
3862
+ #
3863
+ return data
3864
+ else:
3865
+ #
3866
+ results = {}
3867
+ results["mineral"] = name
3868
+ results["M"] = molar_mass
3869
+ element_list = np.array(amounts)[:, 0]
3870
+ results["chemistry"] = {}
3871
+ for index, element in enumerate(element_list, start=0):
3872
+ results["chemistry"][element] = amounts[index][2]
3873
+ results["rho"] = round(rho, 4)
3874
+ results["rho_e"] = round(rho_e, 4)
3875
+ results["V"] = round(V, 4)
3876
+ results["vP"] = round(vP, 4)
3877
+ results["vS"] = round(vS, 4)
3878
+ results["vP/vS"] = round(vPvS, 4)
3879
+ results["G"] = round(G*10**(-9), 4)
3880
+ results["K"] = round(K*10**(-9), 4)
3881
+ results["E"] = round(E*10**(-9), 4)
3882
+ results["nu"] = round(nu, 4)
3883
+ results["GR"] = round(gamma_ray, 4)
3884
+ results["PE"] = round(pe, 4)
3885
+ results["U"] = round(U, 4)
3886
+ results["thermodynamics"] = thermodynamics
3887
+ if p != None:
3888
+ results["p"] = round(p, 4)
3889
+ else:
3890
+ results["p"] = p
3891
+ #
3892
+ return results
3893
+ #
3894
+ def create_lenaite(self):
3895
+ #
3896
+ name = "Lnt"
3897
+ #
3898
+ # Major elements
3899
+ sulfur = PeriodicSystem(name="S").get_data()
3900
+ iron = PeriodicSystem(name="Fe").get_data()
3901
+ silver = PeriodicSystem(name="Ag").get_data()
3902
+ majors_name = ["S", "Fe", "Ag"]
3903
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], 1, iron[2]],
3904
+ ["Ag", silver[1], 1, silver[2]]], dtype=object)
3905
+ # Minor elements
3906
+ traces_data = []
3907
+ if len(self.traces_list) > 0:
3908
+ self.impurity = "impure"
3909
+ if self.impurity == "pure":
3910
+ var_state = "fixed"
3911
+ else:
3912
+ var_state = "variable"
3913
+ if self.impurity == "random":
3914
+ self.traces_list = []
3915
+ minors = [None]
3916
+ n = rd.randint(1, len(minors))
3917
+ while len(self.traces_list) < n:
3918
+ selection = rd.choice(minors)
3919
+ if selection not in self.traces_list and selection not in majors_name:
3920
+ self.traces_list.append(selection)
3921
+ else:
3922
+ continue
3923
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
3924
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
3925
+ for i in range(len(self.traces_list)):
3926
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
3927
+ if len(traces_data) > 0:
3928
+ traces_data = np.array(traces_data, dtype=object)
3929
+ traces_data = traces_data[traces_data[:, 1].argsort()]
3930
+ #
3931
+ # Molar mass
3932
+ molar_mass_pure = silver[2] + iron[2] + 2*sulfur[2]
3933
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
3934
+ majors=majors_data).calculate_molar_mass()
3935
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
3936
+ # Density
3937
+ dataV = CrystalPhysics([[5.4371, 10.8479], [], "tetragonal"])
3938
+ V = dataV.calculate_volume()
3939
+ dataRho = CrystalPhysics([molar_mass, 4, V])
3940
+ rho = dataRho.calculate_bulk_density()
3941
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
3942
+ # Bulk modulus
3943
+ K = 58*10**9
3944
+ # Shear modulus
3945
+ G = 15*10**9
3946
+ # Young's modulus
3947
+ E = (9*K*G)/(3*K + G)
3948
+ # Poisson's ratio
3949
+ nu = (3*K - 2*G)/(2*(3*K + G))
3950
+ # vP/vS
3951
+ vPvS = ((K + 4/3*G)/G)**0.5
3952
+ # P-wave velocity
3953
+ vP = ((K + 4/3*G)/rho)**0.5
3954
+ # S-wave velocity
3955
+ vS = (G/rho)**0.5
3956
+ # Gamma ray
3957
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
3958
+ # Photoelectricity
3959
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
3960
+ U = pe*rho_e*10**(-3)
3961
+ # Electrical resistivity
3962
+ p = None
3963
+ # Thermodynamics
3964
+ thermodynamics = {}
3965
+ thermodynamics["Gibbs Energy"] = None # J/mol
3966
+ thermodynamics["Enthalpy"] = None # J/mol
3967
+ thermodynamics["Entropy"] = None # J/(mol K)
3968
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
3969
+ #
3970
+ if self.data_type == False:
3971
+ data = []
3972
+ data.append(name)
3973
+ data.append(round(molar_mass, 3))
3974
+ data.append(round(rho, 2))
3975
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
3976
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
3977
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
3978
+ data.append(amounts)
3979
+ #
3980
+ return data
3981
+ else:
3982
+ #
3983
+ results = {}
3984
+ results["mineral"] = name
3985
+ results["M"] = molar_mass
3986
+ element_list = np.array(amounts)[:, 0]
3987
+ results["chemistry"] = {}
3988
+ for index, element in enumerate(element_list, start=0):
3989
+ results["chemistry"][element] = amounts[index][2]
3990
+ results["rho"] = round(rho, 4)
3991
+ results["rho_e"] = round(rho_e, 4)
3992
+ results["V"] = round(V, 4)
3993
+ results["vP"] = round(vP, 4)
3994
+ results["vS"] = round(vS, 4)
3995
+ results["vP/vS"] = round(vPvS, 4)
3996
+ results["G"] = round(G*10**(-9), 4)
3997
+ results["K"] = round(K*10**(-9), 4)
3998
+ results["E"] = round(E*10**(-9), 4)
3999
+ results["nu"] = round(nu, 4)
4000
+ results["GR"] = round(gamma_ray, 4)
4001
+ results["PE"] = round(pe, 4)
4002
+ results["U"] = round(U, 4)
4003
+ results["thermodynamics"] = thermodynamics
4004
+ if p != None:
4005
+ results["p"] = round(p, 4)
4006
+ else:
4007
+ results["p"] = p
4008
+ #
4009
+ return results
4010
+ #
4011
+ def create_laforetite(self):
4012
+ #
4013
+ name = "Lft"
4014
+ #
4015
+ # Major elements
4016
+ sulfur = PeriodicSystem(name="S").get_data()
4017
+ silver = PeriodicSystem(name="Ag").get_data()
4018
+ indium = PeriodicSystem(name="In").get_data()
4019
+ majors_name = ["S", "Ag", "In"]
4020
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Ag", silver[1], 1, silver[2]],
4021
+ ["In", indium[1], 1, indium[2]]], dtype=object)
4022
+ # Minor elements
4023
+ traces_data = []
4024
+ if len(self.traces_list) > 0:
4025
+ self.impurity = "impure"
4026
+ if self.impurity == "pure":
4027
+ var_state = "fixed"
4028
+ else:
4029
+ var_state = "variable"
4030
+ if self.impurity == "random":
4031
+ self.traces_list = []
4032
+ minors = ["Cu", "Fe", "Se"]
4033
+ n = rd.randint(1, len(minors))
4034
+ while len(self.traces_list) < n:
4035
+ selection = rd.choice(minors)
4036
+ if selection not in self.traces_list and selection not in majors_name:
4037
+ self.traces_list.append(selection)
4038
+ else:
4039
+ continue
4040
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
4041
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
4042
+ for i in range(len(self.traces_list)):
4043
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
4044
+ if len(traces_data) > 0:
4045
+ traces_data = np.array(traces_data, dtype=object)
4046
+ traces_data = traces_data[traces_data[:, 1].argsort()]
4047
+ #
4048
+ # Molar mass
4049
+ molar_mass_pure = silver[2] + indium[2] + 2*sulfur[2]
4050
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
4051
+ majors=majors_data).calculate_molar_mass()
4052
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
4053
+ # Density
4054
+ dataV = CrystalPhysics([[5.88, 11.21], [], "tetragonal"])
4055
+ V = dataV.calculate_volume()
4056
+ dataRho = CrystalPhysics([molar_mass, 4, V])
4057
+ rho = dataRho.calculate_bulk_density()
4058
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
4059
+ # Bulk modulus
4060
+ K = 52*10**9
4061
+ # Shear modulus
4062
+ G = 16*10**9
4063
+ # Young's modulus
4064
+ E = (9*K*G)/(3*K + G)
4065
+ # Poisson's ratio
4066
+ nu = (3*K - 2*G)/(2*(3*K + G))
4067
+ # vP/vS
4068
+ vPvS = ((K + 4/3*G)/G)**0.5
4069
+ # P-wave velocity
4070
+ vP = ((K + 4/3*G)/rho)**0.5
4071
+ # S-wave velocity
4072
+ vS = (G/rho)**0.5
4073
+ # Gamma ray
4074
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
4075
+ # Photoelectricity
4076
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
4077
+ U = pe*rho_e*10**(-3)
4078
+ # Electrical resistivity
4079
+ p = None
4080
+ # Thermodynamics
4081
+ thermodynamics = {}
4082
+ thermodynamics["Gibbs Energy"] = None # J/mol
4083
+ thermodynamics["Enthalpy"] = None # J/mol
4084
+ thermodynamics["Entropy"] = None # J/(mol K)
4085
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
4086
+ #
4087
+ if self.data_type == False:
4088
+ data = []
4089
+ data.append(name)
4090
+ data.append(round(molar_mass, 3))
4091
+ data.append(round(rho, 2))
4092
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
4093
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
4094
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
4095
+ data.append(amounts)
4096
+ #
4097
+ return data
4098
+ else:
4099
+ #
4100
+ results = {}
4101
+ results["mineral"] = name
4102
+ results["M"] = molar_mass
4103
+ element_list = np.array(amounts)[:, 0]
4104
+ results["chemistry"] = {}
4105
+ for index, element in enumerate(element_list, start=0):
4106
+ results["chemistry"][element] = amounts[index][2]
4107
+ results["rho"] = round(rho, 4)
4108
+ results["rho_e"] = round(rho_e, 4)
4109
+ results["V"] = round(V, 4)
4110
+ results["vP"] = round(vP, 4)
4111
+ results["vS"] = round(vS, 4)
4112
+ results["vP/vS"] = round(vPvS, 4)
4113
+ results["G"] = round(G*10**(-9), 4)
4114
+ results["K"] = round(K*10**(-9), 4)
4115
+ results["E"] = round(E*10**(-9), 4)
4116
+ results["nu"] = round(nu, 4)
4117
+ results["GR"] = round(gamma_ray, 4)
4118
+ results["PE"] = round(pe, 4)
4119
+ results["U"] = round(U, 4)
4120
+ results["thermodynamics"] = thermodynamics
4121
+ if p != None:
4122
+ results["p"] = round(p, 4)
4123
+ else:
4124
+ results["p"] = p
4125
+ #
4126
+ return results
4127
+ #
4128
+ def create_vaesite(self): # Ni S2
4129
+ #
4130
+ name = "Vst"
4131
+ #
4132
+ # Major elements
4133
+ sulfur = PeriodicSystem(name="S").get_data()
4134
+ nickel = PeriodicSystem(name="Ni").get_data()
4135
+ majors_name = ["S", "Ni"]
4136
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Ni", nickel[1], 1, nickel[2]]], dtype=object)
4137
+ # Minor elements
4138
+ traces_data = []
4139
+ if len(self.traces_list) > 0:
4140
+ self.impurity = "impure"
4141
+ if self.impurity == "pure":
4142
+ var_state = "fixed"
4143
+ else:
4144
+ var_state = "variable"
4145
+ if self.impurity == "random":
4146
+ self.traces_list = []
4147
+ minors = ["Co", "Fe"]
4148
+ n = rd.randint(1, len(minors))
4149
+ while len(self.traces_list) < n:
4150
+ selection = rd.choice(minors)
4151
+ if selection not in self.traces_list and selection not in majors_name:
4152
+ self.traces_list.append(selection)
4153
+ else:
4154
+ continue
4155
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
4156
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
4157
+ for i in range(len(self.traces_list)):
4158
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
4159
+ if len(traces_data) > 0:
4160
+ traces_data = np.array(traces_data, dtype=object)
4161
+ traces_data = traces_data[traces_data[:, 1].argsort()]
4162
+ #
4163
+ # Molar mass
4164
+ molar_mass_pure = nickel[2] + 2*sulfur[2]
4165
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
4166
+ majors=majors_data).calculate_molar_mass()
4167
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
4168
+ # Density
4169
+ dataV = CrystalPhysics([[5.6793], [], "cubic"])
4170
+ V = dataV.calculate_volume()
4171
+ dataRho = CrystalPhysics([molar_mass, 4, V])
4172
+ rho = dataRho.calculate_bulk_density()
4173
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
4174
+ # Bulk modulus
4175
+ K = 101.63*10**9
4176
+ # Shear modulus
4177
+ G = 42.05*10**9
4178
+ # Young's modulus
4179
+ E = (9*K*G)/(3*K + G)
4180
+ # Poisson's ratio
4181
+ nu = (3*K - 2*G)/(2*(3*K + G))
4182
+ # vP/vS
4183
+ vPvS = ((K + 4/3*G)/G)**0.5
4184
+ # P-wave velocity
4185
+ vP = ((K + 4/3*G)/rho)**0.5
4186
+ # S-wave velocity
4187
+ vS = (G/rho)**0.5
4188
+ # Gamma ray
4189
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
4190
+ # Photoelectricity
4191
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
4192
+ U = pe*rho_e*10**(-3)
4193
+ # Electrical resistivity
4194
+ p = None
4195
+ # Thermodynamics
4196
+ thermodynamics = {}
4197
+ thermodynamics["Gibbs Energy"] = None # J/mol
4198
+ thermodynamics["Enthalpy"] = None # J/mol
4199
+ thermodynamics["Entropy"] = None # J/(mol K)
4200
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
4201
+ #
4202
+ # Output
4203
+ results = {}
4204
+ results["mineral"] = name
4205
+ results["M"] = molar_mass
4206
+ element_list = np.array(amounts)[:, 0]
4207
+ results["chemistry"] = {}
4208
+ for index, element in enumerate(element_list, start=0):
4209
+ results["chemistry"][element] = amounts[index][2]
4210
+ results["rho"] = round(rho, 4)
4211
+ results["rho_e"] = round(rho_e, 4)
4212
+ results["V"] = round(V, 4)
4213
+ results["vP"] = round(vP, 4)
4214
+ results["vS"] = round(vS, 4)
4215
+ results["vP/vS"] = round(vPvS, 4)
4216
+ results["G"] = round(G*10**(-9), 4)
4217
+ results["K"] = round(K*10**(-9), 4)
4218
+ results["E"] = round(E*10**(-9), 4)
4219
+ results["nu"] = round(nu, 4)
4220
+ results["GR"] = round(gamma_ray, 4)
4221
+ results["PE"] = round(pe, 4)
4222
+ results["U"] = round(U, 4)
4223
+ results["thermodynamics"] = thermodynamics
4224
+ if p != None:
4225
+ results["p"] = round(p, 4)
4226
+ else:
4227
+ results["p"] = p
4228
+ #
4229
+ return results
4230
+ #
4231
+ def create_cattierite(self): # Co S2
4232
+ #
4233
+ name = "Cat"
4234
+ #
4235
+ # Major elements
4236
+ sulfur = PeriodicSystem(name="S").get_data()
4237
+ cobalt = PeriodicSystem(name="Co").get_data()
4238
+ majors_name = ["S", "Co"]
4239
+ majors_data = np.array([["S", sulfur[1], 2, sulfur[2]], ["Co", cobalt[1], 1, cobalt[2]]], dtype=object)
4240
+ # Minor elements
4241
+ traces_data = []
4242
+ if len(self.traces_list) > 0:
4243
+ self.impurity = "impure"
4244
+ if self.impurity == "pure":
4245
+ var_state = "fixed"
4246
+ else:
4247
+ var_state = "variable"
4248
+ if self.impurity == "random":
4249
+ self.traces_list = []
4250
+ minors = ["Fe", "Ni"]
4251
+ n = rd.randint(1, len(minors))
4252
+ while len(self.traces_list) < n:
4253
+ selection = rd.choice(minors)
4254
+ if selection not in self.traces_list and selection not in majors_name:
4255
+ self.traces_list.append(selection)
4256
+ else:
4257
+ continue
4258
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
4259
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
4260
+ for i in range(len(self.traces_list)):
4261
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
4262
+ if len(traces_data) > 0:
4263
+ traces_data = np.array(traces_data, dtype=object)
4264
+ traces_data = traces_data[traces_data[:, 1].argsort()]
4265
+ #
4266
+ # Molar mass
4267
+ molar_mass_pure = cobalt[2] + 2*sulfur[2]
4268
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
4269
+ majors=majors_data).calculate_molar_mass()
4270
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
4271
+ # Density
4272
+ dataV = CrystalPhysics([[5.535], [], "cubic"])
4273
+ V = dataV.calculate_volume()
4274
+ dataRho = CrystalPhysics([molar_mass, 4, V])
4275
+ rho = dataRho.calculate_bulk_density()
4276
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
4277
+ # Bulk modulus
4278
+ K = 124*10**9
4279
+ # Shear modulus
4280
+ G = 73*10**9
4281
+ # Young's modulus
4282
+ E = (9*K*G)/(3*K + G)
4283
+ # Poisson's ratio
4284
+ nu = (3*K - 2*G)/(2*(3*K + G))
4285
+ # vP/vS
4286
+ vPvS = ((K + 4/3*G)/G)**0.5
4287
+ # P-wave velocity
4288
+ vP = ((K + 4/3*G)/rho)**0.5
4289
+ # S-wave velocity
4290
+ vS = (G/rho)**0.5
4291
+ # Gamma ray
4292
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
4293
+ # Photoelectricity
4294
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
4295
+ U = pe*rho_e*10**(-3)
4296
+ # Electrical resistivity
4297
+ p = None
4298
+ # Thermodynamics
4299
+ thermodynamics = {}
4300
+ thermodynamics["Gibbs Energy"] = None # J/mol
4301
+ thermodynamics["Enthalpy"] = None # J/mol
4302
+ thermodynamics["Entropy"] = None # J/(mol K)
4303
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
4304
+ #
4305
+ # Output
4306
+ results = {}
4307
+ results["mineral"] = name
4308
+ results["M"] = molar_mass
4309
+ element_list = np.array(amounts)[:, 0]
4310
+ results["chemistry"] = {}
4311
+ for index, element in enumerate(element_list, start=0):
4312
+ results["chemistry"][element] = amounts[index][2]
4313
+ results["rho"] = round(rho, 4)
4314
+ results["rho_e"] = round(rho_e, 4)
4315
+ results["V"] = round(V, 4)
4316
+ results["vP"] = round(vP, 4)
4317
+ results["vS"] = round(vS, 4)
4318
+ results["vP/vS"] = round(vPvS, 4)
4319
+ results["G"] = round(G*10**(-9), 4)
4320
+ results["K"] = round(K*10**(-9), 4)
4321
+ results["E"] = round(E*10**(-9), 4)
4322
+ results["nu"] = round(nu, 4)
4323
+ results["GR"] = round(gamma_ray, 4)
4324
+ results["PE"] = round(pe, 4)
4325
+ results["U"] = round(U, 4)
4326
+ results["thermodynamics"] = thermodynamics
4327
+ if p != None:
4328
+ results["p"] = round(p, 4)
4329
+ else:
4330
+ results["p"] = p
4331
+ #
4332
+ return results
4333
+ #
4334
+ def create_pyrite_group(self): # (Fe,Ni,Co) S2
4335
+ #
4336
+ name = "Py"
4337
+ #
4338
+ # Major elements
4339
+ sulfur = PeriodicSystem(name="S").get_data()
4340
+ iron = PeriodicSystem(name="Fe").get_data()
4341
+ cobalt = PeriodicSystem(name="Co").get_data()
4342
+ nickel = PeriodicSystem(name="Ni").get_data()
4343
+ majors_name = ["S", "Co"]
4344
+ #
4345
+ a = rd.uniform(0.5, 1.0)
4346
+ b = rd.uniform(0.0, (1 - a))
4347
+ c = 1 - a - b
4348
+ #
4349
+ majors_data = np.array(
4350
+ [["S", sulfur[1], 2, sulfur[2]], ["Fe", iron[1], a, iron[2]], ["Co", cobalt[1], c, cobalt[2]],
4351
+ ["Ni", nickel[1], b, nickel[2]]], dtype=object)
4352
+ # Minor elements
4353
+ traces_data = []
4354
+ if len(self.traces_list) > 0:
4355
+ self.impurity = "impure"
4356
+ if self.impurity == "pure":
4357
+ var_state = "fixed"
4358
+ else:
4359
+ var_state = "variable"
4360
+ if self.impurity == "random":
4361
+ self.traces_list = []
4362
+ minors = ["Fe", "Ni", "Co"]
4363
+ n = rd.randint(1, len(minors))
4364
+ while len(self.traces_list) < n:
4365
+ selection = rd.choice(minors)
4366
+ if selection not in self.traces_list and selection not in majors_name:
4367
+ self.traces_list.append(selection)
4368
+ else:
4369
+ continue
4370
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
4371
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
4372
+ for i in range(len(self.traces_list)):
4373
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
4374
+ if len(traces_data) > 0:
4375
+ traces_data = np.array(traces_data, dtype=object)
4376
+ traces_data = traces_data[traces_data[:, 1].argsort()]
4377
+ #
4378
+ # Molar mass
4379
+ molar_mass_pure = a*iron[2] + b*nickel[2] + c*cobalt[2] + 2*sulfur[2]
4380
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
4381
+ majors=majors_data).calculate_molar_mass()
4382
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
4383
+ # Density
4384
+ dataV_Fe = CrystalPhysics([[5.417], [], "cubic"])
4385
+ V_Fe = dataV_Fe.calculate_volume()
4386
+ dataRho_Fe = CrystalPhysics([molar_mass, 4, V_Fe])
4387
+ rho_Fe = dataRho_Fe.calculate_bulk_density()
4388
+ rho_e_Fe = wg(amounts=amounts, elements=element, rho_b=rho_Fe).calculate_electron_density()
4389
+ #
4390
+ dataV_Ni = CrystalPhysics([[5.535], [], "cubic"])
4391
+ V_Ni = dataV_Ni.calculate_volume()
4392
+ dataRho_Ni = CrystalPhysics([molar_mass, 4, V_Ni])
4393
+ rho_Ni = dataRho_Ni.calculate_bulk_density()
4394
+ rho_e_Ni = wg(amounts=amounts, elements=element, rho_b=rho_Ni).calculate_electron_density()
4395
+ #
4396
+ dataV_Co = CrystalPhysics([[5.535], [], "cubic"])
4397
+ V_Co = dataV_Co.calculate_volume()
4398
+ dataRho_Co = CrystalPhysics([molar_mass, 4, V_Co])
4399
+ rho_Co = dataRho_Co.calculate_bulk_density()
4400
+ rho_e_Co = wg(amounts=amounts, elements=element, rho_b=rho_Co).calculate_electron_density()
4401
+ #
4402
+ V = a*V_Fe + b*V_Ni + c*V_Co
4403
+ rho = a*rho_Fe + b*rho_Ni + c*rho_Co
4404
+ rho_e = a*rho_e_Fe + b*rho_e_Ni + c*rho_e_Co
4405
+ #
4406
+ # Bulk modulus
4407
+ K_Fe = 146*10**9
4408
+ K_Ni = 124*10**9
4409
+ K_Co = 124*10**9
4410
+ K = a*K_Fe + b*K_Ni + c*K_Co
4411
+ # Shear modulus
4412
+ G_Fe = 135*10**9
4413
+ G_Ni = 73*10**9
4414
+ G_Co = 73*10**9
4415
+ G = a*G_Fe + b*G_Ni + c*G_Co
4416
+ # Young's modulus
4417
+ E = (9*K*G)/(3*K + G)
4418
+ # Poisson's ratio
4419
+ nu = (3*K - 2*G)/(2*(3*K + G))
4420
+ # vP/vS
4421
+ vPvS = ((K + 4/3*G)/G)**0.5
4422
+ # P-wave velocity
4423
+ vP = ((K + 4/3*G)/rho)**0.5
4424
+ # S-wave velocity
4425
+ vS = (G/rho)**0.5
4426
+ # Gamma ray
4427
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
4428
+ # Photoelectricity
4429
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
4430
+ U = pe*rho_e*10**(-3)
4431
+ # Electrical resistivity
4432
+ p = None
4433
+ # Thermodynamics
4434
+ thermodynamics = {}
4435
+ thermodynamics["Gibbs Energy"] = None # J/mol
4436
+ thermodynamics["Enthalpy"] = None # J/mol
4437
+ thermodynamics["Entropy"] = None # J/(mol K)
4438
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
4439
+ #
4440
+ # Output
4441
+ results = {}
4442
+ results["mineral"] = name
4443
+ results["M"] = molar_mass
4444
+ element_list = np.array(amounts)[:, 0]
4445
+ results["chemistry"] = {}
4446
+ for index, element in enumerate(element_list, start=0):
4447
+ results["chemistry"][element] = amounts[index][2]
4448
+ results["rho"] = round(rho, 4)
4449
+ results["rho_e"] = round(rho_e, 4)
4450
+ results["V"] = round(V, 4)
4451
+ results["vP"] = round(vP, 4)
4452
+ results["vS"] = round(vS, 4)
4453
+ results["vP/vS"] = round(vPvS, 4)
4454
+ results["G"] = round(G*10**(-9), 4)
4455
+ results["K"] = round(K*10**(-9), 4)
4456
+ results["E"] = round(E*10**(-9), 4)
4457
+ results["nu"] = round(nu, 4)
4458
+ results["GR"] = round(gamma_ray, 4)
4459
+ results["PE"] = round(pe, 4)
4460
+ results["U"] = round(U, 4)
4461
+ results["thermodynamics"] = thermodynamics
4462
+ if p != None:
4463
+ results["p"] = round(p, 4)
4464
+ else:
4465
+ results["p"] = p
4466
+ #
4467
+ return results
4468
+ #
4469
+ def create_cobaltite(self): # Co As S
4470
+ ## General Information
4471
+ name = "Cbt"
4472
+ elements_list = ["S", "Co", "As"]
4473
+ #
4474
+ sulfur = PeriodicSystem(name="S").get_data()
4475
+ cobalt = PeriodicSystem(name="Co").get_data()
4476
+ arsenic = PeriodicSystem(name="As").get_data()
4477
+ #
4478
+ molar_mass_ideal = cobalt[2] + arsenic[2] + sulfur[2]
4479
+ amounts_elements = {
4480
+ "S": round(sulfur[2]/molar_mass_ideal, 6),
4481
+ "Co": round(cobalt[2]/molar_mass_ideal, 6),
4482
+ "As": round(arsenic[2]/molar_mass_ideal, 6)}
4483
+ #
4484
+ ## Trace elements
4485
+ composition_sulfide = {}
4486
+ for element in elements_list:
4487
+ composition_sulfide[element] = int(amounts_elements[element]*10**6)
4488
+ #
4489
+ element_traces = {
4490
+ "3+": ["Sb", "Fe"],
4491
+ "2+": ["Cu", "Pb", "Ni"],
4492
+ "All": ["Cu", "Pb", "Sb", "Fe", "Ni"]}
4493
+ #
4494
+ if len(self.traces_list) > 0:
4495
+ self.impurity = "impure"
4496
+ var_state = "variable"
4497
+ #
4498
+ for trace_element, value in self.traces_list.items():
4499
+ if trace_element in ["Sb", "Fe"]:
4500
+ elements_list.append(trace_element)
4501
+ #
4502
+ val_min = self.traces_list[trace_element]["Min"]
4503
+ val_max = self.traces_list[trace_element]["Max"]
4504
+ mean = (val_min + val_max)/2
4505
+ sigma = (mean - val_min)/3
4506
+ #
4507
+ condition = False
4508
+ while condition == False:
4509
+ amount_ppm = int(np.random.normal(loc=mean, scale=sigma, size=1)[0])
4510
+ if amount_ppm >= 0 and val_min <= amount_ppm <= val_max:
4511
+ condition = True
4512
+ #
4513
+ composition_sulfide[trace_element] = amount_ppm
4514
+ composition_sulfide["As"] -= amount_ppm
4515
+ #
4516
+ elif trace_element in ["Cu", "Pb", "Ni"]:
4517
+ elements_list.append(trace_element)
4518
+ #
4519
+ val_min = self.traces_list[trace_element]["Min"]
4520
+ val_max = self.traces_list[trace_element]["Max"]
4521
+ mean = (val_min + val_max)/2
4522
+ sigma = (mean - val_min)/3
4523
+ #
4524
+ condition = False
4525
+ while condition == False:
4526
+ amount_ppm = int(np.random.normal(loc=mean, scale=sigma, size=1)[0])
4527
+ if amount_ppm >= 0 and val_min <= amount_ppm <= val_max:
4528
+ condition = True
4529
+ #
4530
+ composition_sulfide[trace_element] = amount_ppm
4531
+ composition_sulfide["Co"] -= amount_ppm
4532
+ #
4533
+ else:
4534
+ self.impurity == "pure"
4535
+ var_state = "fixed"
4536
+ #
4537
+ compositon_data = TraceElements(
4538
+ tracer=self.traces_list).calculate_composition_sulfides(
4539
+ var_elements=elements_list, var_composition=composition_sulfide, var_mineral="Cobaltite")
4540
+ #
4541
+ ## Molar mass
4542
+ molar_mass_pure = molar_mass_ideal
4543
+ molar_mass = 0
4544
+ amounts = []
4545
+ #
4546
+ for element in compositon_data:
4547
+ chem_data = PeriodicSystem(name=element).get_data()
4548
+ molar_mass += compositon_data[element]["x"] * chem_data[2]
4549
+ amounts.append([chem_data[0], chem_data[1], compositon_data[element]["w"]])
4550
+ #
4551
+ magic_factor = molar_mass / molar_mass_pure
4552
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
4553
+ #
4554
+ ## Density
4555
+ dataV = CrystalPhysics([[5.57, 5.582, 5.582], [], "orthorhombic"])
4556
+ V = dataV.calculate_volume()
4557
+ Z = 4
4558
+ V_m = MineralChemistry().calculate_molar_volume(volume_cell=V, z=Z)*magic_factor
4559
+ dataRho = CrystalPhysics([molar_mass, Z, V])
4560
+ rho = dataRho.calculate_bulk_density()*magic_factor
4561
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
4562
+ #
4563
+ ## Bulk modulus
4564
+ K = 139*10**9*magic_factor
4565
+ ## Shear modulus
4566
+ G = 104*10**9*magic_factor
4567
+ ## Young's modulus
4568
+ E = (9*K*G)/(3*K + G)
4569
+ ## Poisson's ratio
4570
+ nu = (3*K - 2*G)/(2*(3*K + G))
4571
+ ## vP/vS
4572
+ vPvS = ((K + 4/3*G)/G)**0.5
4573
+ ## P-wave velocity
4574
+ vP = ((K + 4/3*G)/rho)**0.5
4575
+ ## S-wave velocity
4576
+ vS = (G/rho)**0.5
4577
+ ## Gamma ray
4578
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
4579
+ ## Photoelectricity
4580
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
4581
+ U = pe*rho_e*10**(-3)
4582
+ ## Electrical resistivity
4583
+ p = None
4584
+ #
4585
+ ## Data Export
4586
+ results = {}
4587
+ results["mineral"] = name
4588
+ results["state"] = var_state
4589
+ results["M"] = molar_mass
4590
+ element_list = np.array(amounts)[:, 0]
4591
+ results["chemistry"] = {}
4592
+ for index, element in enumerate(element_list, start=0):
4593
+ results["chemistry"][element] = amounts[index][2]
4594
+ results["rho"] = round(rho, 4)
4595
+ results["rho_e"] = round(rho_e, 4)
4596
+ results["V"] = round(V_m, 4)
4597
+ results["vP"] = round(vP, 4)
4598
+ results["vS"] = round(vS, 4)
4599
+ results["vP/vS"] = round(vPvS, 4)
4600
+ results["G"] = round(G * 10 ** (-9), 4)
4601
+ results["K"] = round(K * 10 ** (-9), 4)
4602
+ results["E"] = round(E * 10 ** (-9), 4)
4603
+ results["nu"] = round(nu, 4)
4604
+ results["GR"] = round(gamma_ray, 4)
4605
+ results["PE"] = round(pe, 4)
4606
+ results["U"] = round(U, 4)
4607
+ results["trace elements"] = element_traces
4608
+ if p != None:
4609
+ results["p"] = round(p, 4)
4610
+ else:
4611
+ results["p"] = p
4612
+ #
4613
+ return results
4614
+ #
4615
+ def create_marmatite(self): # (Zn,Fe) S
4616
+ ## General Information
4617
+ name = "Sp"
4618
+ elements_list = ["S", "Fe", "Zn"]
4619
+ #
4620
+ sulfur = PeriodicSystem(name="S").get_data()
4621
+ iron = PeriodicSystem(name="Fe").get_data()
4622
+ zinc = PeriodicSystem(name="Zn").get_data()
4623
+ #
4624
+ majors_data_fe = np.array(
4625
+ [["S", sulfur[1], 1, sulfur[2]], ["Fe", iron[1], 1, iron[2]], ["Zn", zinc[1], 0, zinc[2]]], dtype=object)
4626
+ majors_data_zn = np.array(
4627
+ [["S", sulfur[1], 1, sulfur[2]], ["Fe", iron[1], 0, iron[2]], ["Zn", zinc[1], 1, zinc[2]]], dtype=object)
4628
+ #
4629
+ x = round(rd.uniform(0.95, 1.0), 4)
4630
+ #
4631
+ molar_mass_x = x*zinc[2] + (1 - x)*iron[2] + sulfur[2]
4632
+ amounts_elements = {
4633
+ "S": round(sulfur[2]/molar_mass_x, 6),
4634
+ "Fe": round((1 - x)*iron[2]/molar_mass_x, 6),
4635
+ "Zn": round(x*zinc[2]/molar_mass_x, 6)}
4636
+ #
4637
+ ## Trace elements
4638
+ composition_sulfide = {}
4639
+ for element in elements_list:
4640
+ composition_sulfide[element] = int(amounts_elements[element]*10**6)
4641
+ #
4642
+ element_traces = {
4643
+ "4+": ["Ge"],
4644
+ "3+": ["In", "Ga", "Sb"],
4645
+ "2+": ["Mn", "Cd", "Hg", "Sn", "Pb", "Co"],
4646
+ "1+": ["Tl", "Ag"],
4647
+ "All": ["Mn", "Cd", "Hg", "In", "Tl", "Ga", "Ge", "Sb", "Sn", "Pb", "Ag", "Co"]}
4648
+ #
4649
+ if len(self.traces_list) > 0:
4650
+ var_state = "variable"
4651
+ #
4652
+ for trace_element, value in self.traces_list.items():
4653
+ if trace_element in ["Mn", "Cd", "Hg", "In", "Tl", "Ga", "Ge", "Sb", "Sn", "Pb", "Ag", "Co"]:
4654
+ elements_list.append(trace_element)
4655
+ #
4656
+ val_min = self.traces_list[trace_element]["Min"]
4657
+ val_max = self.traces_list[trace_element]["Max"]
4658
+ mean = (val_min + val_max)/2
4659
+ sigma = (mean - val_min)/3
4660
+ #
4661
+ condition = False
4662
+ while condition == False:
4663
+ amount_ppm = int(np.random.normal(loc=mean, scale=sigma, size=1)[0])
4664
+ if amount_ppm >= 0 and val_min <= amount_ppm <= val_max:
4665
+ condition = True
4666
+ #
4667
+ if composition_sulfide["Zn"] >= composition_sulfide["Fe"]:
4668
+ composition_sulfide[trace_element] = amount_ppm
4669
+ composition_sulfide["Zn"] -= amount_ppm
4670
+ else:
4671
+ composition_sulfide[trace_element] = amount_ppm
4672
+ composition_sulfide["Fe"] -= amount_ppm
4673
+ #
4674
+ else:
4675
+ var_state = "fixed"
4676
+ #
4677
+ compositon_data = TraceElements(
4678
+ tracer=self.traces_list).calculate_composition_sulfides(
4679
+ var_elements=elements_list, var_composition=composition_sulfide, var_mineral="Marmatite", var_x=x)
4680
+ #
4681
+ ## Molar mass
4682
+ molar_mass_pure = molar_mass_x
4683
+ molar_mass = 0
4684
+ amounts = []
4685
+ #
4686
+ for element in compositon_data:
4687
+ chem_data = PeriodicSystem(name=element).get_data()
4688
+ molar_mass += compositon_data[element]["x"] * chem_data[2]
4689
+ amounts.append([chem_data[0], chem_data[1], compositon_data[element]["w"]])
4690
+ #
4691
+ magic_factor = molar_mass/molar_mass_pure
4692
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
4693
+ #
4694
+ molar_mass_pure_fe = iron[2] + sulfur[2]
4695
+ molar_mass_fe, amounts_fe = MineralChemistry(
4696
+ w_traces=[], molar_mass_pure=molar_mass_pure_fe, majors=majors_data_fe).calculate_molar_mass()
4697
+ element_fe = [PeriodicSystem(name=amounts_fe[i][0]).get_data() for i in range(len(amounts_fe))]
4698
+ #
4699
+ molar_mass_pure_zn = zinc[2] + sulfur[2]
4700
+ molar_mass_zn, amounts_zn = MineralChemistry(
4701
+ w_traces=[], molar_mass_pure=molar_mass_pure_zn, majors=majors_data_zn).calculate_molar_mass()
4702
+ element_zn = [PeriodicSystem(name=amounts_zn[i][0]).get_data() for i in range(len(amounts_zn))]
4703
+ #
4704
+ # Density
4705
+ dataV_Fe = CrystalPhysics([[3.60, 5.45], [], "tetragonal"])
4706
+ V_Fe = dataV_Fe.calculate_volume()
4707
+ Z_Fe = 4
4708
+ V_m_Fe = MineralChemistry().calculate_molar_volume(volume_cell=V_Fe, z=Z_Fe)
4709
+ dataRho_Fe = CrystalPhysics([molar_mass_fe, Z_Fe, V_Fe])
4710
+ rho_Fe = dataRho_Fe.calculate_bulk_density()
4711
+ rho_e_Fe = wg(amounts=amounts_fe, elements=element_fe, rho_b=rho_Fe).calculate_electron_density()
4712
+ #
4713
+ dataV_Zn = CrystalPhysics([[5.406], [], "cubic"])
4714
+ V_Zn = dataV_Zn.calculate_volume()
4715
+ Z_Zn = 4
4716
+ V_m_Zn = MineralChemistry().calculate_molar_volume(volume_cell=V_Zn, z=Z_Zn)
4717
+ dataRho_Zn = CrystalPhysics([molar_mass_zn, Z_Zn, V_Zn])
4718
+ rho_Zn = dataRho_Zn.calculate_bulk_density()
4719
+ rho_e_Zn = wg(amounts=amounts_zn, elements=element_zn, rho_b=rho_Zn).calculate_electron_density()
4720
+ #
4721
+ V_m = (x*V_m_Zn + (1 - x)*V_m_Fe)*magic_factor
4722
+ rho = (x*rho_Zn + (1 - x)*rho_Fe)*magic_factor
4723
+ rho_e = (x*rho_e_Zn + (1 - x)*rho_e_Fe)*magic_factor
4724
+ #
4725
+ # Bulk modulus
4726
+ K_Fe = 30*10**9
4727
+ K_Zn = 68*10**9
4728
+ K = (x*K_Zn + (1 - x)*K_Fe)*magic_factor
4729
+ # Shear modulus
4730
+ G_Fe = 19*10**9
4731
+ G_Zn = 33*10**9
4732
+ G = (x*G_Zn + (1 - x)*G_Fe)*magic_factor
4733
+ # Young's modulus
4734
+ E = (9*K*G)/(3*K + G)
4735
+ # Poisson's ratio
4736
+ nu = (3*K - 2*G)/(2*(3*K + G))
4737
+ # vP/vS
4738
+ vPvS = ((K + 4/3*G)/G)**0.5
4739
+ # P-wave velocity
4740
+ vP = ((K + 4/3*G)/rho)**0.5
4741
+ # S-wave velocity
4742
+ vS = (G/rho)**0.5
4743
+ # Gamma ray
4744
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
4745
+ # Photoelectricity
4746
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
4747
+ U = pe*rho_e*10**(-3)
4748
+ # Electrical resistivity
4749
+ p = None
4750
+ # Thermodynamics
4751
+ thermodynamics = {}
4752
+ thermodynamics["Gibbs Energy"] = None # J/mol
4753
+ thermodynamics["Enthalpy"] = None # J/mol
4754
+ thermodynamics["Entropy"] = None # J/(mol K)
4755
+ thermodynamics["Heat Capacity"] = None # J/(mol K)
4756
+ #
4757
+ # Output
4758
+ results = {}
4759
+ results["mineral"] = name
4760
+ results["state"] = var_state
4761
+ results["M"] = molar_mass
4762
+ element_list = np.array(amounts)[:, 0]
4763
+ results["chemistry"] = {}
4764
+ for index, element in enumerate(element_list, start=0):
4765
+ results["chemistry"][element] = amounts[index][2]
4766
+ results["rho"] = round(rho, 4)
4767
+ results["rho_e"] = round(rho_e, 4)
4768
+ results["V"] = round(V_m, 4)
4769
+ results["vP"] = round(vP, 4)
4770
+ results["vS"] = round(vS, 4)
4771
+ results["vP/vS"] = round(vPvS, 4)
4772
+ results["G"] = round(G*10**(-9), 4)
4773
+ results["K"] = round(K*10**(-9), 4)
4774
+ results["E"] = round(E*10**(-9), 4)
4775
+ results["nu"] = round(nu, 4)
4776
+ results["GR"] = round(gamma_ray, 4)
4777
+ results["PE"] = round(pe, 4)
4778
+ results["U"] = round(U, 4)
4779
+ results["thermodynamics"] = thermodynamics
4780
+ results["trace elements"] = element_traces
4781
+ if p != None:
4782
+ results["p"] = round(p, 4)
4783
+ else:
4784
+ results["p"] = p
4785
+ #
4786
+ return results