This article intends to maximize the amount of solar and wind power produced while minimizing the tested network's annual energy loss. It also wants to improve the voltage profile and reduce the dependence on the upstream network. Two types of distributed generation sources, that is, wind DGs and solar DGs, are investigated. In this article, the network loads vary according to the local consumption pattern. This research shows that the optimal utilizing of solar and wind distributed generation sources causes energy loss to decrease by about 43% and 94%, respectively. Besides, the grid will receive 1109.49 GWh of energy from the upstream power grid without distributed generation sources. In contrast, solar and wind generation sources receive only 801.47 and 125.84 GWh, respectively. Additionally, in solar and wind scenarios, micro‐grid sends 71.62 and 102.42 GWh energy to the upstream network. Also, by calculating the emission reduction, it was observed that by installing 465.45 MW of the wind turbine units in the area under consideration, the country's CO2 equivalent is reduced by 754,586 tons, and the country's primary energy is reduced by 263,916 TOE.