pH_scale.calculate_pH
pH_scale.calculate_pH(hydronium_concentration)Calculate pH scale for a given hydronium concentration.
This function computes pH value using the formula: pH = -log(hydronium concentration)
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| hydronium_concentration | The concentration of hydronium. Must be a positive number. | required |
Returns
| Name | Type | Description |
|---|---|---|
| float | The calculated pH value. Raises | |
| —— | ||
| TypeError | If any input is not numeric. | |
| ValueError | If any input is not positive. |
Examples
>>> from biomathhh.pH_scale import calculate_pH
>>> calculate_pH(1e-7)
7.0
>>> calculate_pH(6.31e-8)
7.2