The main research paper focuses on the optimal hybrid system using HOMER software in the central plant of Hassi R’mel. Indeed, the system is composed of PV panels, a battery bank, and a diesel engine, all of which are used to supply an industrial load. Hence, the present work proposes a solution to optimize the power generated by the power sources, maximize the photovoltaic source use, and minimize the use of the battery bank and the diesel generator. Moreover, the solution aims to guarantee the safe operation of the system components and continuity in the load power supply. These objectives are performed by the minimization of a cost function, in which the power generation cost, the energetic balance, and the environmental parameters are taken into consideration. Among the five solutions, the most optimal system obtained is PV/Diesel/batteries /Grid. This system consists of 1200 KW PV, an 1100 KW diesel generator, 800 units of battery, and an 1100 KW converter. Therefore, to supply the station with 49% of electricity by PV and 51% by diesel while the reduction of emissions is 60%, and 708020 liters of diesel is saved. Applying the sensitivity analysis also showed that renewable resources have an impact on the sizing of PV. When solar radiation increases, the size of renewable energy decreases and the NPC decreases as well. It can, thus, be illustrated that the PV/diesel/battery system is not fully-optimal. This strategy is recommended for industrial system security since it can be used to ensure systems from an energetic and economic point of view.