Stability of hybrid dynamic systems: Analysis and design