On solving hybrid optimal control problems with higher index DAEs. (4th July 2017)