solvedose_ph calculates the required amount of a chemical to dose based on a target pH and existing water quality. The function takes an object of class "water" created by define_water, and user-specified chemical and target pH and returns a numeric value for the required dose in mg/L.
solvedose_ph uses uniroot on chemdose_ph to match the required dose for the requested pH target.
solvedose_ph(water, target_ph, chemical)
Arguments
water: Source water of class "water" created by define_water
target_ph: The final pH to be achieved after the specified chemical is added.
chemical: The chemical to be added. Current supported chemicals include: acids: "hcl", "h2so4", "h3po4", "co2"; bases: "naoh", "na2co3", "nahco3", "caoh2", "mgoh2"
Returns
A numeric value for the required chemical dose.
Examples
water <- define_water(ph =7, temp =25, alk =10)# Calculate required dose of lime to reach pH 8solvedose_ph(water, target_ph =8, chemical ="caoh2")