• Proposing an environmental/economic model for optimal energy management. • Considering renewable energy resources in the presence of Photovoltaic and battery. • Presenting Hybrid Whale and Pattern Search Algorithm for optimizing Micro-grid. • Reporting superior solutions in Short-Term Scheduling and Micro-grid Energy Management. Energy resource scheduling is one of the major problems in power systems. This issue has become even more significant as renewable sources with intermittent power output are becoming more and more prevalent. Due to their low environmental impact and low operating costs, renewable energy sources (RESs) have attracted interest. The excess power generated by such generation methods may be a negative that affects power systems, hence issues relating to such systems should be properly handled. The optimal operation of a microgrid (MG) with several distributed generation (DG) units and uncertain behavior of RESs is suggested in this research using a stochastic optimization approach. So, for an MG fitted with a solar photovoltaic (PV) unit, this research proposes a day-ahead scheduling paradigm. In this regard, the effects of various climatic circumstances on the power production of the PV unit and the optimal scheduling of the MG have been examined in this research. In order to achieve this, statistics on solar irradiance were extracted from four distinct days from each of the four seasons. The single-objective optimization framework used to design the scheduling problem states that the objective function should be to minimize the total operating cost across the scheduling period. The aforementioned day-ahead scheduling problem can be solved by the "hybrid whale optimization algorithm and pattern search (HWOA-PS)” optimization algorithm, while both renewable and nonrenewable generating units, as well as an energy storage system are present. In order to confirm the higher performance of the recommended approach, a thorough comparison between the Hybrid WOA-PS algorithm and a few well-known optimization algorithms has also been conducted.