Skip to main content

pH calculation based on MBE, CBE and PBE

Project description

🧪 PHCAL: pH Calculation 🤖

Comprehensive Analysis of Acid-Base Equilibria Using MBE, CBE, and PBE

This package provides codes for the paper "Comprehensive Analysis of Acid-Base Equilibria Using MBE, CBE, and PBE". It includes tools to calculate pH values for various acid-base systems using Charge Balance Equation (CBE) and Proton Balance Equation (PBE) methods.

📄 Want to read the paper? Click here

🌐 Prefer the online version? Click here

Usage Examples

Example 1: Calculation of 0.01 M HCl

Charge Balance Equation (CBE) Calculation

from phcal import CBE_Inert, CBE_calc

HCl = CBE_Inert(charge=-1, conc=0.01)
pH = CBE_calc(HCl)
pH.pH_calc()

print(pH.pH)

Proton Balance Equation (PBE) Calculation

from phcal import PBE_Inert, PBE_calc
HCl = PBE_Inert(conc=0.01, proton=1, proton_ref=1)
# HCl = PBE_Acid(conc=0.01, Ka=100000, proton=1, proton_ref=1)
calc = PBE_calc(HCl)
calc.pH_calc()
print(calc.pH)

Example 2: Calculation of 0.01 M (NH4)2(HPO4)

Charge Balance Equation (CBE) Calculation

from phcal import CBE_Acid, CBE_calc
NH4 = CBE_Acid(charge=1, conc=0.01*3, pKa=9.25)
pKa = [1.97, 6.82, 12.5]
P = CBE_Acid(charge=0, conc=0.01, pKa=pKa)

pH = CBE_calc(NH4, P)
pH.pH_calc()

print(pH.pH)

Proton Balance Equation (PBE) Calculation

from phcal import PBE_Acid, PBE_calc

NH4 = PBE_Acid(conc=0.01 * 3, pKa=9.25, proton=1, proton_ref=1)
pKa = [1.97, 6.82, 12.5]
P = PBE_Acid(conc=0.01, pKa=pKa, proton=3, proton_ref=0)
calc = PBE_calc(NH4, P)
calc.pH_calc()

print(calc.pH)

Contact

If you have any questions or suggestions, please feel free to contact me at me@ericxin.eu.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

phcal-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

phcal-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file phcal-0.1.0.tar.gz.

File metadata

  • Download URL: phcal-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.13

File hashes

Hashes for phcal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccc48ef1a2893b8476d8b232cab998957ff7e6da94fd234f65a8fb0f819bc415
MD5 3099a75783f2ae6ebbd2dd27888ddee9
BLAKE2b-256 df9279e578b0ff4ae8bae33438330a65f4606577f4557e0ef3a7fafbe454fad4

See more details on using hashes here.

File details

Details for the file phcal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: phcal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.13

File hashes

Hashes for phcal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 536e67f93351daa4f7c6a0c2ef17655eac74d7dfcca39fda257d335c5020427e
MD5 519170cfe9b9c72fc310b9fe228cad6e
BLAKE2b-256 e62e3f0ae93fe59aef1e5f478d52738dc8faea0e93628850cc5c590c6b47e13e

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