calculate_hardness function

Calculate hardness from calcium and magnesium

Calculate hardness from calcium and magnesium

This function takes Ca and Mg in mg/L and returns hardness in mg/L as CaCO3

calculate_hardness(ca, mg, type = "total", startunit = "mg/L")

Arguments

  • ca: Calcium concentration in mg/L as Ca
  • mg: Magnesium concentration in mg/L as Mg
  • type: "total" returns total hardness, "ca" returns calcium hardness. Defaults to "total"
  • startunit: Units of Ca and Mg. Defaults to mg/L

Returns

A numeric value for the total hardness in mg/L as CaCO3.

Examples

calculate_hardness(50, 10) water_defined <- define_water(7, 20, 50, 100, 80, 10, 10, 10, 10, tot_po4 = 1) calculate_hardness(water_defined@ca, water_defined@mg, "total", "M")
  • Maintainer: Sierra Johnson
  • License: Apache License (>= 2) | MIT + file LICENSE
  • Last published: 2025-01-22