Material Analysis#

Imports#

NumPy#

  • import numpy as np

Description:#

NumPy is a powerful Python library for numerical computing. It provides support for multidimensional arrays, mathematical functions to operate on these arrays efficiently, and tools for working with arrays.

Tabulate#

  • from tabulate import tabulate

Description:#

Tabulate is a Python library used for creating formatted tables from data in Python. It simplifies the process of generating tables for display or output in various formats, including plain text, LaTeX, and HTML.

SAnTex Material#

  • from santex import Material

Description:#

The Material class from the Sage library is used for defining and working with materials calculations.

[1]:
import numpy as np
from tabulate import tabulate
from santex.material import Material

Function: availablePhases#

Description:#

This function retrieves information about the available phases in the Material instance.

Returns:#

  • phases_info (list): A list containing information about the available phases.

Usage Example:#

```python material_instance = Material() phases_info = material_instance.availablePhases() print(“Available Phases:”) print(phases_info)

[2]:
material_instance = Material()
phases_info = material_instance.availablePhases()
print("Available Phases:")
print(phases_info)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 2
      1 material_instance = Material()
----> 2 phases_info = material_instance.availablePhases()
      3 print("Available Phases:")
      4 print(phases_info)

AttributeError: 'Material' object has no attribute 'availablePhases'

Function: availablePrimaryPhases#

Description:#

This function retrieves information about the available primary phases in the Material instance.

Returns:#

  • primary_phases_info (list): A list containing information about the available primary phases.

Usage Example:#

```python material_instance = Material() primary_phases_info = material_instance.availablePrimaryPhases() print(“Available Primary Phases:”) print(primary_phases_info)

[ ]:
# availablePrimaryPhases
primary_phases_info = material_instance.availablePrimaryPhases()
print("Available Primary Phases:")
print(primary_phases_info)
print()

Function: availableCrystalSystems#

Description:#

This function retrieves information about the available crystal systems in the Material instance.

Returns:#

  • crystal_systems_info (list): A list containing information about the available crystal systems.

Usage Example:#

```python material_instance = Material() crystal_systems_info = material_instance.availableCrystalSystems() print(“Available Crystal Systems:”) print(crystal_systems_info)

[5]:
# availableCrystalSystems
crystal_systems_info = material_instance.available_crystal_systems()
print("Available Crystal Systems:")
print(crystal_systems_info)
print()
Available Crystal Systems:
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|   Crystal System    |                                                                                                                                                                                                                                              Phases                                                                                                                                                                                                                                               |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|     Monoclinic      | Biotite, Muscovite, Phlogopite, Illite-smectite, Dickite, Augite, Diopside, Chrome-diopside, Jadeite, Omphacite, Coesite, Amphobole #1 Richterite1, Amphobole #2 Kataphorite1, Amphobole #3 Taramite-Tschermakite1, Amphobole #4 Hornblende-Tschermakite1, Amphobole #5 Tremolite1, Amphobole #6 Edenite1, Amphobole #7 Edenite1, Amphobole #8 Pargasite1, Amphobole #9 Pargasite1, Hornblende (#1), Hornblende (#2), Glaucophane, Sanidine (Or83Ab15), Sanidine (Or89Ab11), Orthoclase (Or93Ab7) |
|      Amorphous      |                                                                                                                                                                                                                                               Melt                                                                                                                                                                                                                                                |
|        Cubic        |                                                                                                                                                                                                                           Almandine-pyrope, Grossular, Majorite, Pyrope                                                                                                                                                                                                                           |
|    Orthorhombic     |                                                                                                                                                                           Forsterite, Fayalite, Lawsonite, Orthoenstatite (MgSiO3), Orthoenstatite (MgSiO3), Enstatite, Bronzite (Mg0.8Fe0.2SiO3), Ferrosilite (FeSiO3)                                                                                                                                                                           |
| Hexagonal/ Trigonal |                                                                                                                                                                                                a_quartz_1, a_quartz_2, a_Quartz_3, a_quartz_4, a_quartz_696C, a_quartz_700C, Calcite_1, Calcite_2                                                                                                                                                                                                 |
|      Triclinic      |                                                                                                                                                       Albite (Or0Ab100), An0 (Albite), An25 (Oligoclase), An37 (Andesine), An48 (Andesine), An60 (Labradorite), An67 (Labradorite), An78 (Bytownite), An96 (Anorthite), Kaolinite, Nacrite                                                                                                                                                        |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Material Instance Operations#

Description:#

This section demonstrates operations performed on a Material instance.

Usage Example:#

```python material_instance = Material()

