Lately, researchers have widely centered around renewable energy assets, for example, wind control and solar units to decrease the utilization of fossil fuels as the fundamental wellspring of ecological natural contaminations. One of the fundamental difficulties for the generation of wind and solar energies is that they frequently including the uncertainty because of the stochastic natures of wind speeds and solar radiation. Along these lines, the current uncertainty to assets the wind and solar units and necessary to assess the arranging strategy of distribution systems for having a dependable execution. To display the uncertainty related along with the wind and solar power, the point estimate method (PEM) is utilized. Weibull and Beta distributions are utilized to deal with uncertain information factors. These fundamental goals present work is to minimize the generation cost of the framework is enhanced dependent on the butterfly optimization algorithm (BOA). Four case test frameworks viewed as it is discovered that the proposed strategy gives better arrangement as far as execution time and normal cost viability. The recreation results demonstrate that the entrance of sustainable energy source builds, the generation cost diminishes. The outcomes acquired along with the butterfly optimization algorithm contrasted and another one understood strategy. Also, the precise distribution of generation cost.