{ "cells": [ { "cell_type": "code", "execution_count": 3, "id": "139c98b6-ecf9-404a-ba8a-be6471124f5a", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import sys\n", "sys.path.append(\"..\")\n", "import matplotlib.pyplot as plt\n", "import Thermobar as pt\n", "import sympy as sym\n", "pd.options.display.max_columns = None" ] }, { "cell_type": "code", "execution_count": 5, "id": "2d4619c0-2e07-4347-b921-6f5b670f2fea", "metadata": {}, "outputs": [], "source": [ "LiqT=pd.DataFrame(data={\"Sample_ID_Liq\": 'test',\n", " \"SiO2_Liq\": 51,\n", " \"TiO2_Liq\": 0.48,\n", " \"Al2O3_Liq\": 19,\n", " \"FeOt_Liq\": 5.3,\n", " \"MnO_Liq\": 0.1,\n", " \"MgO_Liq\": 4.5,\n", " \"CaO_Liq\": 9,\n", " \"Na2O_Liq\": 4.2,\n", " \"K2O_Liq\": 0.1,\n", " \"Cr2O3_Liq\": 0.11,\n", " \"P2O5_Liq\": 0.11,\n", " \"H2O_Liq\": 5,\n", " \"Fe3FeT_Liq\":0.1,\n", "}, index=[0])\n", "\n", "PlagT=pd.DataFrame(data={\"Sample_ID_Plag\": 'test1',\n", " \"SiO2_Plag\": 57.3,\n", " \"TiO2_Plag\": 0.09,\n", " \"Al2O3_Plag\": 26.6,\n", " \"FeOt_Plag\": 0.43,\n", " \"MnO_Plag\": 0,\n", " \"MgO_Plag\": 0.03,\n", " \"CaO_Plag\": 8.83,\n", " \"Na2O_Plag\": 6.11,\n", " \"K2O_Plag\": 0.49,\n", " \"Cr2O3_Plag\": 0.0}, index=[0])\n", "\n", "PlagT2=pd.DataFrame(data={\"Sample_ID_Plag\": 'testplg2',\n", " \"SiO2_Plag\": 57.9,\n", " \"TiO2_Plag\": 1.09,\n", " \"Al2O3_Plag\": 26.6,\n", " \"FeOt_Plag\": 0.43,\n", " \"MnO_Plag\": 0,\n", " \"MgO_Plag\": 0.03,\n", " \"CaO_Plag\": 8.83,\n", " \"Na2O_Plag\": 6.11,\n", " \"K2O_Plag\": 0.49,\n", " \"Cr2O3_Plag\": 0.0}, index=[0])\n", "\n", "KsparT=pd.DataFrame(data={\"Sample_ID_Kspar\": 'test2',\n", " \"SiO2_Kspar\": 65.5,\n", " \"TiO2_Kspar\": 0.0,\n", " \"Al2O3_Kspar\": 19.6,\n", " \"FeOt_Kspar\": 0.07,\n", " \"MnO_Kspar\": 0,\n", " \"MgO_Kspar\": 0.0,\n", " \"CaO_Kspar\": 0.75,\n", " \"Na2O_Kspar\": 4.81,\n", " \"K2O_Kspar\": 9.36,\n", " \"Cr2O3_Kspar\": 0.0}, index=[0])\n", "\n", "LiqT2=pd.DataFrame(data={\"Sample_ID_Liq\": 'testliq2',\n", " \"SiO2_Liq\": 61,\n", " \"TiO2_Liq\": 0.45,\n", " \"Al2O3_Liq\": 18.56,\n", " \"FeOt_Liq\": 3.17,\n", " \"MnO_Liq\": 0.27,\n", " \"MgO_Liq\": 0.23,\n", " \"CaO_Liq\": 1.64,\n", " \"Na2O_Liq\": 6.11,\n", " \"K2O_Liq\": 7.09,\n", " \"Cr2O3_Liq\": 0,\n", " \"P2O5_Liq\": 0.02,\n", " \"H2O_Liq\": 2,\n", " \"Fe3FeT_Liq\":0,\n", "}, index=[0])\n", "\n", "\n", "Liq_Several=pd.concat([LiqT, LiqT2])\n", "Plag_Several=pd.concat([PlagT, PlagT2])" ] }, { "cell_type": "code", "execution_count": 10, "id": "e9d8db07", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Considering N=2 Fspar & N=2 Liqs, which is a total of N=4 Liq-Fspar pairs, be patient if this is >>1 million!\n", "Applying filter to only average those that pass the An-Ab eq test of Putirka, 2008\n", "Done!!! I found a total of N=2 Fspar-Liq matches using the specified filter. N=4 Fspar out of the N=2 Fspar that you input matched to 1 or more liquids\n" ] }, { "data": { "text/plain": [ "1236.0082305446053" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_temp_matching(liq_comps=Liq_Several, plag_comps=Plag_Several,\n", " equationT='T_Put2008_eq24a',\n", "P=5, Ab_An_P2008=True)['All_PTs']['T_K_calc'][0]" ] }, { "cell_type": "code", "execution_count": 3, "id": "2aff0b69-fd48-48a1-81ba-21f6535a7af7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "10\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
# of iterationsT_K_calcDelta T (last 2 iters)H2O_calcDelta H (last 2 iters)Pass An-Ab Eq Test Put2008?Delta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnSiO2_PlagTiO2_PlagAl2O3_PlagFeOt_PlagMnO_PlagMgO_PlagCaO_PlagNa2O_PlagK2O_PlagCr2O3_PlagSi_Plag_cat_propMg_Plag_cat_propFet_Plag_cat_propCa_Plag_cat_propAl_Plag_cat_propNa_Plag_cat_propK_Plag_cat_propMn_Plag_cat_propTi_Plag_cat_propCr_Plag_cat_propsumSi_Plag_cat_fracMg_Plag_cat_fracFet_Plag_cat_fracCa_Plag_cat_fracAl_Plag_cat_fracNa_Plag_cat_fracK_Plag_cat_fracMn_Plag_cat_fracTi_Plag_cat_fracCr_Plag_cat_fracAn_PlagAb_PlagOr_PlagSiO2_LiqTiO2_LiqAl2O3_LiqFeOt_LiqMnO_LiqMgO_LiqCaO_LiqNa2O_LiqK2O_LiqCr2O3_LiqP2O5_LiqH2O_LiqFe3FeT_LiqSiO2_Liq_mol_fracMgO_Liq_mol_fracMnO_Liq_mol_fracFeOt_Liq_mol_fracCaO_Liq_mol_fracAl2O3_Liq_mol_fracNa2O_Liq_mol_fracK2O_Liq_mol_fracTiO2_Liq_mol_fracP2O5_Liq_mol_fracCr2O3_Liq_mol_fracSi_Liq_cat_fracMg_Liq_cat_fracMn_Liq_cat_fracFet_Liq_cat_fracCa_Liq_cat_fracAl_Liq_cat_fracNa_Liq_cat_fracK_Liq_cat_fracTi_Liq_cat_fracP_Liq_cat_fracCr_Liq_cat_fracMg_Number_Liq_Fe3Mg_Number_Liq_NoFe3PT
0101362.263707-0.8510533.8209110.021159High T: No0.2473580.3613850.0273740.6787240.1787480.0011270.6510557.30.0926.60.4300.038.836.110.490.00.953660.0007440.0059850.1574610.5217680.1971640.0104040.00.0011270.01.8483130.5159620.0004030.0032380.0851920.2822940.1066720.0056290.00.000610.00.4313660.5401330.028501510.48195.30.14.594.20.10.110.1150.10.581850.0765350.0009660.0505680.1100160.1277380.0464520.0007280.0041190.0005310.0004960.4947930.0650840.0008220.0430020.0935550.2172520.0790040.0012380.0035030.0009040.0008440.6021440.602144101363.11476
\n", "
" ], "text/plain": [ " # of iterations T_K_calc Delta T (last 2 iters) H2O_calc \\\n", "0 10 1362.263707 -0.851053 3.820911 \n", "\n", " Delta H (last 2 iters) Pass An-Ab Eq Test Put2008? Delta_An Delta_Ab \\\n", "0 0.021159 High T: No 0.247358 0.361385 \n", "\n", " Delta_Or Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An SiO2_Plag \\\n", "0 0.027374 0.678724 0.178748 0.001127 0.65105 57.3 \n", "\n", " TiO2_Plag Al2O3_Plag FeOt_Plag MnO_Plag MgO_Plag CaO_Plag Na2O_Plag \\\n", "0 0.09 26.6 0.43 0 0.03 8.83 6.11 \n", "\n", " K2O_Plag Cr2O3_Plag Si_Plag_cat_prop Mg_Plag_cat_prop \\\n", "0 0.49 0.0 0.95366 0.000744 \n", "\n", " Fet_Plag_cat_prop Ca_Plag_cat_prop Al_Plag_cat_prop Na_Plag_cat_prop \\\n", "0 0.005985 0.157461 0.521768 0.197164 \n", "\n", " K_Plag_cat_prop Mn_Plag_cat_prop Ti_Plag_cat_prop Cr_Plag_cat_prop \\\n", "0 0.010404 0.0 0.001127 0.0 \n", "\n", " sum Si_Plag_cat_frac Mg_Plag_cat_frac Fet_Plag_cat_frac \\\n", "0 1.848313 0.515962 0.000403 0.003238 \n", "\n", " Ca_Plag_cat_frac Al_Plag_cat_frac Na_Plag_cat_frac K_Plag_cat_frac \\\n", "0 0.085192 0.282294 0.106672 0.005629 \n", "\n", " Mn_Plag_cat_frac Ti_Plag_cat_frac Cr_Plag_cat_frac An_Plag Ab_Plag \\\n", "0 0.0 0.00061 0.0 0.431366 0.540133 \n", "\n", " Or_Plag SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq \\\n", "0 0.028501 51 0.48 19 5.3 0.1 4.5 \n", "\n", " CaO_Liq Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3FeT_Liq \\\n", "0 9 4.2 0.1 0.11 0.11 5 0.1 \n", "\n", " SiO2_Liq_mol_frac MgO_Liq_mol_frac MnO_Liq_mol_frac FeOt_Liq_mol_frac \\\n", "0 0.58185 0.076535 0.000966 0.050568 \n", "\n", " CaO_Liq_mol_frac Al2O3_Liq_mol_frac Na2O_Liq_mol_frac K2O_Liq_mol_frac \\\n", "0 0.110016 0.127738 0.046452 0.000728 \n", "\n", " TiO2_Liq_mol_frac P2O5_Liq_mol_frac Cr2O3_Liq_mol_frac Si_Liq_cat_frac \\\n", "0 0.004119 0.000531 0.000496 0.494793 \n", "\n", " Mg_Liq_cat_frac Mn_Liq_cat_frac Fet_Liq_cat_frac Ca_Liq_cat_frac \\\n", "0 0.065084 0.000822 0.043002 0.093555 \n", "\n", " Al_Liq_cat_frac Na_Liq_cat_frac K_Liq_cat_frac Ti_Liq_cat_frac \\\n", "0 0.217252 0.079004 0.001238 0.003503 \n", "\n", " P_Liq_cat_frac Cr_Liq_cat_frac Mg_Number_Liq_Fe3 Mg_Number_Liq_NoFe3 \\\n", "0 0.000904 0.000844 0.602144 0.602144 \n", "\n", " P T \n", "0 10 1363.11476 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Temp_H2O=pt.calculate_fspar_liq_temp_hygr(plag_comps=PlagT, liq_comps=LiqT, equationT=\"T_Put2008_eq23\",\n", " equationH=\"H_Waters2015\", iterations=10, P=10)\n", "Temp_H2O['T_H_calc']" ] }, { "cell_type": "code", "execution_count": 4, "id": "3f1a3c0a-2330-4c00-8a46-c932dbadb3c3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "10\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
# of iterationsT_K_calcDelta T (last 2 iters)H2O_calcDelta H (last 2 iters)Pass An-Ab Eq Test Put2008?Delta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnSiO2_PlagTiO2_PlagAl2O3_PlagFeOt_PlagMnO_PlagMgO_PlagCaO_PlagNa2O_PlagK2O_PlagCr2O3_PlagSi_Plag_cat_propMg_Plag_cat_propFet_Plag_cat_propCa_Plag_cat_propAl_Plag_cat_propNa_Plag_cat_propK_Plag_cat_propMn_Plag_cat_propTi_Plag_cat_propCr_Plag_cat_propsumSi_Plag_cat_fracMg_Plag_cat_fracFet_Plag_cat_fracCa_Plag_cat_fracAl_Plag_cat_fracNa_Plag_cat_fracK_Plag_cat_fracMn_Plag_cat_fracTi_Plag_cat_fracCr_Plag_cat_fracAn_PlagAb_PlagOr_PlagSiO2_LiqTiO2_LiqAl2O3_LiqFeOt_LiqMnO_LiqMgO_LiqCaO_LiqNa2O_LiqK2O_LiqCr2O3_LiqP2O5_LiqH2O_LiqFe3FeT_LiqSiO2_Liq_mol_fracMgO_Liq_mol_fracMnO_Liq_mol_fracFeOt_Liq_mol_fracCaO_Liq_mol_fracAl2O3_Liq_mol_fracNa2O_Liq_mol_fracK2O_Liq_mol_fracTiO2_Liq_mol_fracP2O5_Liq_mol_fracCr2O3_Liq_mol_fracSi_Liq_cat_fracMg_Liq_cat_fracMn_Liq_cat_fracFet_Liq_cat_fracCa_Liq_cat_fracAl_Liq_cat_fracNa_Liq_cat_fracK_Liq_cat_fracTi_Liq_cat_fracP_Liq_cat_fracCr_Liq_cat_fracMg_Number_Liq_Fe3Mg_Number_Liq_NoFe3PT
0101391.82907-0.157533.3806390.004505High T: No0.2788120.3737750.0271850.7101780.1663580.0013160.6510557.30.0926.60.4300.038.836.110.490.00.953660.0007440.0059850.1574610.5217680.1971640.0104040.00.0011270.01.8483130.5159620.0004030.0032380.0851920.2822940.1066720.0056290.00.000610.00.4313660.5401330.028501510.48195.30.14.594.20.10.110.1150.10.581850.0765350.0009660.0505680.1100160.1277380.0464520.0007280.0041190.0005310.0004960.4947930.0650840.0008220.0430020.0935550.2172520.0790040.0012380.0035030.0009040.0008440.6021440.602144101391.9866
\n", "
" ], "text/plain": [ " # of iterations T_K_calc Delta T (last 2 iters) H2O_calc \\\n", "0 10 1391.82907 -0.15753 3.380639 \n", "\n", " Delta H (last 2 iters) Pass An-Ab Eq Test Put2008? Delta_An Delta_Ab \\\n", "0 0.004505 High T: No 0.278812 0.373775 \n", "\n", " Delta_Or Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An SiO2_Plag \\\n", "0 0.027185 0.710178 0.166358 0.001316 0.65105 57.3 \n", "\n", " TiO2_Plag Al2O3_Plag FeOt_Plag MnO_Plag MgO_Plag CaO_Plag Na2O_Plag \\\n", "0 0.09 26.6 0.43 0 0.03 8.83 6.11 \n", "\n", " K2O_Plag Cr2O3_Plag Si_Plag_cat_prop Mg_Plag_cat_prop \\\n", "0 0.49 0.0 0.95366 0.000744 \n", "\n", " Fet_Plag_cat_prop Ca_Plag_cat_prop Al_Plag_cat_prop Na_Plag_cat_prop \\\n", "0 0.005985 0.157461 0.521768 0.197164 \n", "\n", " K_Plag_cat_prop Mn_Plag_cat_prop Ti_Plag_cat_prop Cr_Plag_cat_prop \\\n", "0 0.010404 0.0 0.001127 0.0 \n", "\n", " sum Si_Plag_cat_frac Mg_Plag_cat_frac Fet_Plag_cat_frac \\\n", "0 1.848313 0.515962 0.000403 0.003238 \n", "\n", " Ca_Plag_cat_frac Al_Plag_cat_frac Na_Plag_cat_frac K_Plag_cat_frac \\\n", "0 0.085192 0.282294 0.106672 0.005629 \n", "\n", " Mn_Plag_cat_frac Ti_Plag_cat_frac Cr_Plag_cat_frac An_Plag Ab_Plag \\\n", "0 0.0 0.00061 0.0 0.431366 0.540133 \n", "\n", " Or_Plag SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq \\\n", "0 0.028501 51 0.48 19 5.3 0.1 4.5 \n", "\n", " CaO_Liq Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3FeT_Liq \\\n", "0 9 4.2 0.1 0.11 0.11 5 0.1 \n", "\n", " SiO2_Liq_mol_frac MgO_Liq_mol_frac MnO_Liq_mol_frac FeOt_Liq_mol_frac \\\n", "0 0.58185 0.076535 0.000966 0.050568 \n", "\n", " CaO_Liq_mol_frac Al2O3_Liq_mol_frac Na2O_Liq_mol_frac K2O_Liq_mol_frac \\\n", "0 0.110016 0.127738 0.046452 0.000728 \n", "\n", " TiO2_Liq_mol_frac P2O5_Liq_mol_frac Cr2O3_Liq_mol_frac Si_Liq_cat_frac \\\n", "0 0.004119 0.000531 0.000496 0.494793 \n", "\n", " Mg_Liq_cat_frac Mn_Liq_cat_frac Fet_Liq_cat_frac Ca_Liq_cat_frac \\\n", "0 0.065084 0.000822 0.043002 0.093555 \n", "\n", " Al_Liq_cat_frac Na_Liq_cat_frac K_Liq_cat_frac Ti_Liq_cat_frac \\\n", "0 0.217252 0.079004 0.001238 0.003503 \n", "\n", " P_Liq_cat_frac Cr_Liq_cat_frac Mg_Number_Liq_Fe3 Mg_Number_Liq_NoFe3 \\\n", "0 0.000904 0.000844 0.602144 0.602144 \n", "\n", " P T \n", "0 10 1391.9866 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Temp_H2O=pt.calculate_fspar_liq_temp_hygr(plag_comps=PlagT, liq_comps=LiqT, equationT=\"T_Put2008_eq24a\",\n", " equationH=\"H_Waters2015\", iterations=10, P=10)\n", "Temp_H2O['T_H_calc']" ] }, { "cell_type": "code", "execution_count": 5, "id": "28ea4ad0-9206-4831-a84e-353a0baca763", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "10\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
# of iterationsT_K_calcDelta T (last 2 iters)H2O_calcDelta H (last 2 iters)Pass An-Ab Eq Test Put2008?Delta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnSiO2_PlagTiO2_PlagAl2O3_PlagFeOt_PlagMnO_PlagMgO_PlagCaO_PlagNa2O_PlagK2O_PlagCr2O3_PlagSi_Plag_cat_propMg_Plag_cat_propFet_Plag_cat_propCa_Plag_cat_propAl_Plag_cat_propNa_Plag_cat_propK_Plag_cat_propMn_Plag_cat_propTi_Plag_cat_propCr_Plag_cat_propsumSi_Plag_cat_fracMg_Plag_cat_fracFet_Plag_cat_fracCa_Plag_cat_fracAl_Plag_cat_fracNa_Plag_cat_fracK_Plag_cat_fracMn_Plag_cat_fracTi_Plag_cat_fracCr_Plag_cat_fracAn_PlagAb_PlagOr_PlagSiO2_LiqTiO2_LiqAl2O3_LiqFeOt_LiqMnO_LiqMgO_LiqCaO_LiqNa2O_LiqK2O_LiqCr2O3_LiqP2O5_LiqH2O_LiqFe3FeT_LiqSiO2_Liq_mol_fracMgO_Liq_mol_fracMnO_Liq_mol_fracFeOt_Liq_mol_fracCaO_Liq_mol_fracAl2O3_Liq_mol_fracNa2O_Liq_mol_fracK2O_Liq_mol_fracTiO2_Liq_mol_fracP2O5_Liq_mol_fracCr2O3_Liq_mol_fracSi_Liq_cat_fracMg_Liq_cat_fracMn_Liq_cat_fracFet_Liq_cat_fracCa_Liq_cat_fracAl_Liq_cat_fracNa_Liq_cat_fracK_Liq_cat_fracTi_Liq_cat_fracP_Liq_cat_fracCr_Liq_cat_fracMg_Number_Liq_Fe3Mg_Number_Liq_NoFe3PT
0101217.044852-0.000059.098120.000002Low T: Yes0.0908510.2692620.0280420.5222170.270870.000460.6510557.30.0926.60.4300.038.836.110.490.00.953660.0007440.0059850.1574610.5217680.1971640.0104040.00.0011270.01.8483130.5159620.0004030.0032380.0851920.2822940.1066720.0056290.00.000610.00.4313660.5401330.028501510.48195.30.14.594.20.10.110.1150.10.581850.0765350.0009660.0505680.1100160.1277380.0464520.0007280.0041190.0005310.0004960.4947930.0650840.0008220.0430020.0935550.2172520.0790040.0012380.0035030.0009040.0008440.6021440.602144101217.044901
\n", "
" ], "text/plain": [ " # of iterations T_K_calc Delta T (last 2 iters) H2O_calc \\\n", "0 10 1217.044852 -0.00005 9.09812 \n", "\n", " Delta H (last 2 iters) Pass An-Ab Eq Test Put2008? Delta_An Delta_Ab \\\n", "0 0.000002 Low T: Yes 0.090851 0.269262 \n", "\n", " Delta_Or Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An SiO2_Plag \\\n", "0 0.028042 0.522217 0.27087 0.00046 0.65105 57.3 \n", "\n", " TiO2_Plag Al2O3_Plag FeOt_Plag MnO_Plag MgO_Plag CaO_Plag Na2O_Plag \\\n", "0 0.09 26.6 0.43 0 0.03 8.83 6.11 \n", "\n", " K2O_Plag Cr2O3_Plag Si_Plag_cat_prop Mg_Plag_cat_prop \\\n", "0 0.49 0.0 0.95366 0.000744 \n", "\n", " Fet_Plag_cat_prop Ca_Plag_cat_prop Al_Plag_cat_prop Na_Plag_cat_prop \\\n", "0 0.005985 0.157461 0.521768 0.197164 \n", "\n", " K_Plag_cat_prop Mn_Plag_cat_prop Ti_Plag_cat_prop Cr_Plag_cat_prop \\\n", "0 0.010404 0.0 0.001127 0.0 \n", "\n", " sum Si_Plag_cat_frac Mg_Plag_cat_frac Fet_Plag_cat_frac \\\n", "0 1.848313 0.515962 0.000403 0.003238 \n", "\n", " Ca_Plag_cat_frac Al_Plag_cat_frac Na_Plag_cat_frac K_Plag_cat_frac \\\n", "0 0.085192 0.282294 0.106672 0.005629 \n", "\n", " Mn_Plag_cat_frac Ti_Plag_cat_frac Cr_Plag_cat_frac An_Plag Ab_Plag \\\n", "0 0.0 0.00061 0.0 0.431366 0.540133 \n", "\n", " Or_Plag SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq \\\n", "0 0.028501 51 0.48 19 5.3 0.1 4.5 \n", "\n", " CaO_Liq Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3FeT_Liq \\\n", "0 9 4.2 0.1 0.11 0.11 5 0.1 \n", "\n", " SiO2_Liq_mol_frac MgO_Liq_mol_frac MnO_Liq_mol_frac FeOt_Liq_mol_frac \\\n", "0 0.58185 0.076535 0.000966 0.050568 \n", "\n", " CaO_Liq_mol_frac Al2O3_Liq_mol_frac Na2O_Liq_mol_frac K2O_Liq_mol_frac \\\n", "0 0.110016 0.127738 0.046452 0.000728 \n", "\n", " TiO2_Liq_mol_frac P2O5_Liq_mol_frac Cr2O3_Liq_mol_frac Si_Liq_cat_frac \\\n", "0 0.004119 0.000531 0.000496 0.494793 \n", "\n", " Mg_Liq_cat_frac Mn_Liq_cat_frac Fet_Liq_cat_frac Ca_Liq_cat_frac \\\n", "0 0.065084 0.000822 0.043002 0.093555 \n", "\n", " Al_Liq_cat_frac Na_Liq_cat_frac K_Liq_cat_frac Ti_Liq_cat_frac \\\n", "0 0.217252 0.079004 0.001238 0.003503 \n", "\n", " P_Liq_cat_frac Cr_Liq_cat_frac Mg_Number_Liq_Fe3 Mg_Number_Liq_NoFe3 \\\n", "0 0.000904 0.000844 0.602144 0.602144 \n", "\n", " P T \n", "0 10 1217.044901 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Temp_H2O=pt.calculate_fspar_liq_temp_hygr(plag_comps=PlagT, liq_comps=LiqT, equationT=\"T_Put2008_eq24a\",\n", " equationH=\"H_Put2005_eqH\", iterations=10, P=10)\n", "Temp_H2O['T_H_calc']" ] }, { "cell_type": "code", "execution_count": 6, "id": "61ddede5-7328-412e-8b27-18408f00cc8b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1295.359719\n", "dtype: float64" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T_PL_eq23_5kbar=pt.calculate_fspar_liq_temp(plag_comps=PlagT, liq_comps=LiqT, equationT=\"T_Put2008_eq23\", P=5)\n", "T_PL_eq23_5kbar.head()" ] }, { "cell_type": "code", "execution_count": 7, "id": "2d312b1d-b32c-4dc9-a328-a11699b4e217", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1236.008231\n", "dtype: float64" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T_PL_eq23_5kbar=pt.calculate_fspar_liq_temp(plag_comps=PlagT, liq_comps=LiqT2, equationT=\"T_Put2008_eq24a\", P=5)\n", "T_PL_eq23_5kbar.head()" ] }, { "cell_type": "code", "execution_count": 8, "id": "e27e6dfb-bd68-4cc6-a7fa-127e98dd4e7a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1483.297388\n", "dtype: float64" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T_PL_eq23_5kbar=pt.calculate_fspar_liq_temp(plag_comps=PlagT, liq_comps=LiqT, equationT=\"T_Put2008_eq24a\", P=5, H2O_Liq=0)\n", "T_PL_eq23_5kbar.head()" ] }, { "cell_type": "code", "execution_count": 9, "id": "e4f96b2a-2617-4a1f-9642-940668371611", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1207.9736462073308" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_temp(kspar_comps=KsparT, liq_comps=LiqT2, \n", " equationT=\"T_Put2008_eq24b\", P=5, H2O_Liq=0)[0]" ] }, { "cell_type": "code", "execution_count": 10, "id": "7e029a7a-d705-411b-aed7-d850619ecf07", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1207.9736462073308" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_temp(kspar_comps=KsparT, liq_comps=LiqT2, \n", " equationT=\"T_Put2008_eq24b\", P=5)[0]" ] }, { "cell_type": "code", "execution_count": 11, "id": "06d8e92a-b2d6-4782-89a7-b4791172836f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 -7.199104\n", "dtype: float64" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_press(plag_comps=PlagT, liq_comps=LiqT, \n", " equationP=\"P_Put2008_eq25\", T=1000)" ] }, { "cell_type": "code", "execution_count": 12, "id": "d5d0b35f-ef0d-418b-bd69-0ddcc95f4284", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
P_kbar_calcT_K_calcDelta_P_kbar_IterDelta_T_K_Iter
07.0055881319.7696690.00.0
\n", "
" ], "text/plain": [ " P_kbar_calc T_K_calc Delta_P_kbar_Iter Delta_T_K_Iter\n", "0 7.005588 1319.769669 0.0 0.0" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_press_temp(plag_comps=PlagT, liq_comps=LiqT, \n", " equationP=\"P_Put2008_eq25\", equationT=\"T_Put2008_eq24a\")" ] }, { "cell_type": "code", "execution_count": 10, "id": "eabb3382-31e6-4aad-a847-1ac93650ffe2", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Pass An-Ab Eq Test Put2008?H2O_calcDelta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnAn_PlagAb_PlagSiO2_PlagTiO2_PlagAl2O3_PlagFeOt_PlagMnO_PlagMgO_PlagCaO_PlagNa2O_PlagK2O_PlagCr2O3_PlagSiO2_Plag_cat_propMgO_Plag_cat_propFeOt_Plag_cat_propCaO_Plag_cat_propAl2O3_Plag_cat_propNa2O_Plag_cat_propK2O_Plag_cat_propMnO_Plag_cat_propTiO2_Plag_cat_propCr2O3_Plag_cat_propsumSiO2_Plag_cat_fracMgO_Plag_cat_fracFeOt_Plag_cat_fracCaO_Plag_cat_fracAl2O3_Plag_cat_fracNa2O_Plag_cat_fracK2O_Plag_cat_fracMnO_Plag_cat_fracTiO2_Plag_cat_fracCr2O3_Plag_cat_fracOr_PlagSiO2_LiqTiO2_LiqAl2O3_LiqFeOt_LiqMnO_LiqMgO_LiqCaO_LiqNa2O_LiqK2O_LiqCr2O3_LiqP2O5_LiqH2O_LiqFe3FeT_LiqSiO2_Liq_mol_fracMgO_Liq_mol_fracMnO_Liq_mol_fracFeOt_Liq_mol_fracCaO_Liq_mol_fracAl2O3_Liq_mol_fracNa2O_Liq_mol_fracK2O_Liq_mol_fracTiO2_Liq_mol_fracP2O5_Liq_mol_fracCr2O3_Liq_mol_fracAl2O3_Liq_mol_frac_v2
0Low T: Yes5.1484490.3337780.3848820.0278370.7651440.1552510.0006650.651050.4313660.54013357.30.0926.60.4300.038.836.110.490.00.953660.0007440.0059850.1574610.5217680.1971640.0104040.00.0011270.01.8483130.5159620.0004030.0032380.0851920.2822940.1066720.0056290.00.000610.00.028501510.48195.30.14.594.20.10.110.1150.10.5834380.0767440.00.0507060.1103160.00.0465790.000730.004130.00.00.127357
\n", "
" ], "text/plain": [ " Pass An-Ab Eq Test Put2008? H2O_calc Delta_An Delta_Ab Delta_Or \\\n", "0 Low T: Yes 5.148449 0.333778 0.384882 0.027837 \n", "\n", " Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An An_Plag Ab_Plag \\\n", "0 0.765144 0.155251 0.000665 0.65105 0.431366 0.540133 \n", "\n", " SiO2_Plag TiO2_Plag Al2O3_Plag FeOt_Plag MnO_Plag MgO_Plag CaO_Plag \\\n", "0 57.3 0.09 26.6 0.43 0 0.03 8.83 \n", "\n", " Na2O_Plag K2O_Plag Cr2O3_Plag SiO2_Plag_cat_prop MgO_Plag_cat_prop \\\n", "0 6.11 0.49 0.0 0.95366 0.000744 \n", "\n", " FeOt_Plag_cat_prop CaO_Plag_cat_prop Al2O3_Plag_cat_prop \\\n", "0 0.005985 0.157461 0.521768 \n", "\n", " Na2O_Plag_cat_prop K2O_Plag_cat_prop MnO_Plag_cat_prop \\\n", "0 0.197164 0.010404 0.0 \n", "\n", " TiO2_Plag_cat_prop Cr2O3_Plag_cat_prop sum SiO2_Plag_cat_frac \\\n", "0 0.001127 0.0 1.848313 0.515962 \n", "\n", " MgO_Plag_cat_frac FeOt_Plag_cat_frac CaO_Plag_cat_frac \\\n", "0 0.000403 0.003238 0.085192 \n", "\n", " Al2O3_Plag_cat_frac Na2O_Plag_cat_frac K2O_Plag_cat_frac \\\n", "0 0.282294 0.106672 0.005629 \n", "\n", " MnO_Plag_cat_frac TiO2_Plag_cat_frac Cr2O3_Plag_cat_frac Or_Plag \\\n", "0 0.0 0.00061 0.0 0.028501 \n", "\n", " SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq CaO_Liq \\\n", "0 51 0.48 19 5.3 0.1 4.5 9 \n", "\n", " Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3FeT_Liq \\\n", "0 4.2 0.1 0.11 0.11 5 0.1 \n", "\n", " SiO2_Liq_mol_frac MgO_Liq_mol_frac MnO_Liq_mol_frac FeOt_Liq_mol_frac \\\n", "0 0.583438 0.076744 0.0 0.050706 \n", "\n", " CaO_Liq_mol_frac Al2O3_Liq_mol_frac Na2O_Liq_mol_frac K2O_Liq_mol_frac \\\n", "0 0.110316 0.0 0.046579 0.00073 \n", "\n", " TiO2_Liq_mol_frac P2O5_Liq_mol_frac Cr2O3_Liq_mol_frac \\\n", "0 0.00413 0.0 0.0 \n", "\n", " Al2O3_Liq_mol_frac_v2 \n", "0 0.127357 " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_hygr(liq_comps=LiqT, plag_comps=PlagT, equationH=\"H_Waters2015\", T=1000+273.15, P=1)" ] }, { "cell_type": "code", "execution_count": 11, "id": "7e8cd3d9-cfce-4e87-9350-fb4b9d75c39b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Pass An-Ab Eq Test Put2008?H2O_calcDelta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnAnAb
0Low T: Yes5.2894770.2651440.2447490.0006650.7651440.1552510.0006650.4159580.50.4
\n", "
" ], "text/plain": [ " Pass An-Ab Eq Test Put2008? H2O_calc Delta_An Delta_Ab Delta_Or \\\n", "0 Low T: Yes 5.289477 0.265144 0.244749 0.000665 \n", "\n", " Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An An Ab \n", "0 0.765144 0.155251 0.000665 0.415958 0.5 0.4 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_hygr(liq_comps=LiqT, XAn=0.5, XAb=0.4, equationH=\"H_Waters2015\", T=1000+273.15, P=1)" ] }, { "cell_type": "code", "execution_count": 12, "id": "a9b9f846-65d5-4be7-9a65-175403610b59", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
H2O_calcPass An-Ab Eq Test Put2008?Delta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnSiO2_PlagTiO2_PlagAl2O3_PlagFeOt_PlagMnO_PlagMgO_PlagCaO_PlagNa2O_PlagK2O_PlagCr2O3_PlagSiO2_Plag_cat_propMgO_Plag_cat_propFeOt_Plag_cat_propCaO_Plag_cat_propAl2O3_Plag_cat_propNa2O_Plag_cat_propK2O_Plag_cat_propMnO_Plag_cat_propTiO2_Plag_cat_propCr2O3_Plag_cat_propsumSiO2_Plag_cat_fracMgO_Plag_cat_fracFeOt_Plag_cat_fracCaO_Plag_cat_fracAl2O3_Plag_cat_fracNa2O_Plag_cat_fracK2O_Plag_cat_fracMnO_Plag_cat_fracTiO2_Plag_cat_fracCr2O3_Plag_cat_fracAn_PlagAb_PlagOr_PlagSiO2_LiqTiO2_LiqAl2O3_LiqFeOt_LiqMnO_LiqMgO_LiqCaO_LiqNa2O_LiqK2O_LiqCr2O3_LiqP2O5_LiqH2O_LiqFe3FeT_LiqSiO2_Liq_mol_fracMgO_Liq_mol_fracMnO_Liq_mol_fracFeOt_Liq_mol_fracCaO_Liq_mol_fracAl2O3_Liq_mol_fracNa2O_Liq_mol_fracK2O_Liq_mol_fracTiO2_Liq_mol_fracP2O5_Liq_mol_fracCr2O3_Liq_mol_fracSiO2_Liq_cat_fracMgO_Liq_cat_fracMnO_Liq_cat_fracFeOt_Liq_cat_fracCaO_Liq_cat_fracAl2O3_Liq_cat_fracNa2O_Liq_cat_fracK2O_Liq_cat_fracTiO2_Liq_cat_fracP2O5_Liq_cat_fracCr2O3_Liq_cat_fracFeO_Liq_cat_fracMg_Number_Liq_NoFe3Mg_Number_Liq_Fe3PT
09.646943Low T: Yes0.3337780.3848820.0278370.7651440.1552510.0006650.6510557.30.0926.60.4300.038.836.110.490.00.953660.0007440.0059850.1574610.5217680.1971640.0104040.00.0011270.01.8483130.5159620.0004030.0032380.0851920.2822940.1066720.0056290.00.000610.00.4313660.5401330.028501510.48195.30.14.594.20.10.110.1150.10.581850.0765350.0009660.0505680.1100160.1277380.0464520.0007280.0041190.0005310.0004960.4947930.0650840.0008220.0430020.0935550.2172520.0790040.0012380.0035030.0009040.0008440.0387020.6021440.62709311273.15
\n", "
" ], "text/plain": [ " H2O_calc Pass An-Ab Eq Test Put2008? Delta_An Delta_Ab Delta_Or \\\n", "0 9.646943 Low T: Yes 0.333778 0.384882 0.027837 \n", "\n", " Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An SiO2_Plag TiO2_Plag \\\n", "0 0.765144 0.155251 0.000665 0.65105 57.3 0.09 \n", "\n", " Al2O3_Plag FeOt_Plag MnO_Plag MgO_Plag CaO_Plag Na2O_Plag K2O_Plag \\\n", "0 26.6 0.43 0 0.03 8.83 6.11 0.49 \n", "\n", " Cr2O3_Plag SiO2_Plag_cat_prop MgO_Plag_cat_prop FeOt_Plag_cat_prop \\\n", "0 0.0 0.95366 0.000744 0.005985 \n", "\n", " CaO_Plag_cat_prop Al2O3_Plag_cat_prop Na2O_Plag_cat_prop \\\n", "0 0.157461 0.521768 0.197164 \n", "\n", " K2O_Plag_cat_prop MnO_Plag_cat_prop TiO2_Plag_cat_prop \\\n", "0 0.010404 0.0 0.001127 \n", "\n", " Cr2O3_Plag_cat_prop sum SiO2_Plag_cat_frac MgO_Plag_cat_frac \\\n", "0 0.0 1.848313 0.515962 0.000403 \n", "\n", " FeOt_Plag_cat_frac CaO_Plag_cat_frac Al2O3_Plag_cat_frac \\\n", "0 0.003238 0.085192 0.282294 \n", "\n", " Na2O_Plag_cat_frac K2O_Plag_cat_frac MnO_Plag_cat_frac \\\n", "0 0.106672 0.005629 0.0 \n", "\n", " TiO2_Plag_cat_frac Cr2O3_Plag_cat_frac An_Plag Ab_Plag Or_Plag \\\n", "0 0.00061 0.0 0.431366 0.540133 0.028501 \n", "\n", " SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq CaO_Liq \\\n", "0 51 0.48 19 5.3 0.1 4.5 9 \n", "\n", " Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3FeT_Liq \\\n", "0 4.2 0.1 0.11 0.11 5 0.1 \n", "\n", " SiO2_Liq_mol_frac MgO_Liq_mol_frac MnO_Liq_mol_frac FeOt_Liq_mol_frac \\\n", "0 0.58185 0.076535 0.000966 0.050568 \n", "\n", " CaO_Liq_mol_frac Al2O3_Liq_mol_frac Na2O_Liq_mol_frac K2O_Liq_mol_frac \\\n", "0 0.110016 0.127738 0.046452 0.000728 \n", "\n", " TiO2_Liq_mol_frac P2O5_Liq_mol_frac Cr2O3_Liq_mol_frac \\\n", "0 0.004119 0.000531 0.000496 \n", "\n", " SiO2_Liq_cat_frac MgO_Liq_cat_frac MnO_Liq_cat_frac FeOt_Liq_cat_frac \\\n", "0 0.494793 0.065084 0.000822 0.043002 \n", "\n", " CaO_Liq_cat_frac Al2O3_Liq_cat_frac Na2O_Liq_cat_frac K2O_Liq_cat_frac \\\n", "0 0.093555 0.217252 0.079004 0.001238 \n", "\n", " TiO2_Liq_cat_frac P2O5_Liq_cat_frac Cr2O3_Liq_cat_frac FeO_Liq_cat_frac \\\n", "0 0.003503 0.000904 0.000844 0.038702 \n", "\n", " Mg_Number_Liq_NoFe3 Mg_Number_Liq_Fe3 P T \n", "0 0.602144 0.627093 1 1273.15 " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_hygr(liq_comps=LiqT, plag_comps=PlagT, equationH=\"H_Put2005_eqH\", T=1000+273.15, P=1)" ] }, { "cell_type": "code", "execution_count": 13, "id": "586d74c5-94c7-4eb3-a883-784706c82041", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
H2O_calcPass An-Ab Eq Test Put2008?Delta_AnDelta_AbDelta_OrPred_An_EqEPred_Ab_EqFPred_Or_EqGObs_Kd_Ab_AnSiO2_PlagTiO2_PlagAl2O3_PlagFeOt_PlagMnO_PlagMgO_PlagCaO_PlagNa2O_PlagK2O_PlagCr2O3_PlagSiO2_Plag_cat_propMgO_Plag_cat_propFeOt_Plag_cat_propCaO_Plag_cat_propAl2O3_Plag_cat_propNa2O_Plag_cat_propK2O_Plag_cat_propMnO_Plag_cat_propTiO2_Plag_cat_propCr2O3_Plag_cat_propsumSiO2_Plag_cat_fracMgO_Plag_cat_fracFeOt_Plag_cat_fracCaO_Plag_cat_fracAl2O3_Plag_cat_fracNa2O_Plag_cat_fracK2O_Plag_cat_fracMnO_Plag_cat_fracTiO2_Plag_cat_fracCr2O3_Plag_cat_fracAn_PlagAb_PlagOr_PlagSiO2_LiqTiO2_LiqAl2O3_LiqFeOt_LiqMnO_LiqMgO_LiqCaO_LiqNa2O_LiqK2O_LiqCr2O3_LiqP2O5_LiqH2O_LiqFe3FeT_LiqSiO2_Liq_mol_fracMgO_Liq_mol_fracMnO_Liq_mol_fracFeOt_Liq_mol_fracCaO_Liq_mol_fracAl2O3_Liq_mol_fracNa2O_Liq_mol_fracK2O_Liq_mol_fracTiO2_Liq_mol_fracP2O5_Liq_mol_fracCr2O3_Liq_mol_fracSiO2_Liq_cat_fracMgO_Liq_cat_fracMnO_Liq_cat_fracFeOt_Liq_cat_fracCaO_Liq_cat_fracAl2O3_Liq_cat_fracNa2O_Liq_cat_fracK2O_Liq_cat_fracTiO2_Liq_cat_fracP2O5_Liq_cat_fracCr2O3_Liq_cat_fracFeO_Liq_cat_fracMg_Number_Liq_NoFe3Mg_Number_Liq_Fe3PT
09.646943Low T: Yes0.3337780.3848820.0278370.7651440.1552510.0006650.6510557.30.0926.60.4300.038.836.110.490.00.953660.0007440.0059850.1574610.5217680.1971640.0104040.00.0011270.01.8483130.5159620.0004030.0032380.0851920.2822940.1066720.0056290.00.000610.00.4313660.5401330.028501510.48195.30.14.594.20.10.110.1150.10.581850.0765350.0009660.0505680.1100160.1277380.0464520.0007280.0041190.0005310.0004960.4947930.0650840.0008220.0430020.0935550.2172520.0790040.0012380.0035030.0009040.0008440.0387020.6021440.62709311273.15
\n", "
" ], "text/plain": [ " H2O_calc Pass An-Ab Eq Test Put2008? Delta_An Delta_Ab Delta_Or \\\n", "0 9.646943 Low T: Yes 0.333778 0.384882 0.027837 \n", "\n", " Pred_An_EqE Pred_Ab_EqF Pred_Or_EqG Obs_Kd_Ab_An SiO2_Plag TiO2_Plag \\\n", "0 0.765144 0.155251 0.000665 0.65105 57.3 0.09 \n", "\n", " Al2O3_Plag FeOt_Plag MnO_Plag MgO_Plag CaO_Plag Na2O_Plag K2O_Plag \\\n", "0 26.6 0.43 0 0.03 8.83 6.11 0.49 \n", "\n", " Cr2O3_Plag SiO2_Plag_cat_prop MgO_Plag_cat_prop FeOt_Plag_cat_prop \\\n", "0 0.0 0.95366 0.000744 0.005985 \n", "\n", " CaO_Plag_cat_prop Al2O3_Plag_cat_prop Na2O_Plag_cat_prop \\\n", "0 0.157461 0.521768 0.197164 \n", "\n", " K2O_Plag_cat_prop MnO_Plag_cat_prop TiO2_Plag_cat_prop \\\n", "0 0.010404 0.0 0.001127 \n", "\n", " Cr2O3_Plag_cat_prop sum SiO2_Plag_cat_frac MgO_Plag_cat_frac \\\n", "0 0.0 1.848313 0.515962 0.000403 \n", "\n", " FeOt_Plag_cat_frac CaO_Plag_cat_frac Al2O3_Plag_cat_frac \\\n", "0 0.003238 0.085192 0.282294 \n", "\n", " Na2O_Plag_cat_frac K2O_Plag_cat_frac MnO_Plag_cat_frac \\\n", "0 0.106672 0.005629 0.0 \n", "\n", " TiO2_Plag_cat_frac Cr2O3_Plag_cat_frac An_Plag Ab_Plag Or_Plag \\\n", "0 0.00061 0.0 0.431366 0.540133 0.028501 \n", "\n", " SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq CaO_Liq \\\n", "0 51 0.48 19 5.3 0.1 4.5 9 \n", "\n", " Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3FeT_Liq \\\n", "0 4.2 0.1 0.11 0.11 5 0.1 \n", "\n", " SiO2_Liq_mol_frac MgO_Liq_mol_frac MnO_Liq_mol_frac FeOt_Liq_mol_frac \\\n", "0 0.58185 0.076535 0.000966 0.050568 \n", "\n", " CaO_Liq_mol_frac Al2O3_Liq_mol_frac Na2O_Liq_mol_frac K2O_Liq_mol_frac \\\n", "0 0.110016 0.127738 0.046452 0.000728 \n", "\n", " TiO2_Liq_mol_frac P2O5_Liq_mol_frac Cr2O3_Liq_mol_frac \\\n", "0 0.004119 0.000531 0.000496 \n", "\n", " SiO2_Liq_cat_frac MgO_Liq_cat_frac MnO_Liq_cat_frac FeOt_Liq_cat_frac \\\n", "0 0.494793 0.065084 0.000822 0.043002 \n", "\n", " CaO_Liq_cat_frac Al2O3_Liq_cat_frac Na2O_Liq_cat_frac K2O_Liq_cat_frac \\\n", "0 0.093555 0.217252 0.079004 0.001238 \n", "\n", " TiO2_Liq_cat_frac P2O5_Liq_cat_frac Cr2O3_Liq_cat_frac FeO_Liq_cat_frac \\\n", "0 0.003503 0.000904 0.000844 0.038702 \n", "\n", " Mg_Number_Liq_NoFe3 Mg_Number_Liq_Fe3 P T \n", "0 0.602144 0.627093 1 1273.15 " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_hygr(liq_comps=LiqT, plag_comps=PlagT, equationH=\"H_Put2005_eqH\", T=1000+273.15, P=1)" ] }, { "cell_type": "code", "execution_count": 14, "id": "6d8aa932-3c28-462a-a95a-430ea7ea0640", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.6510495841937365" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pt.calculate_fspar_liq_hygr(liq_comps=LiqT, \n", " plag_comps=PlagT, equationH=\"H_Put2005_eqH\", T=1000+273.15, P=1).Obs_Kd_Ab_An[0]" ] }, { "cell_type": "code", "execution_count": 15, "id": "ec582638-616c-40f9-9368-3e5c35c230c7", "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "even if the equation doesnt require a P to be enteredbecause you have selected eq tests, you need to enter a P", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m pt.calculate_fspar_liq_hygr(liq_comps=LiqT, \n\u001b[0m\u001b[0;32m 2\u001b[0m plag_comps=PlagT, equationH=\"H_Put2005_eqH\", T=1000+273.15).Obs_Kd_Ab_An[0]\n", "\u001b[1;32m~\\OneDrive - Oregon State University\\Postdoc\\PyMME\\MyBarometers\\Thermobar_outer\\Thermobar\\feldspar.py\u001b[0m in \u001b[0;36mcalculate_fspar_liq_hygr\u001b[1;34m(liq_comps, plag_comps, kspar_comps, equationH, P, T, XAn, XAb, XOr)\u001b[0m\n\u001b[0;32m 717\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mequationH\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"H_Put2008_eq25b\"\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mequationH\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"H_Put2005_eqH\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 718\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mP\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 719\u001b[1;33m raise TypeError('even if the equation doesnt require a P to be entered'\n\u001b[0m\u001b[0;32m 720\u001b[0m 'because you have selected eq tests, you need to enter a P')\n\u001b[0;32m 721\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mplag_comps\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mTypeError\u001b[0m: even if the equation doesnt require a P to be enteredbecause you have selected eq tests, you need to enter a P" ] } ], "source": [ "pt.calculate_fspar_liq_hygr(liq_comps=LiqT, \n", " plag_comps=PlagT, equationH=\"H_Put2005_eqH\", T=1000+273.15).Obs_Kd_Ab_An[0]" ] }, { "cell_type": "code", "execution_count": null, "id": "bb2d1e36-dfa5-4965-a0c2-ac83822492b9", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }