This paper addresses the economic assessment of renewable energy resources in different areas of Morocco. The project was implemented to obtain the optimum size and economical cost of the hybrid system at all sites under study in order to assess the available energy sources and find the best components of the system in each region. The Cost, reliability, ecology, and availability are the criteria respected in this study taken into consideration the same power load for all cases. The PSO algorithm was chosen in the proposed research for its effectiveness and simplicity. The results show that the tidal energy is not approved in almost all regions of Morocco for its low speed. The PV/wind is the best configuration that gives a cost-effectiveness system mainly in Dakhla, which comprises the NPC $204467, COE $0.0842/kWh, LPSP 0.05%, Renewable fraction 100% and Availability of 95%. Furthermore, PV panels solar is the best component for production the energy in Morocco because of the high solar irradiation in this region of the world.