generate_titration_curve
Draws pH-versus-titrant-volume curves for weak or polyprotic acids with strong base, marking equivalence and buffer points and optional indicator transition ranges.
Instructions
Draw a titration curve: weak (or polyprotic) acid vs. strong base.
Computes pH against titrant volume from the exact charge balance and marks equivalence points (per protolysis step), the buffer points (pH = pKa at half-equivalence) and optionally the indicator transition range as a shaded band.
Use this when the user asks about titrations, equivalence points, buffer regions or indicator choice. YOU supply the substance data from your knowledge: pKa values in ascending order, sensible concentrations (0.1 M is the classic teaching case) and the indicator's transition range.
Not this tool for: which species dominates at a given pH, or the degree of ionization across the pH range (use generate_species_distribution). A single pH value as a number is not drawn — that is calculate_ph, which solves the same charge balance and shows the working; this tool only draws.
Args: substance: Display name, e.g. "Acetic acid with NaOH" (localizable). pka_values: pKa per protolysis step, ascending (1-3 values). c_acid: Acid concentration in mol/L. v_acid_ml: Initial acid volume in mL. c_titrant: Titrant (strong base) concentration in mol/L. indicator: Optional {"name": "...", "ph_range": [low, high]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| c_acid | Yes | ||
| c_titrant | Yes | ||
| indicator | No | ||
| substance | Yes | ||
| v_acid_ml | Yes | ||
| pka_values | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | ||
| name | Yes | ||
| type | No | plot | |
| files | No | ||
| notes | No | ||
| subtitle | No |