A switching pressure approach in simulation and optimization of a reverse osmosis unit