Modeling Flexibility In Integrated Power And Gas Networks For Sustainable Energy Systems