The paper presents a hybrid power generating system for the University of Torbat Heydarieh in Iran, integrating renewable energy sources, electric batteries, and a diesel generator to minimize Total Annual Costs (TAC) and Total Carbon Dioxide Emissions (TECO2 ). The system's reliability was assessed by the Loss of Power Supply Probability. Simulation results were derived via the Simulated Annealing meta-heuristic strategy, which demonstrated a lower standard deviation compared to the Imperialist Competitive Algorithm and Artificial Bee Colony methods. The aim was to reduce TACs and ensure demand requirements were satisfied. In scenario 1, the research indicated that the integration of the four technologies (Photovoltaic, wind, battery, and diesel generator) consistently yields greater benefits in minimizing TAC. Utilizing a diesel generator could reduce expenses by minimizing the necessary number of batteries. In scenario 2, the integration of wind turbines, photovoltaic panels, and batteries was shown to optimize TECO2 while satisfying demand requirements. The integration of photovoltaic systems, wind energy, batteries, and diesel generators provide enhanced advantages in minimizing total emissions; however, batteries possess a considerable carbon footprint.