A switched dynamical system approach towards the optimal control of chemical processes based on a gradient-based parallel optimization algorithm. (4th October 2018)