Security Modeling of Cyber-Physical Systems: A Case Study of Smart Grid