Skip to main content

Calculates structure of oxide glasses using statistical mechanics

Project description

1. Introduction

This python package uses statistical mechanics-based modeling to accurately predict the short-range order structural distribution in oxide glasses. To make the predictions, the model requires interaction enthalpies obtained by fitting to experimental data (typically obtained with NMR spectroscopy techniques).

The package is designed for building a library of enthalpies by providing relevant data to the package.

For a detailed guide, please refer to "the article" (will be filed when published). Any bugs or questions, do not hesitate to contact msb@bio.aau.dk or mos@bio.aau.dk

2. Package format

The basic format of the package follows:

StatMechGlass
.
├── Data
│   ├── SiB
│   │   ├── Na.csv
│   └── SiO2
│   ├── Na.csv
│   ├── Na_Tg.csv
├── Parameters
│   ├── MF
│   │   ├── BAl.csv
│   │   └── SiB.csv
│   └── SiO2
│   ├── K.csv
│   └── Na.csv
├── stat_mech_module
│   ├── __init__.py
│   ├── stat_mech_borate.py
│   ├── stat_mech_phosphate.py
│   └── stat_mech_silicate.py
├── __init__.py
├── stat_mech_glass.py

Here, experimentally obtained data should be placed in the /Data directory. The /parameter directory is where the package will automatically store the enthalpies obtained by fitting the provided data. Some enthalpies are provided already.

3. Usage

When using the package, either type commands in the stat_mech_glass.py file directly or import the package to a python script. It is advised to write code within if __name__ == '__main__'. Alternatively, place the package in the working directory and import it with

import StatMechGlass.stat_mech_glass as smg

or import with pip:

pip install StatMechGlass
from StatMechGlass import stat_mech_glass as smg

The four main functions:

smg.smg_binary_par(former, modifier, it=10, path_in=None)  
smg.smg_ternary_par(formers, modifier, it=10, path_in=None)  
smg.smg_structure(val, Tg, p = None)  
smg.smg_plot(comps, free_comp, Tg, plt_save = False)  

3.1 Fitting enthalpy parameters on binary oxide glasses

When building the enthalpy database, use smg.smg_binary_par:

  1. Place data in the Data/"Former" directory, where "Former" corresponds to the network forming species of the glass. Currently supported formers:
    "SiO2", "B2O3", "P2O5"
    The data file should be named appropriately such as "Na.csv" or "K.csv"
    Refer to Section 4 for data file layout.

  2. Place Tg data for the same glass system in the same directory with the name:
    "modifier"_Tg.csv
    Here, "modifier" should be the same as in 1. such as "Na_Tg.csv" or "K_Tg.csv" The Tg data does not need to be for the same glass compositions as the structural data

  3. Execute the function

    smg.smg_binary_par(former, modifier, it=10)
    

    Example:

    smg.smg_binary_par("Si", "Na", it=500)  
    

    500 or more iterations are advised for accurate enthalpies (refer to the manuscript for more details)

path_in can be used to change the path for the input data (naming convention must still be followed)

3.2 Fitting interaction parameters on ternary oxide glasses

When building the former/former interaction database, use smg.smg_ternary_par:

  1. Place data in the Data/"Former""Former" directory, where "Former" corresponds to the network forming or intermediate specie of the glass. Currently supported formers and intermediates:
    SiO2, B2O3, P2O5, Al2O5
    Here, the folder must be named according to the naming convention (section 4):
    "SiB", "BP", "PSi", "AlB"
    The data file should be named appropriately such as "Na.csv" or "K.csv"

  2. Tg data should be provided for each glass in the data file. Refer to section 4 for clarification on data file content

  3. Execute the function

    smg.smg_ternary_par(formers, modifier, it=10)  
    

    Example:

    smg.smg_ternary_par(["Si", "B"], "Na", it=100)  
    

    100 or more iterations are advised for accurate parameter (refer to the manuscript for more details)

path_in can be used to change the path for the input data (naming convention must still be followed)

3.3 Predicting the structural distribution in a given composition

The number of compositions to be predicted by the model increases exponentially when building the enthalpy database. This is due to the tranferability of the interaction enthalpies. That is, enthalpies established from Na2O-SiO2 and Na2O-B2O3 glasses may also be used to predict any Na2O-B2O3-SiO2 composition.

When using the model to predict structural distributions, use smg.smg_structure:

  1. Define the glass composition using python directory
    Example:
    glass_comp = {"Si": 25, "B": 25, "Na": 25, "K":25}  
    
  2. Run the function with a defined Tg Example:
    results = smg.smg_structure(glass_comp, 700)  
    

