TDS computation