# ๐งช 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**](https://phcal.ericxin.eu/doc/doc.pdf)
๐ Prefer the online version? [**Click here**](https://phcal.ericxin.eu)
## Usage Examples
### Example 1: Calculation of 0.01 M HCl
**Charge Balance Equation (CBE) Calculation**
```python
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**
```python
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**
```python
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**
```python
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](mailto:me@ericxin.eu).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "phcal",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": "pH, MBE, CBE, PBE, Analytical Chemistry, Chemistry",
"author": null,
"author_email": "Eric Yuelai Xin <me@eric.xin>",
"download_url": "https://files.pythonhosted.org/packages/df/92/79e578b0ff4ae8bae33438330a65f4606577f4557e0ef3a7fafbe454fad4/phcal-0.1.0.tar.gz",
"platform": null,
"description": "# \ud83e\uddea PHCAL: pH Calculation \ud83e\udd16\n### Comprehensive Analysis of Acid-Base Equilibria Using MBE, CBE, and PBE\n\nThis 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.\n\n\ud83d\udcc4 Want to read the paper? [**Click here**](https://phcal.ericxin.eu/doc/doc.pdf)\n\n\ud83c\udf10 Prefer the online version? [**Click here**](https://phcal.ericxin.eu)\n\n## Usage Examples\n\n### Example 1: Calculation of 0.01 M HCl\n\n**Charge Balance Equation (CBE) Calculation**\n\n```python\nfrom phcal import CBE_Inert, CBE_calc\n\nHCl = CBE_Inert(charge=-1, conc=0.01)\npH = CBE_calc(HCl)\npH.pH_calc()\n\nprint(pH.pH)\n```\n\n**Proton Balance Equation (PBE) Calculation**\n\n```python\nfrom phcal import PBE_Inert, PBE_calc\nHCl = PBE_Inert(conc=0.01, proton=1, proton_ref=1)\n# HCl = PBE_Acid(conc=0.01, Ka=100000, proton=1, proton_ref=1)\ncalc = PBE_calc(HCl)\ncalc.pH_calc()\nprint(calc.pH)\n```\n\n### Example 2: Calculation of 0.01 M (NH4)2(HPO4)\n\n**Charge Balance Equation (CBE) Calculation**\n```python\nfrom phcal import CBE_Acid, CBE_calc\nNH4 = CBE_Acid(charge=1, conc=0.01*3, pKa=9.25)\npKa = [1.97, 6.82, 12.5]\nP = CBE_Acid(charge=0, conc=0.01, pKa=pKa)\n\npH = CBE_calc(NH4, P)\npH.pH_calc()\n\nprint(pH.pH)\n```\n\n**Proton Balance Equation (PBE) Calculation**\n```python\nfrom phcal import PBE_Acid, PBE_calc\n\nNH4 = PBE_Acid(conc=0.01 * 3, pKa=9.25, proton=1, proton_ref=1)\npKa = [1.97, 6.82, 12.5]\nP = PBE_Acid(conc=0.01, pKa=pKa, proton=3, proton_ref=0)\ncalc = PBE_calc(NH4, P)\ncalc.pH_calc()\n\nprint(calc.pH)\n```\n\n## Contact\n\nIf you have any questions or suggestions, please feel free to contact me at [me@ericxin.eu](mailto:me@ericxin.eu).\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "LICENSE",
"summary": "pH calculation based on MBE, CBE and PBE",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://phcal.ericxin.eu/doc/doc.pdf",
"Homepage": "https://github.com/Eric-xin/pH_Calculation",
"Issues": "https://github.com/Eric-xin/pH_Calculation/issues"
},
"split_keywords": [
"ph",
" mbe",
" cbe",
" pbe",
" analytical chemistry",
" chemistry"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e62e3f0ae93fe59aef1e5f478d52738dc8faea0e93628850cc5c590c6b47e13e",
"md5": "519170cfe9b9c72fc310b9fe228cad6e",
"sha256": "536e67f93351daa4f7c6a0c2ef17655eac74d7dfcca39fda257d335c5020427e"
},
"downloads": -1,
"filename": "phcal-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "519170cfe9b9c72fc310b9fe228cad6e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 6249,
"upload_time": "2024-11-03T12:38:53",
"upload_time_iso_8601": "2024-11-03T12:38:53.746822Z",
"url": "https://files.pythonhosted.org/packages/e6/2e/3f0ae93fe59aef1e5f478d52738dc8faea0e93628850cc5c590c6b47e13e/phcal-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "df9279e578b0ff4ae8bae33438330a65f4606577f4557e0ef3a7fafbe454fad4",
"md5": "3099a75783f2ae6ebbd2dd27888ddee9",
"sha256": "ccc48ef1a2893b8476d8b232cab998957ff7e6da94fd234f65a8fb0f819bc415"
},
"downloads": -1,
"filename": "phcal-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3099a75783f2ae6ebbd2dd27888ddee9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 5091,
"upload_time": "2024-11-03T12:38:55",
"upload_time_iso_8601": "2024-11-03T12:38:55.105825Z",
"url": "https://files.pythonhosted.org/packages/df/92/79e578b0ff4ae8bae33438330a65f4606577f4557e0ef3a7fafbe454fad4/phcal-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-03 12:38:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Eric-xin",
"github_project": "pH_Calculation",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "phcal"
}