This way, users may easily build a database of structures from a large set of glass compositions

3.4 Simple 2D plotting

As glass compositions may consist of many different elements, smg.smg_structure can be used to return structures which the user may plot themselves. For simple visualization, the smg.smg_plot function may be used:

  1. Define the glass composition using python directory
    Example:
    glass_comp = {"Si": 25, "B": 25, "Na": 0}  
    
    Alternatively, leave out the free component:
    glass_comp = {"Si": 25, "B": 25}  
    
  2. Run the function with a defined Tg and free component
    Example:
    smg.smg_plot(glass_comp, "Na", 800, plt_save = True)  
    
    Set plt_save to True for saving the plot as .png file

This will make a plot of 25SiO2-25B2O3 as a function of Na2O content.

4. Naming convention

For the script to locate files, parameters and functions, a certain naming convention was introduced which must be followed:

4.1 Network formers and modifiers

When calling network formers in any function these are abbreviated to their basic atom:
"Si", "B", "Al", "P"
Example:
25SiO2-25B2O3-50Na2O should be {"Si": 25, "B": 25, "Na": 50}. Note that the glass contains 2 boron atoms for each silicon atom but in the naming convention they seem to contain the same number of atoms.

When using modifiers in the functions, these should be named according to the data files provided by the user. If the data file is named "Na.csv", "Na" should be used in the functions.

4.2 Datafiles

All data files should consist of numbers only. No letters

4.2.1 Binary oxide glass data

All binary oxide glass data files must contain the modifier concentration in the first column and the structure distributions in the following columns:

modifier_mol%,former_structure1,former_structure2,...former_structureN

Example for Na2O-SiO2 data:
Na2O%,Si4%,Si3%,Si2%,Si1%,Si0%
Example with numbers:

20,50,48,2,0,0
25,38,61,1,0,0
28.6,27,68,5,0,0
33.3,11,79,10,0,0

The structures reported depend on the network forming species:

SiO2:
Si4,Si3,Si2,Si1,Si0

B2O3:
B4

P2O5:
P3,P2,P1,P0

Al2O3:
Al4,Al5/6*

* Note that Al5 and Al6 species are combined.

The Tg file should contain:
modifier_mol%,Tg

4.2.2 Ternary oxide glass data

All ternary oxide glass data files must contain "modifier concentration, first former concentration, second former concentration, Tg" in columns 1, 2, 3, and 4, respectively:

modifier_mol%,former1_mol%,former2_mol%,Tg,former1_structures,former2_structures.

The structures provided should follow the convention explained in Section 4.2.1 and be in order of network forming species.
Example data file for smg.smg_ternary_par(["Si", "B"], "Na", it=100):
Na2O%,SiO2%,B2O3%,Tg,Si4,Si3,Si2,Si1,Si0,B4

Example for smg.smg_ternary_par(["B", "Si"], "Na", it=100):
Na2O%,B2O3%,SiO2%,Tg,B4,Si4,Si3,Si2,Si1,Si0

5. Final remarks

Thank you for using the software!
Upon building on the software or enthalpy database, you are encouraged to make a pull request by first making a seperate branch. Make sure to describe the change in detain and how you tested the change. Possible changes could include: adding new data or parameters to the database, building upon the modules to include more glass families, or general bug fixes/improvements.

Thanks,
Mikkel Bødker, msb@bio.aau.dk
Oxide Glass Chemistry Group, Department of Chemistry and Bioscience, Aalborg University, Denmark

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

StatMechGlass-0.1.5.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

StatMechGlass-0.1.5-py3-none-any.whl (48.0 kB view details)

Uploaded Python 3

File details

Details for the file StatMechGlass-0.1.5.tar.gz.

File metadata

  • Download URL: StatMechGlass-0.1.5.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for StatMechGlass-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fd7e2b252bc80d388320a19364455e3e711615f43e236ca858f256e411055c79
MD5 d29b8efe9773b2fcd7d9ad9651c82a94
BLAKE2b-256 756a32c87250b1a5a3c459447e0b03aacb5d89b54fc0405d0eb4e82c69ad7d6e

See more details on using hashes here.

File details

Details for the file StatMechGlass-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: StatMechGlass-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 48.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for StatMechGlass-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f209c140d2d339a42176458bb80d9e55651815dc30d66aff77a9a8c30916b4bd
MD5 6659033c8ceae4dc4af01e1ba9de3904
BLAKE2b-256 661358ef7ae316698dfe06fa983e2274f97d0346bfb2e05507f6819767c3e723

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page