generate_species_distribution
Plot acid–base species fractions against pH from pKa values to identify the dominant protonation state, degree of ionization, and likely membrane absorption at any pH.
Instructions
Draw the species distribution of an acid over pH (Henderson-Hasselbalch).
Plots the fraction α of every protonation species against pH with the pKa values marked — the standard diagram for absorption/distribution reasoning in pharmacy.
Use this when the user asks which species dominates at a given pH, about degree of ionization, or absorption across membranes. YOU supply pKa values (ascending) from your knowledge; pass species labels (formulas like "H₂PO₄⁻") for a readable legend.
Not this tool for: pH against added titrant volume, equivalence points or indicator choice (use generate_titration_curve). It answers "which species when", not "what pH do I have" — the pH of a solution or buffer, or the ionised fraction at one pH, as a number is calculate_ph.
Args: substance: Display name, e.g. "Phosphoric acid" (localizable). pka_values: pKa per protolysis step, ascending. labels: Optional species labels, most protonated first (len = len(pka_values) + 1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labels | No | ||
| substance | Yes | ||
| pka_values | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | ||
| name | Yes | ||
| type | No | plot | |
| files | No | ||
| notes | No | ||
| subtitle | No |