We first check the properties of Almandine-Pyrope by invoking method get_properties_by_phase() and then will get the voigt stiffness matrix at pressure = 3GPa and Temp = 1000K for Diopside by invoking voigthighPT() method of the Material class

[8]:
material_instance = Material()

# Get properties for 'Diopside'
diopside_properties = material_instance.get_properties_by_phase('Diopside')
print("Material Properties for Diopside:")
print(tabulate(diopside_properties.items(), headers=["Property", "Value"], tablefmt="fancy_grid"))
print("\n")
Material Properties for Diopside:
╒═════════════════════════╤══════════════════════════╕
│ Property                │ Value                    │
╞═════════════════════════╪══════════════════════════╡
│ Crystal System          │ Monoclinic               │
├─────────────────────────┼──────────────────────────┤
│ Primary Phase           │ Clinopyroxenes           │
├─────────────────────────┼──────────────────────────┤
│ Phase                   │ Diopside                 │
├─────────────────────────┼──────────────────────────┤
│ Density(g/cm3)          │ 3.327                    │
├─────────────────────────┼──────────────────────────┤
│ C11                     │ 237.8                    │
├─────────────────────────┼──────────────────────────┤
│ C22                     │ 183.6                    │
├─────────────────────────┼──────────────────────────┤
│ C33                     │ 229.5                    │
├─────────────────────────┼──────────────────────────┤
│ C44                     │ 76.5                     │
├─────────────────────────┼──────────────────────────┤
│ C55                     │ 73.0                     │
├─────────────────────────┼──────────────────────────┤
│ C66                     │ 81.6                     │
├─────────────────────────┼──────────────────────────┤
│ C12                     │ 83.5                     │
├─────────────────────────┼──────────────────────────┤
│ C13                     │ 80.0                     │
├─────────────────────────┼──────────────────────────┤
│ C23                     │ 59.9                     │
├─────────────────────────┼──────────────────────────┤
│ C15                     │ 9.0                      │
├─────────────────────────┼──────────────────────────┤
│ C25                     │ 9.5                      │
├─────────────────────────┼──────────────────────────┤
│ C35                     │ 48.1                     │
├─────────────────────────┼──────────────────────────┤
│ C46                     │ 8.4                      │
├─────────────────────────┼──────────────────────────┤
│ C14                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C16                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C24                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C26                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C34                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C36                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C45                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ C56                     │ 0                        │
├─────────────────────────┼──────────────────────────┤
│ Crystal Reference Frame │ X||a* Y|| b Z||c         │
├─────────────────────────┼──────────────────────────┤
│ Study                   │ Collins and Brown [1998] │
╘═════════════════════════╧══════════════════════════╛


