The objective of the present paper is sizing of a technically optimum and economically feasible cogeneration system to supply heating, cooling and electricity to a reference building in the city of Pisa, Italy, for different months of the year. This cogeneration system is proposed in two operational modes, sized and under-sized, so that the effect of natural gas and electricity consumption costs on the system design can be achieved. To this end, the amount of energy consumption and cost of various types of the proposed cogeneration systems based on reciprocating engines are computed and compared. Afterward, in the proposed systems, for understanding the effect of the costs of the energy carriers in different countries on the rate of payback period, a comparison is conducted on the payback period between Iran and Italy. In the end, a sensitivity analysis is performed in Iran and Italy to survey the effect of any change in the cost of investment, natural gas, and electricity on the payback period. The results indicated that although the costs of gas and electricity are comparatively lower, the payback period is longer for Iran, which can be blamed on Iran’s higher discount rate (~50%). The results of sensitivity analysis showed that if the natural gas cost in Italy equals that of Iran, there would be a 6.4% reduction in the payback period and if the electricity cost consumption in Iran is taken equivalent to the cost of electricity in Italy, a decrease of 25% will appear in the payback period.