This page was generated from docs/Examples/Other_Useful_Functions/Calculating_KDs_Kiseeva.ipynb. Interactive online version: Binder badge.

Python Notebook Download

Calculating partition coefficients

Here we load various python packages

[1]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import PySulfSat as ss
import Thermobar as pt
pd.options.display.max_columns = None
ss.__version__
[1]:
'0.0.17'

Here we load our glass data using the Thermobar load structure

  • First, this looks for column headings for each phase.

  • Here, because we only have liquids, I haven’t bothered to add “_Liq” after each oxide, so you just need to tell the function that.

[2]:
In=pt.import_excel('Glass_input_example.xlsx', suffix="_Liq", sheet_name='Glass_input')
Liqs=In['Liqs'] # This pulls out just the columns it needs for liquids

This calculates temperature using the Sugawara thermometer

  • At 3.2 kbar presure

[3]:
Sugawara_T=pt.calculate_liq_only_temp(liq_comps=Liqs, equationT="T_Sug2000_eq3_ol", P=3.2)

This calculates the Kd using Kiseeva et al. and the sulfie composition, as well as the Kds from Brenan (2015) for Se and Te

You need to tell it: - the Ni and Cu content of the sulfide - The FeOt content of the liquid - The temperature in Kelvin - The proportion of Fe3Fet in your liquid

[4]:
Calc_Kd=ss.calculate_sulf_kds(Ni_Sulf=2.2,
                                    Cu_Sulf=12.804,
                                       FeOt_Liq=Liqs['FeOt_Liq'],
                                       T_K=Sugawara_T,
                                       Fe3Fet_Liq=0)
[5]:
Calc_Kd.head()
[5]:
S_Sulf O_Sulf Fe_Sulf Ni_Sulf Cu_Sulf DNi DCu DAg DPb DZn DCd DTl DMn DIn DTi DGa DSb DCo DV DGe DCr DSe_B2015 DTe_B2015
0 28.889774 3.007096 53.099130 2.2 12.804 831.971727 765.753580 805.083251 27.422926 1.417481 57.390194 7.632734 0.348569 10.527493 0.008983 0.022206 11.778163 37.556741 0.147699 0.363550 0.886372 790.758001 6933.354144
1 28.798040 3.063111 53.134849 2.2 12.804 828.505827 765.752606 806.073742 27.017971 1.390299 56.714297 7.527723 0.342776 10.322400 0.009045 0.021577 11.417914 36.983452 0.145170 0.350906 0.866265 766.086469 6662.618410
2 28.717732 3.112149 53.166119 2.2 12.804 810.570719 748.623170 788.909667 26.496807 1.373343 55.661209 7.449138 0.340263 10.121148 0.009152 0.021600 11.243449 36.252072 0.144834 0.347752 0.857510 744.959829 6430.392157
3 28.730993 3.104051 53.160955 2.2 12.804 806.475753 743.475584 783.348165 26.498263 1.378935 55.607301 7.467304 0.341787 10.139992 0.009154 0.021857 11.331808 36.256183 0.145720 0.351747 0.862817 748.418342 6468.427547
4 28.978200 2.953101 53.064699 2.2 12.804 848.358523 780.250434 819.342051 27.981626 1.439479 58.480965 7.726977 0.352340 10.760029 0.008895 0.022365 12.029887 38.342135 0.148752 0.369913 0.899370 815.088357 7199.689937
[ ]:

[ ]:

[ ]: