Automated determination of total dissolved nitrogen in water