Optimization of chilled water systems