Readonlyagent: MashPhAgentOptional ReadonlyexistingAcidAdditions?: readonly AcidAddition[]Acids already in the mash, on top of which the solve happens.
Readonlygrist: readonly FermentableAddition[]ReadonlymashVolumeL: numberOptional Readonlyoptions?: MashPhOptionsReadonlytargetPh: numberReadonlywater: WaterProfile
Solve for the dose of one acid or alkali that hits a target mash pH.
We bisect on the dose and re-run predictMashPh at each step, so the answer is self-consistent: feed the returned amount back into
predictMashPhand you get the target. We prefer that to a faster method. The inner solve is a 23-step bisection on a closed-form expression, so a full outer solve is ~50 inner solves and still runs in well under a millisecond.Converges to
convergenceTolerancePh(default 1e-6 pH) ormaxIterations, whichever comes first. The upper bracket starts atINITIAL_DOSE_PER_LITRE(0.2 mL or g per liter of mash water) and doubles until the target is crossed or theMAX_DOSE_PER_LITREceiling (100 per liter) is hit. A target beyond the ceiling is reported asunreachableinstead of being clamped.