[9]:
# Get voigt matrix for 'Diopside'
non_isotropic_phase = 'Diopside'
non_isotropic_voigt_matrix = material_instance.get_voigt_matrix(non_isotropic_phase)
print(f'Voigt matrix for {non_isotropic_phase}:')
print(tabulate(non_isotropic_voigt_matrix, tablefmt="pretty"))
Voigt matrix for Diopside:
+-------+-------+-------+------+------+------+
| 237.8 | 83.5  | 80.0  | 0.0  | 9.0  | 0.0  |
| 83.5  | 183.6 | 59.9  | 0.0  | 9.5  | 0.0  |
| 80.0  | 59.9  | 229.5 | 0.0  | 48.1 | 0.0  |
|  0.0  |  0.0  |  0.0  | 76.5 | 0.0  | 8.4  |
|  9.0  |  9.5  | 48.1  | 0.0  | 73.0 | 0.0  |
|  0.0  |  0.0  |  0.0  | 8.4  | 0.0  | 81.6 |
+-------+-------+-------+------+------+------+
[10]:
non_isotropic_voigt_matrix
[10]:
array([[237.8,  83.5,  80. ,   0. ,   9. ,   0. ],
       [ 83.5, 183.6,  59.9,   0. ,   9.5,   0. ],
       [ 80. ,  59.9, 229.5,   0. ,  48.1,   0. ],
       [  0. ,   0. ,   0. ,  76.5,   0. ,   8.4],
       [  9. ,   9.5,  48.1,   0. ,  73. ,   0. ],
       [  0. ,   0. ,   0. ,   8.4,   0. ,  81.6]])

Get voigt matrix for forsterite#

Lets now look at the voigt matrix that is obtained from the catalogue for phase Forsterite

[11]:
material = Material()
material.get_voigt_matrix("Forsterite")
[11]:
array([[320.5,  68.1,  71.6,   0. ,   0. ,   0. ],
       [ 68.1, 196.5,  76.8,   0. ,   0. ,   0. ],
       [ 71.6,  76.8, 233.5,   0. ,   0. ,   0. ],
       [  0. ,   0. ,   0. ,  64. ,   0. ,   0. ],
       [  0. ,   0. ,   0. ,   0. ,  77. ,   0. ],
       [  0. ,   0. ,   0. ,   0. ,   0. ,  78.7]])

Get voigt matrix and density for for diopside, enstatite, forsterite at high p and t#

Lets load the stiffness tensors and density at any different P and T

[15]:
material.voigt_high_PT('Forsterite', PRESSURE = 2, TEMP = 1500)
[15]:
array([[297.72,  64.96,  71.44,   0.  ,   0.  ,   0.  ],
       [ 64.96, 175.9 ,  79.5 ,   0.  ,   0.  ,   0.  ],
       [ 71.44,  79.5 , 211.92,   0.  ,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,  52.88,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,  64.72,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,  65.32]])
[16]:
material.voigt_high_PT('Enstatite', PRESSURE = 3, TEMP = 1500)
[16]:
array([[227.78,  75.07,  52.31,   0.  ,   0.  ,   0.  ],
       [ 75.07, 168.71,  70.15,   0.  ,   0.  ,   0.  ],
       [ 52.31,  70.15, 217.74,   0.  ,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,  75.72,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,  71.6 ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,  70.95]])
[18]:
material.voigt_high_PT('Diopside', PRESSURE = 3, TEMP = 1500)
[18]:
array([[225.77,  83.47,  80.39,   0.  ,   8.25,   0.  ],
       [ 83.47, 175.8 ,  60.2 ,   0.  ,  10.07,   0.  ],
       [ 80.39,  60.2 , 219.36,   0.  ,  55.12,   0.  ],
       [  0.  ,   0.  ,   0.  ,  71.1 ,   0.  ,  12.93],
       [  8.25,  10.07,  55.12,   0.  ,  66.22,   0.  ],
       [  0.  ,   0.  ,   0.  ,  12.93,   0.  ,  74.76]])

Lets load density of Forsterite at ambient pressure and temperature

[19]:
material.load_density("Forsterite")
[19]:
3355.0

Lets now look at the density of the Forsterite at Pressure = 2GPa and Temperature = 1500K

[20]:
material_instance.load_density("Forsterite", 2, 1500)
[20]:
3098.6089636963993

Lets now look at the density of the Diopside at Pressure = 2GPa and Temperature = 1500K

[21]:
material_instance.load_density("Diopside", 2, 1500)
[21]:
3156.5123590988196

Lets now look at the density of the Enstatite at Pressure = 2GPa and Temperature = 1500K

[22]:
material_instance.load_density("Enstatite", 2, 1000)
[22]:
3167.7389007248685