<jupyter_start><jupyter_text>Compute Moles 0<jupyter_code>T_cmb = T_cmb0
X_Mg_0 = 0.025
X_Si_0 = 0.025
X_O_0 = 0.15

X_Fe = 1 - X_Mg - X_Si - X_O
X_c = np.array([X_Mg, X_Si, X_Fe, X_O])
K4, _ = pl.reactions.func_KD_MgO_val(T_cmb)
K5, _ = pl.reactions.func_KD_FeO_val(T_cmb)
K6, _ = pl.reactions.func_KD_SiO2_val(X_Si, X_O, T_cmb)
X_MgO = X_Mg * X_O / K4
X_FeO = X_Fe * X_O / K5
X_SiO2 = X_Si * X_O ** 2 / K6
X_FeSiO3 = (1 - X_MgO - X_FeO - X_SiO2) / (1 + X_MgO / X_FeO)
X_MgSiO3 = 1 - X_MgO - X_FeO - X_SiO2 - X_FeSiO3
X_m = np.array([X_MgO, X_SiO2, X_FeO, X_MgSiO3, X_FeSiO3])
print(X_MgO/X_FeO, X_MgSiO3/X_FeSiO3)
pl.reactions.mantle.species
Mt = pl.reactions.mantle.Xwtot2Mtot(X_m, 1)
pl.reactions.mantle.XMtot2wtot(X_m, Mt)
M_m = pl.reactions.mantle.X2M(X_m, wt_tot=pl.params.reactions.mass_l_0)
X_MgO = M_m[0] / np.sum(M_m)
X_SiO2 = M_m[1]/ np.sum(M_m)
X_FeO = M_m[2]/ np.sum(M_m)
X_MgSiO3 = M_m[3] / np.sum(M_m)
X_FeSiO3 = M_m[4] / np.sum(M_m)

print(X_MgO/X_FeO, X_MgSiO3/X_FeSiO3)
Moles_0 = pl.reactions.compute_Moles_0(X_Mg_0, X_Si_0, X_O_0, T_cmb0)

M_c, M_m = pl.reactions.unwrap_Moles(Moles_0, return_sum=True, split_coremantle=True)
X_Mg = M_c[0] / M_c[4]
X_Si = M_c[1] / M_c[4]
X_Fe = M_c[2] / M_c[4]
X_O = M_c[3] / M_c[4]

X_MgO = M_m[0] / M_m[5]
X_FeO = M_m[1]/ M_m[5]
X_SiO2 = M_m[2]/ M_m[5]
X_MgSiO3 = M_m[3] / M_m[5]
X_FeSiO3 = M_m[4] / M_m[5]

K1 = X_MgO * X_SiO2 / X_MgSiO3
K2 = X_FeO * X_SiO2 / X_FeSiO3
K3 = X_FeO * X_MgSiO3 / (X_MgO * X_FeSiO3)
K4 = X_Mg * X_O / X_MgO
K5 = X_Fe * X_O / X_FeO
K6 = X_Si * X_O ** 2 / X_SiO2
print(X_MgO/X_FeO, X_MgSiO3/X_FeSiO3)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16047087980173483, 'fraction_numerical': 0.06071871127633209, 'mean_word_length': 4.031152647975078, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '610818', 'license': 'MIT', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1031, 'n_words': 154, 'path': 'tests/Test MgSi Final Copy Working.ipynb', 'repo_name': 'nknezek/MgSi-Exsolution', 'size': '1614'}