###### Abstract  
A combined heat and power (CHP) system powered by methane gas is modelled and analyzed in this study. The Thermolib MATLAB extension is used to model the system by graphically connecting the Thermolib standard components through fluid flows. An exergoenvironmental analysis is also performed using EES. The results show that, for an input thermal energy rate of 29.9 MW, the Brayton and Rankine cycles generated 9.8 MW and 7.5 MW of net power, respectively. The heat pump was also able to supply 1.4 MW as its output. The total energy efficiency of the cogeneration system was 62% with the Brayton cycle working at 33%, the Rankine cycle at 36%, and the ammonia heat pump at a coefficient of performance (COP) of 9.1. The system also achieved an overall exergy efficiency of 78%. Furthermore, the system was examined at different levels by varying input parameters such as the pressure ratio of both the Brayton cycle and the heat pump, the pressure of the steam in the Rankine cycle, and the inlet energy from the combustion chamber of the system. The exergoenvironmental modeling of the system showed that the exergy stability factor and exergetic sustainability index increased from 0.41 to 0.47 and from 0.6 to 0.64 with increasing inlet combustion energy; this can be seen as a good indicator of its stability and sustainability. c 2022  
thermodynamics and environics to assess the environmental impacts of the system in the view of thermodynamics [3]. Numerous studies have utilized exergy and exergoenvironmental analysis to examine the inefficiencies and the impact of energy systems on the environment. [PERSON] et al. [4] performed an exergy analysis in a biomass combined heat and powerplant in Jelgava, finding about 64% of exergy destruction just in the steam generator, followed by the heat exchangers of the district heating system. [PERSON] et al. [5] performed an energy and exergoenvironmental analysis on a system designed to produce multiple outputs. The results showed that the system, compared to individual systems, exhibited higher exergy efficiencies and lower environmental impacts, suggesting that multigeneration can help mitigate greenhouse gas emissions. [PERSON] et al. [6] also performed an exergy and exergoenvironmental analysis of a solar hybrid trigeneration system. Their results led to the conclusion that the solution pump and high-pressure generator are the highest sources of inefficiency in the system, and the exergoenvironmental performance of the system can be improved by enhancing the exergy efficiency of these components. [PERSON] et al. [7] performed a comparative environmental compact assessment of two separate hydrogen and cooling cogeneration systems. Indices such as the environmental impact factor, environmental impact coefficient, environmental impact index, environmental impact improvement, exergetic stability factor, and exergetic sustainability factor were used in a bid to determine which system has a more favourable impact on the environment. The electrolyzer was found to score better than the steam methane reforming hydrogen production method. Several models of powerplants with different energy sources, both conventional and renewable sources, have been designed and developed using software for powerplant simulation that can simulate the systems in both steady and dynamic states. Many researchers make use of commercial software such as Aspen Plus Dynamics, APROS (Advanced Process Simulation Software), ThermoSysPro (Modelica-based) library developed by EDF, SimECS developed by Delft University of Technology and used for dynamic simulation of energy conversion system [8], Dymola, and VMGSim. Different models of powerplants and their components have been designed and simulated by researchers with their steady and transient performance observed and analyzed. [PERSON] et al. [9] made use of APROS software in designing a simulation model of static and dynamic characteristics. The designed model is applied to the study of the start-up process in power plants. [PERSON] et al.