Demo of functions available in pyCHNOSZ version 0.8.2 (October 15, 2021)
from pyCHNOSZ import info, water, entropy, zc, mass, retrieve, add_OBIGT, mod_OBIGT, reset, subcrt
from pyCHNOSZ import basis, species, equilibrate, affinity, diagram, solubility
from pyCHNOSZ import ratlab, syslab, animation, univariant_TP, seq2aa, add_protein
import pandas as pd # for mod_OBIGT demo
info("Fe+2")
[526]
info(526)
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a1 | a2 | a3 | a4 | c1 | c2 | omega | Z | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
526 | Fe+2 | Fe+2 | Fe+2 | aq | SSWS97 | None | 1997-11-13 | cal | -21870.0 | -22050.0 | ... | -7.9 | -22.2 | -0.07867 | -969.69 | 9.5479 | -23780.0 | 14.786 | -46437.0 | 143820.0 | 2.0 |
1 rows × 21 columns
info(info(["HCO3-", "CH4"], state=["aq", "gas"]))
info.numeric: Cp of methane(gas) is NA; set by EOS parameters to 8.54 cal K-1 mol-1
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a1.a | a2.b | a3.c | a4.d | c1.e | c2.f | omega.lambda | z.T | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | HCO3- | HCO3- | HCO3- | aq | SH88 | None | 1997-11-06 | cal | -140282.0 | -164898.0 | ... | -8.460000 | 24.6 | 0.75621 | 115.05000 | 1.2346 | -28266.0 | 12.9395 | -47579.0 | 127330.0 | -1.0 |
2628 | methane | CH4 | CH4 | gas | WEP+82 | Kel60 | 1987-12-15 | cal | -12122.4 | -17880.0 | ... | 8.543362 | 0.0 | 5.65000 | 0.01144 | -46000.0000 | 0.0 | 0.0000 | 0.0 | 0.0 | 1500.0 |
2 rows × 21 columns
water("rho", T=300, P=1000) # get density of water, kg m^3
rho | |
---|---|
1 | 1037.156246 |
water("DEW") # set to the Deep Earth Water (DEW) model
water("epsilon", T=750, P=50000) # get dielectric constant of water (dimensionless)
water: setting water model to DEW
epsilon | |
---|---|
1 | 41.80474 |
water("SUPCRT92") # reset water model back to SUPCRT92
water: setting water model to SUPCRT92
# get entropy from the elements
entropy("CH3CH2COO-") # cal/(mol K)
146.84799235181652
# get the average oxidation state of carbon
zc("CH3CH2COO-") # unitless
-0.6666666666666666
# get molecular weight
mass("CH3CH2COO-") # g/mol
73.0715
# get OBIGT indices of crystalline and aqueous species in the Mn-O-H system
retrieved_list = retrieve("Mn", ["O", "H"], state=["cr", "aq"])
retrieved_list
[438, 447, 524, 525, 617, 618, 619, 620, 2043, 2044, 2045, 2046, 2047, 2048]
# look up retrieved species
info(retrieved_list)
checkGHS: G of MnO(aq) differs by -7264 cal mol-1 from tabulated value checkEOS: V of MnO2-2(aq) differs by -1.05 cm3 mol-1 from tabulated value checkGHS: G of Mn(OH)2(cr) differs by -304 J mol-1 from tabulated value
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a1.a | a2.b | a3.c | a4.d | c1.e | c2.f | omega.lambda | z.T | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
438 | MnO4- | MnO4- | MnO4- | aq | SSWS97 | None | 1997-11-07 | cal | -107600.0 | -129900.0 | ... | -1.80 | 42.000 | 0.78248 | 1132.770000 | 1.291200e+00 | -32472.00 | 13.631700 | -34012.0 | 92480.0 | -1.0 |
447 | Mn+2 | Mn+2 | Mn+2 | aq | SSWS97 | None | 1997-11-07 | cal | -55100.0 | -52900.0 | ... | -4.10 | -17.100 | -0.01015 | -800.400000 | 8.840000e+00 | -24480.00 | 16.667200 | -38697.0 | 140060.0 | 2.0 |
524 | Mn+3 | Mn+3 | Mn+3 | aq | SSWS97 | None | 1997-11-13 | cal | -20300.0 | -30700.0 | ... | -25.60 | -41.000 | -0.29320 | -1493.400000 | 1.160410e+01 | -21615.00 | 16.061100 | -82492.0 | 270250.0 | 3.0 |
525 | MnO4-2 | MnO4-2 | MnO4-2 | aq | SSWS97 | None | 1997-11-13 | cal | -120400.0 | -156600.0 | ... | -66.40 | 21.100 | 0.56596 | 603.680000 | 3.378600e+00 | -30285.00 | -5.291000 | -165602.0 | 298030.0 | -2.0 |
617 | MnOH+ | MnOH+ | MnOH+ | aq | SSWS97 | None | 1997-11-13 | cal | -97300.0 | -106800.0 | ... | 8.70 | -11.900 | 0.03213 | -699.010000 | 8.482100e+00 | -24899.00 | 16.299400 | -12623.0 | 54640.0 | 1.0 |
618 | MnO | MnO | MnO | aq | SSWS97 | None | 1997-11-13 | cal | -81500.0 | -99100.0 | ... | -12.70 | -13.100 | -0.00376 | -786.560000 | 8.822900e+00 | -24537.00 | -1.552800 | -56215.0 | -3000.0 | 0.0 |
619 | HMnO2- | HMnO2- | HMnO2- | aq | SSWS97 | None | 1997-11-13 | cal | -121000.0 | -149900.0 | ... | -3.30 | -9.700 | 0.10354 | -524.800000 | 7.800300e+00 | -25619.00 | 20.525500 | -37067.0 | 176850.0 | -1.0 |
620 | MnO2-2 | MnO2-2 | MnO2-2 | aq | SSWS97 | None | 1997-11-13 | cal | -102600.0 | -133300.0 | ... | -71.50 | -13.000 | 0.11489 | -497.130000 | 7.693700e+00 | -25734.00 | -4.037500 | -175991.0 | 344080.0 | 0.0 |
2043 | manganosite | Mng | MnO | cr | RH95 | None | 2020-08-15 | J | -362900.0 | -385200.0 | ... | 44.10 | 13.220 | 60.28000 | 0.003510 | 0.000000e+00 | -297.50 | 0.000000 | 0.0 | 0.0 | 2000.0 |
2044 | pyrolusite | None | MnO2 | cr | RH95 | None | 2020-08-15 | J | -465000.0 | -520000.0 | ... | 54.76 | 16.610 | 290.40000 | -0.144200 | 2.012000e+06 | -3787.00 | 0.000045 | 0.0 | 0.0 | 850.0 |
2045 | bixbyite | None | Mn2O3 | cr | RH95 | None | 2020-08-15 | J | -882100.0 | -959000.0 | ... | 101.81 | 31.370 | 162.40000 | 0.012110 | 1.046000e+06 | -1317.00 | 0.000003 | 0.0 | 0.0 | 1400.0 |
2046 | hausmannite | None | Mn3O4 | cr | RH95 | None | 2020-08-15 | J | -1282500.0 | -1384500.0 | ... | 142.02 | 46.950 | -7.43200 | 0.094870 | -6.712000e+06 | 3396.00 | 0.000000 | 0.0 | 0.0 | 1400.0 |
2047 | manganese | None | Mn | cr | RH95 | None | 2020-08-15 | J | 0.0 | 0.0 | ... | 26.19 | 7.354 | 0.00000 | 0.041345 | -2.721700e+05 | 313.29 | -0.000014 | 0.0 | 0.0 | 980.0 |
2048 | Mn(OH)2 | None | Mn(OH)2 | cr | WEP+82.1 | SUF+98 | 2020-08-15 | J | -615000.0 | -695400.0 | ... | 114.70 | NaN | 139.61000 | -0.085250 | 0.000000e+00 | 0.00 | 0.000000 | 0.0 | 0.0 | 700.0 |
14 rows × 21 columns
# retrieve Si-containing minerals from the Mg-Si-Ca-O-H system
info(retrieve(("Mg", "Si", "Ca", "O", "H"), must_have="Si", state="cr"), messages=False)
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a | b | c | d | e | f | lambda | T | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2535 | akermanite | Ak | Ca2MgSi2O7 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2542 | anthophyllite | Ath | Mg7Si8O24H2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2543 | antigorite | Atg | Mg48Si34O99H62O48 | cr | Ber88 | BDat17.1 | 2017-10-09 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2547 | chrysotile | Ctl | Mg3Si2O9H4 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2555 | diopside | Di | MgCaSi2O6 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2557 | enstatite,clino | Cen | MgSiO3 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2558 | enstatite | En | MgSiO3 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2559 | enstatite,proto | pEn | MgSiO3 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2562 | forsterite | Fo | Mg2SiO4 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2576 | merwinite | Mw | Ca3MgSi2O8 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2577 | monticellite | Mtc | CaMgSiO4 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2594 | talc | Tlc | Mg3Si4O12H2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2595 | tremolite | Tr | Ca2Mg5Si8O24H2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2549 | coesite | Coe | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2552 | cristobalite,alpha | aCrs | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2553 | cristobalite,beta | bCrs | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2588 | quartz | Qz | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2589 | quartz,beta | bQz | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2596 | tridymite,high | hTrd | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2597 | tridymite,low | lTrd | SiO2 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2598 | wollastonite | Wo | CaSiO3 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2599 | pseudowollastonite | pWo | CaSiO3 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
22 rows × 21 columns
info(info(["K-feldspar", "kaolinite"]))
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a | b | c | d | e | f | lambda | T | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2582 | K-feldspar | Kfs | KAlSi3O8 | cr | Ber88 | SHD91 | 2017-10-03 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2568 | kaolinite | Kln | Al2Si2O9H4 | cr | Ber88 | None | 2017-10-01 | cal | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2 rows × 21 columns
_ = add_OBIGT("SUPCRT92")
add.OBIGT: read 177 rows; made 65 replacements, 112 additions [energy units: cal]
info(info(["K-feldspar", "kaolinite"]))
info.numeric: Cp of K-feldspar(cr) is NA; set by EOS parameters to 44.22 cal K-1 mol-1 info.numeric: Cp of kaolinite(cr) is NA; set by EOS parameters to 57.27 cal K-1 mol-1
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a | b | c | d | e | f | lambda | T | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2582 | K-feldspar | K-Fs | K(AlSi3)O8 | cr | HDNB78 | None | 1978-05-05 | cal | -895374.0 | -949188.0 | ... | 44.215918 | 108.87 | 76.617 | 0.004311 | -2994500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1400.0 |
2568 | kaolinite | Kln | Al2Si2O5(OH)4 | cr | HDNB78 | None | 1978-05-05 | cal | -905614.0 | -982221.0 | ... | 57.267215 | 99.52 | 72.770 | 0.029200 | -2152000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
2 rows × 21 columns
reset()
reset: resetting "thermo" object OBIGT: loading default database with 1903 aqueous, 3443 total species
mod_OBIGT("HCO3-", G = -140283.7, Cp = -9)
mod.OBIGT: updated HCO3-(aq)
[13]
info(13)
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a1 | a2 | a3 | a4 | c1 | c2 | omega | Z | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | HCO3- | HCO3- | HCO3- | aq | SH88 | None | 1997-11-06 | cal | -140283.7 | -164898.0 | ... | -9.0 | 24.6 | 0.75621 | 115.05 | 1.2346 | -28266.0 | 12.9395 | -47579.0 | 127330.0 | -1.0 |
1 rows × 21 columns
reset()
reset: resetting "thermo" object OBIGT: loading default database with 1903 aqueous, 3443 total species
mod_OBIGT()
also accepts a Pandas dataframe containing one or more entries in the OBIGT-format.
df = pd.DataFrame({
'name':["triglycerol", "diglycerol"],
'abbrv':["C9H20O7", "C6H14O5"],
'formula':["C9H20O7", "C6H14O5"],
'state':["aq", "aq"],
'ref1':["demo", "demo"],
'ref2':["", ""],
'date':["2021-2-7", "2021-2-7"],
'E_units':["J", "J"],
'G':[-1027210.0, -767130.0],
'H':[-1528690.0, -1112720.0],
'S':[394.5, 303.0],
'Cp':[585.3, 433.8],
'V':[193.1, 135.1],
'a1.a':[212.4, 138.3],
'a2.b':[-14.8, 16.3],
'a3.c':[-37.0, 45.6],
'a4.d':[-13.8, -28.1],
'c1.e':[813.5, 588.5],
'c2.f':[-106.5, -71.6],
'omega.lambda':[1.2668, 0.991],
'z.T':[0, 0]})
df
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a1.a | a2.b | a3.c | a4.d | c1.e | c2.f | omega.lambda | z.T | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | triglycerol | C9H20O7 | C9H20O7 | aq | demo | 2021-2-7 | J | -1027210.0 | -1528690.0 | ... | 585.3 | 193.1 | 212.4 | -14.8 | -37.0 | -13.8 | 813.5 | -106.5 | 1.2668 | 0 | |
1 | diglycerol | C6H14O5 | C6H14O5 | aq | demo | 2021-2-7 | J | -767130.0 | -1112720.0 | ... | 433.8 | 135.1 | 138.3 | 16.3 | 45.6 | -28.1 | 588.5 | -71.6 | 0.9910 | 0 |
2 rows × 21 columns
mod_OBIGT(df)
mod.OBIGT: added triglycerol(aq) with energy units of J mod.OBIGT: added diglycerol(aq) with energy units of J
[3444, 3445]
info([3444, 3445])
name | abbrv | formula | state | ref1 | ref2 | date | E_units | G | H | ... | Cp | V | a1 | a2 | a3 | a4 | c1 | c2 | omega | Z | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3444 | triglycerol | C9H20O7 | C9H20O7 | aq | demo | 2021-2-7 | J | -1027210.0 | -1528690.0 | ... | 585.3 | 193.1 | 21.24 | -1480.0 | -37.0 | -138000.0 | 813.5 | -1065000.0 | 126680.0 | 0.0 | |
3445 | diglycerol | C6H14O5 | C6H14O5 | aq | demo | 2021-2-7 | J | -767130.0 | -1112720.0 | ... | 433.8 | 135.1 | 13.83 | 1630.0 | 45.6 | -281000.0 | 588.5 | -716000.0 | 99100.0 | 0.0 |
2 rows × 21 columns
reset()
reset: resetting "thermo" object OBIGT: loading default database with 1903 aqueous, 3443 total species
output = subcrt([13, 24])
subcrt: 2 species at 15 values of T (ºC) and P (bar) (wet) [energy units: cal]
name | formula | state | ispecies | |
---|---|---|---|---|
13 | HCO3- | HCO3- | aq | 13.0 |
24 | SO4-2 | SO4-2 | aq | 24.0 |
HCO3-:
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 0.01 | 1.000000 | 0.999829 | 111.754350 | -139681.473815 | -164549.882789 | 24.758605 | 21.179738 | -23.269536 |
2 | 25.00 | 1.000000 | 0.997061 | 102.827640 | -140282.000000 | -164898.000000 | 23.530000 | 24.210873 | -8.329074 |
3 | 50.00 | 1.000000 | 0.988030 | 95.265656 | -140863.278012 | -165055.703179 | 23.020406 | 25.204970 | -5.163872 |
4 | 75.00 | 1.000000 | 0.974864 | 88.783080 | -141434.015984 | -165183.296646 | 22.640209 | 25.265864 | -5.399977 |
5 | 100.00 | 1.013220 | 0.958393 | 83.163313 | -141994.817523 | -165339.818722 | 22.206802 | 24.657922 | -7.369166 |
6 | 125.00 | 2.320144 | 0.939073 | 78.242020 | -142542.392121 | -165562.342298 | 21.628832 | 23.391221 | -10.794383 |
7 | 150.00 | 4.757169 | 0.917058 | 73.893161 | -143072.398342 | -165888.091858 | 20.833690 | 21.330562 | -15.831192 |
8 | 175.00 | 8.918049 | 0.892343 | 70.017793 | -143578.392686 | -166360.479732 | 19.746474 | 18.211021 | -23.075412 |
9 | 200.00 | 15.536499 | 0.864743 | 66.536881 | -144051.754733 | -167057.267529 | 18.230913 | 13.490831 | -34.873415 |
10 | 225.00 | 25.478603 | 0.833873 | 63.385415 | -144479.669460 | -168131.551570 | 16.018443 | 5.856849 | -54.966071 |
11 | 250.00 | 39.736493 | 0.799072 | 60.507951 | -144842.477214 | -169838.767539 | 12.683129 | -7.542827 | -89.705310 |
12 | 275.00 | 59.431251 | 0.759236 | 57.855147 | -145110.448174 | -172610.125578 | 7.537703 | -32.630502 | -153.572276 |
13 | 300.00 | 85.837843 | 0.712408 | 55.379862 | -145237.055965 | -177364.431311 | -0.865229 | -83.198400 | -295.564460 |
14 | 325.00 | 120.457572 | 0.654577 | 53.027050 | -145132.554408 | -187150.992487 | -17.365157 | -204.338305 | -768.193195 |
15 | 350.00 | 165.211289 | 0.574688 | 50.685725 | -144522.520570 | -219261.892550 | -69.177409 | -685.421882 | -4196.298541 |
SO4-2:
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 0.01 | 1.000000 | 0.999829 | 142.200245 | -177735.718840 | -215289.445479 | 11.926887 | 7.811069 | -118.435160 |
2 | 25.00 | 1.000000 | 0.997061 | 130.423875 | -177930.000000 | -217400.000000 | 4.500000 | 12.917649 | -63.597213 |
3 | 50.00 | 1.000000 | 0.988030 | 120.370218 | -177983.800105 | -218781.778157 | 0.042386 | 14.242434 | -49.986868 |
4 | 75.00 | 1.000000 | 0.974864 | 111.698475 | -177938.904196 | -219991.866485 | -3.565381 | 13.732272 | -47.998648 |
5 | 100.00 | 1.013220 | 0.958393 | 104.137734 | -177806.992390 | -221226.267533 | -6.988075 | 11.798014 | -51.485603 |
6 | 125.00 | 2.320144 | 0.939073 | 97.478713 | -177588.064892 | -222597.489689 | -10.543136 | 8.372073 | -59.025420 |
7 | 150.00 | 4.757169 | 0.917058 | 91.558560 | -177276.253319 | -224202.306731 | -14.449671 | 3.096372 | -70.473737 |
8 | 175.00 | 8.918049 | 0.892343 | 86.248419 | -176860.892040 | -226139.667657 | -18.893452 | -4.637371 | -86.758634 |
9 | 200.00 | 15.536499 | 0.864743 | 81.444358 | -176326.309161 | -228589.397416 | -24.202501 | -16.079392 | -113.729688 |
10 | 225.00 | 25.478603 | 0.833873 | 77.058909 | -175646.806473 | -231919.180364 | -31.036232 | -34.500274 | -159.944759 |
11 | 250.00 | 39.736493 | 0.799072 | 73.014700 | -174780.830978 | -236709.392510 | -40.364879 | -67.086153 | -237.781320 |
12 | 275.00 | 59.431251 | 0.759236 | 69.240287 | -173666.297223 | -243824.867418 | -53.538074 | -128.181517 | -372.037796 |
13 | 300.00 | 85.837843 | 0.712408 | 65.665886 | -172212.777304 | -254891.649888 | -73.047540 | -248.798537 | -646.015032 |
14 | 325.00 | 120.457572 | 0.654577 | 62.207131 | -170258.006987 | -275276.492274 | -107.342323 | -523.250556 | -1494.724117 |
15 | 350.00 | 165.211289 | 0.574688 | 58.674324 | -167300.779435 | -334129.399058 | -202.225699 | -1528.115660 | -6775.178543 |
output["species"]
name | formula | state | ispecies | |
---|---|---|---|---|
13 | HCO3- | HCO3- | aq | 13.0 |
24 | SO4-2 | SO4-2 | aq | 24.0 |
output["out"]["HCO3-"].head()
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 0.01 | 1.00000 | 0.999829 | 111.754350 | -139681.473815 | -164549.882789 | 24.758605 | 21.179738 | -23.269536 |
2 | 25.00 | 1.00000 | 0.997061 | 102.827640 | -140282.000000 | -164898.000000 | 23.530000 | 24.210873 | -8.329074 |
3 | 50.00 | 1.00000 | 0.988030 | 95.265656 | -140863.278012 | -165055.703179 | 23.020406 | 25.204970 | -5.163872 |
4 | 75.00 | 1.00000 | 0.974864 | 88.783080 | -141434.015984 | -165183.296646 | 22.640209 | 25.265864 | -5.399977 |
5 | 100.00 | 1.01322 | 0.958393 | 83.163313 | -141994.817523 | -165339.818722 | 22.206802 | 24.657922 | -7.369166 |
output["out"]["SO4-2"].head()
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 0.01 | 1.00000 | 0.999829 | 142.200245 | -177735.718840 | -215289.445479 | 11.926887 | 7.811069 | -118.435160 |
2 | 25.00 | 1.00000 | 0.997061 | 130.423875 | -177930.000000 | -217400.000000 | 4.500000 | 12.917649 | -63.597213 |
3 | 50.00 | 1.00000 | 0.988030 | 120.370218 | -177983.800105 | -218781.778157 | 0.042386 | 14.242434 | -49.986868 |
4 | 75.00 | 1.00000 | 0.974864 | 111.698475 | -177938.904196 | -219991.866485 | -3.565381 | 13.732272 | -47.998648 |
5 | 100.00 | 1.01322 | 0.958393 | 104.137734 | -177806.992390 | -221226.267533 | -6.988075 | 11.798014 | -51.485603 |
output = subcrt(species=["H2", "O2", "H2O"],
coeff = [-1.0, -0.5, 1.0],
state = ["aq", "gas", "liq"],
T=[30, 50], P=1000)
subcrt: 3 species at 2 values of T (ºC) and P (bar) (wet) [energy units: cal]
coeff | name | formula | state | ispecies | |
---|---|---|---|---|---|
62 | -1.0 | H2 | H2 | aq | 62.0 |
2637 | -0.5 | oxygen | O2 | gas | 2637.0 |
1 | 1.0 | water | H2O | liq | 1.0 |
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 30.0 | 1000 | 1.035962 | 43.972483 | -60995.224481 | -67334.946053 | -21.070030 | -7.663664 | -24.488829 |
2 | 50.0 | 1000 | 1.027403 | 40.952949 | -60554.525428 | -67908.486770 | -22.904593 | -8.086124 | -21.219328 |
output["reaction"]
coeff | name | formula | state | ispecies | |
---|---|---|---|---|---|
62 | -1.0 | H2 | H2 | aq | 62.0 |
2637 | -0.5 | oxygen | O2 | gas | 2637.0 |
1 | 1.0 | water | H2O | liq | 1.0 |
output["out"]
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 30.0 | 1000 | 1.035962 | 43.972483 | -60995.224481 | -67334.946053 | -21.070030 | -7.663664 | -24.488829 |
2 | 50.0 | 1000 | 1.027403 | 40.952949 | -60554.525428 | -67908.486770 | -22.904593 | -8.086124 | -21.219328 |
info("LYSC_CHICK")
output = subcrt("LYSC_CHICK", T=[25, 50, 75, 100])
protein.OBIGT: found LYSC_CHICK (C613H959N193O185S10, 129 residues) subcrt: 1 species at 4 values of T (ºC) and P (bar) (wet) [energy units: cal]
name | formula | state | ispecies | |
---|---|---|---|---|
3444 | LYSC_CHICK | C613H959N193O185S10 | aq | 3444.0 |
LYSC_CHICK:
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 25.0 | 1.00000 | 0.997061 | 3250.232004 | -4.434110e+06 | -1.057328e+07 | 4337.860000 | 10420.950081 | 6415.518468 |
2 | 50.0 | 1.00000 | 0.988030 | 3076.734742 | -4.549372e+06 | -1.040345e+07 | 4884.505798 | 10600.231211 | 7073.981185 |
3 | 75.0 | 1.00000 | 0.974864 | 2936.711074 | -4.678266e+06 | -1.022241e+07 | 5423.991680 | 10708.145189 | 7376.581257 |
4 | 100.0 | 1.01322 | 0.958393 | 2823.196483 | -4.820386e+06 | -1.003568e+07 | 5941.891731 | 10782.933049 | 7548.444290 |
output["out"]["LYSC_CHICK"]
T | P | rho | logK | G | H | S | V | Cp | |
---|---|---|---|---|---|---|---|---|---|
1 | 25.0 | 1.00000 | 0.997061 | 3250.232004 | -4.434110e+06 | -1.057328e+07 | 4337.860000 | 10420.950081 | 6415.518468 |
2 | 50.0 | 1.00000 | 0.988030 | 3076.734742 | -4.549372e+06 | -1.040345e+07 | 4884.505798 | 10600.231211 | 7073.981185 |
3 | 75.0 | 1.00000 | 0.974864 | 2936.711074 | -4.678266e+06 | -1.022241e+07 | 5423.991680 | 10708.145189 | 7376.581257 |
4 | 100.0 | 1.01322 | 0.958393 | 2823.196483 | -4.820386e+06 | -1.003568e+07 | 5941.891731 | 10782.933049 | 7548.444290 |
basis("CHNOSe")
C | H | N | O | S | Z | ispecies | logact | state | |
---|---|---|---|---|---|---|---|---|---|
CO2 | 1.0 | 0.0 | 0.0 | 2.0 | 0.0 | 0.0 | 1519 | -3.0 | aq |
H2O | 0.0 | 2.0 | 0.0 | 1.0 | 0.0 | 0.0 | 1 | 0.0 | liq |
NH3 | 0.0 | 3.0 | 1.0 | 0.0 | 0.0 | 0.0 | 64 | -4.0 | aq |
H2S | 0.0 | 2.0 | 0.0 | 0.0 | 1.0 | 0.0 | 65 | -7.0 | aq |
e- | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | -1.0 | 2 | -7.0 | aq |
H+ | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 3 | -7.0 | aq |
species(["CO2", "HCO3-", "CO3-2"])
CO2 | H2O | NH3 | H2S | e- | H+ | ispecies | logact | state | name | |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1519 | -3.0 | aq | CO2 |
2 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | -1.0 | 13 | -3.0 | aq | HCO3- |
3 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | -2.0 | 14 | -3.0 | aq | CO3-2 |
a = affinity(pH=[2,14])
affinity: temperature is 25 ºC affinity: pressure is Psat affinity: variable 1 is pH at 256 values from 2 to 14 subcrt: 9 species at 25 ºC and 1 bar (wet) [energy units: cal]
e = equilibrate(a)
balance: on moles of CO2 in formation reactions equilibrate: n.balance is 1 1 1 equilibrate: loga.balance is -2.52287874528034 equilibrate: using boltzmann method
# interactive activity diagram
_ = diagram(e, main="Carbonate speciation", width=500, height=400, interactive=True)
balance: on moles of CO2 in formation reactions equilibrate: n.balance is 1 1 1 equilibrate: loga.balance is -2.52287874528034 equilibrate: using boltzmann method
# static activity diagram that will be added upon
plot, args1 = diagram(e, names=["","",""], col="blue", main="Carbonate speciation", width=500, height=400)
# adding lines to a static diagram...
a = affinity(pH=[2,14], T=90)
e = equilibrate(a)
plot2, args2 = diagram(e, names=["","",""], col="orange", add=args1, width=500, height=400)
affinity: temperature is 90 ºC affinity: pressure is Psat affinity: variable 1 is pH at 256 values from 2 to 14 subcrt: 9 species at 90 ºC and 1 bar (wet) [energy units: cal] balance: on moles of CO2 in formation reactions equilibrate: n.balance is 1 1 1 equilibrate: loga.balance is -2.52287874528034 equilibrate: using boltzmann method
# adding more lines to a static diagram...
a = affinity(pH=[2,14], T=180)
e = equilibrate(a)
plot2, args3 = diagram(e, add=[args1, args2], col="red", col_names="blue", dy=-2, width=500, height=400)
affinity: temperature is 180 ºC affinity: pressure is Psat affinity: variable 1 is pH at 256 values from 2 to 14 subcrt: 9 species at 180 ºC and 10.02 bar (wet) [energy units: cal] balance: on moles of CO2 in formation reactions equilibrate: n.balance is 1 1 1 equilibrate: loga.balance is -2.52287874528034 equilibrate: using boltzmann method
# a static predominance diagram
a = affinity(pH=[2, 14, 600], T=[0, 350, 600])
plot, args = diagram(a, width=500, height=400)
affinity: pressure is Psat affinity: variable 1 is pH at 600 values from 2 to 14 affinity: variable 2 is T at 600 values from 273.15 to 623.15 K subcrt: 9 species at 600 values of T (ºC) and P (bar) (wet) [energy units: cal]
balance: on moles of CO2 in formation reactions diagram: using maximum affinity method for 2-D diagram
# an interactive predominance diagram
a = affinity(pH=[2, 14, 100], T=[0, 350, 100])
_ = diagram(a, width=500, height=400, interactive=True)
affinity: pressure is Psat affinity: variable 1 is pH at 100 values from 2 to 14 affinity: variable 2 is T at 100 values from 273.15 to 623.15 K subcrt: 9 species at 100 values of T (ºC) and P (bar) (wet) [energy units: cal] balance: on moles of CO2 in formation reactions equilibrate: n.balance is 1 1 1 equilibrate: loga.balance is -2.52287874528034 equilibrate: using boltzmann method
# make a static plot of corundum solubility
add_OBIGT("SLOP98")
basis(["Al+3", "H2O", "H+", "O2"])
species("corundum")
iaq = ["Al+3", "AlO2-", "AlOH+2", "AlO+", "HAlO2"]
s = solubility(iaq, pH=[0, 10], IS=0, in_terms_of="Al+3")
plot1, args1 = diagram(s, ptype="loga.balance", ylim = [-10, 0], lwd=4, col="green3")
_ = diagram(s, add=args1, adj=[0, 1, 2.1, -0.2, -1.5], dy=[0, 0, 4, -0.3, 0.1])
add.OBIGT: read 172 rows; made 43 replacements, 129 additions [energy units: cal] solubility: calculating for corundum balance: on moles of Al2O3 in formation reactions
# combine basis(), species(), retrieve(), affinity(), and diagram()
# to plot the H2O-CaO-MgO-SiO2 system with Berman minerals containing Si
reset()
basis(species=["SiO2", "Ca+2", "Mg+2", "H2O", "O2", "H+"],
state=["aq", "aq", "aq", "liq", "aq", "aq"], messages=False)
species(retrieve(("Mg", "O", "H", "Si", "Ca"), must_have="Si", state="cr"), messages=False)
a = affinity(**{"Mg+2" : [4, 10, 100], "Ca+2" : [5, 15, 100], "T" : 300, "P" : 1000}, messages=False)
_ = diagram(a, xlab = ratlab("Mg+2"), ylab = ratlab("Ca+2"), fill = "viridis", interactive=True,
annotation_coords=[1, 0], annotation="T=300 °C<br>P=1000 bar",
main=syslab(["H2O", "CaO", "MgO", "SiO2"])+"<br>minerals from Berman 1988",
width=500, height=400, messages=False)
reset: resetting "thermo" object OBIGT: loading default database with 1903 aqueous, 3443 total species
# create an animated version of the same plot
# with temperature as the animating variable (100 to 350 degrees C)
basis_args = {"species": ["SiO2", "Ca+2", "Mg+2", "H2O", "O2", "H+"],
"state": ["aq", "aq", "aq", "liq", "aq", "aq"]}
species_args = {"species": retrieve(("Mg", "O", "H", "Si", "Ca"), must_have="Si", state="cr")}
affinity_args = {"Mg+2" : [4, 10, 100], "Ca+2" : [5, 15, 100], "P" : 1000}
diagram_args = {"width":500, "height":400, "xlab":ratlab("Mg+2"), "ylab":ratlab("Ca+2"),
"main":syslab(["H2O", "CaO", "MgO", "SiO2"])+"<br>minerals from Berman 1988",
"annotation_coords":[1, 0], "annotation":"P=1000 bar"}
animation(
basis_args=basis_args,
species_args=species_args,
affinity_args=affinity_args,
diagram_args=diagram_args,
anim_var='T',
anim_range=[100, 350, 6],
messages=False,
)
out = univariant_TP(logK=[-8, -6, -4, -3, -2], # desired logK or list of logK values
species=["K-feldspar", "kaolinite", "H2O", "SiO2", "muscovite"], # chemical species
state=["cr", "cr", "liq", "aq", "cr"], # aq, gas, liq, cr
coeff=[-1, -1, 1, 2, 1], # reaction stoichiometry (negative for reactants, positive for products)
Trange=[0, 350], # temperature range to check, degrees C
Prange=[1, 5000], # pressure range to check, bars
width=700, # plot width, in pixels
)
# predict thermodynamic properties of various aqueous
# RUBISCO peptide chains based on amino acid sequences
# pea plant RUBISCO (length 489 amino acids)
RBCMT_PEA = seq2aa("RBCMT_PEA",
"""
matifsggsvspflfhtnkgtsftpkapilhlkrsfsaksvasvgtepslspavqtfwkw
lqeegvitaktpvkasvvteglglvalkdisrndvilqvpkrlwinpdavaaseigrvcs
elkpwlsvilflirersredsvwkhyfgilpqetdstiywseeelqelqgsqllkttvsv
keyvkneclkleqeiilpnkrlfpdpvtlddffwafgilrsrafsrlrnenlvvvpmadl
inhsagvttedhayevkgaaglfswdylfslksplsvkageqvyiqydlnksnaelaldy
gfiepnenrhaytltleisesdpffddkldvaesngfaqtayfdifynrtlppgllpylr
lvalggtdaflleslfrdtiwghlelsvsrdneellckavreacksalagyhttieqdre
lkegnldsrlaiavgiregekmvlqqidgifeqkeleldqleyyqerrlkdlglcgengd
ilgdlgkff
""")
# thermophilic cyanobacteria RUBISCO (length 475 amino acids)
A3KFC6_THEVL = seq2aa("A3KFC6_THEVL",
"""
MAYTQSKSQK VGYQAGVKDY RLTYYTPDYT PKDTDILAAF RVTPQPGVPF
EEAAAAVAAE SSTGTWTTVW TDLLTDLDRY KGRCYDIEPL PGEDNQFIAY
IAYPLDLFEE GSVTNMLTSI VGNVFGFKAL KALRLEDLRI PVAYLKTFQG
PPHGIQVERD KLNKYGRPLL GCTIKPKLGL SAKNYGRAVY ECLRGGLDFT
KDDENINSQP FQRWRDRFLF VADAIHKAQA ETGEIKGHYL NVTAPTCEEM
LKRAEFAKEL EMPIIMHDFL TAGFTANTTL SKWCRDNGML LHIHRAMHAV
MDRQKNHGIH FRVLAKCLRM SGGDHIHTGT VVGKLEGDKA VTLGFVDLLR
ENYIEQDRSR GIYFTQDWAS MPGVMAVASG GIHVWHMPAL VDIFGDDAVL
QFGGGTLGHP WGNAPGATAN RVALEACIQA RNEGRDLMRE GGDIIREAAR
WSPELAAACE LWKEIKFEFE AQDTI
""")
# marine cyanobacteria RUBISCO (length 475 amino acids)
RBL_SYNP6 = seq2aa("RBL_SYNP6",
"""
MPKTQSAAGY KAGVKDYKLT YYTPDYTPKD TDLLAAFRFS PQPGVPADEA
GAAIAAESST GTWTTVWTDL LTDMDRYKGK CYHIEPVQGE ENSYFAFIAY
PLDLFEEGSV TNILTSIVGN VFGFKAIRSL RLEDIRFPVA LVKTFQGPPH
GIQVERDLLN KYGRPMLGCT IKPKLGLSAK NYGRAVYECL RGGLDFTKDD
ENINSQPFQR WRDRFLFVAD AIHKSQAETG EIKGHYLNVT APTCEEMMKR
AEFAKELGMP IIMHDFLTAG FTANTTLAKW CRDNGVLLHI HRAMHAVIDR
QRNHGIHFRV LAKCLRLSGG DHLHSGTVVG KLEGDKASTL GFVDLMREDH
IEADRSRGVF FTQDWASMPG VLPVASGGIH VWHMPALVEI FGDDSVLQFG
GGTLGHPWGN APGATANRVA LEACVQARNE GRDLYREGGD ILREAGKWSP
ELAAALDLWK EIKFEFETMD KL
""")
df_protein = RBCMT_PEA.append(A3KFC6_THEVL).append(RBL_SYNP6)
# load predicted thermodynamic data for amino acid sequences
# into the OBIGT database
ip = add_protein(df_protein)
add.protein: added 3 new protein(s) to thermo()$protein
basis("CHNOSe")
a = affinity(iprotein=ip, Eh=[-1, 0.5])
_ = diagram(a, main= "Predicted speciation of\nvarious RUBISCOs at pH 7",
names=["pea plant", "thermo cyano", "marine cyano"],
width=500, height=500, alpha=True)
affinity: temperature is 25 ºC affinity: pressure is Psat affinity: variable 1 is Eh at 256 values from -1 to 0.5 V subcrt: 27 species at 25 ºC and 1 bar (wet) [energy units: cal] subcrt: 18 species at 25 ºC and 1 bar (wet) [energy units: cal]
balance: on protein length diagram: plotting A/(2.303RT) / n.balance