Analysis and Design of Cyber-Physical Systems: A Hybrid Control Systems Approach