System model development with ill-conditioned data: case studies of trihalomethane formation in drinking water