A switched system formulation for optimal integration of scheduling and control in multi-product continuous processes