Modelling, simulation and control of a class of hybrid dynamic systems: using hybrid automaton, APROS and mixed integer quadratic optimisation algorithm. (7th June 2019)