Energy optimization in reverse osmosis by developing an improved system design and a novel demand response approach