A virtual power plant (VPP) is considered a combination of distributed generation connected with energy storage devices and interruptible loads. This system is controlled as a single flexible unit in the electricity market and in the main grid. Due to numerous problems in the main grid such as variation of frequency and the Interruption in power supply as a result of the peak load. As well as economic and material constraints, Considered the optimization solution for scheduling resources and overcome for these problems is VPP. This study proposed different scenarios for two-sector of homes in Iraq which simulated in Matlab Simulink software. The method is implemented on a test system with a VPP comprising a distribution generator, energy storage devices, and loads. The economic characteristics of these resources and of the network were calculated. the results showed a decrease in the bill of electricity for these homes by 50%. Simulation results display a benefit from the use of VPP when compared to DG based only on renewable interrupted generation.