In recent years, cogeneration systems have been considered to increase the efficiency and optimal use of energy sources for the production of electrical energy and heat energy. Electricity and heat energy cogeneration systems can achieve up to 70% efficiency, and at the realistic and subsidized rates of energy carriers, the beneficiaries of these systems supply the demand and supply sectors. In this study, the optimal working point of a system consisting of several independent units, capable of trading electricity, based on the consumption of various fuels, and utilization of storage tank was determined using genetic algorithm, and modeling accuracy were compared. Other references have also been made. The simulation results show that in the temperate seasons and summer, the cogeneration system meets all electrical and thermal requirements during the 22-23 hours due to the high electricity grid rate and at the end of 24 hours, the total cogeneration cost For almost all seasons 50% less than the conventional production system. It has also been shown that the use of absorption chillers has improved the ratio of electrical and heat loads, and the efficiency of the cogeneration system has increased compared to the previous state, and the heat energy loss has also decreased.