Since the monitored operation of microgrids is a leading trend in the aspect of applying the smart grid concepts, it has become a necessity to maximize the penetration of renewable power resources. In this paper, a novel real-time monitoring operation model of a microgrid is suggested, where the overall cost is mathematically modeled and included in the proposed model. The operation is achieved by assigning switching procedures of the generation sources situated within the microgrid. A continuous mathematical model is proposed for the cost function of the microgrid containing conventional fuel power plants, wind and solar renewable power generation, and battery storage systems. The inclusion of imported power from neighboring microgrids is implied in the mathematical model as well as the exported power to those grids. The mathematical model needs to be discretized in order to imply the separate time slots of the day in the model; hence the introduction of the discretized model is imperative. A simulation test case is carried on the MATLAB software platform and the simulation results are illustrated taking into consideration different practical cases of wind speed, solar irradiance, and batteries state of charge. The studied system is designed to provide electric power for a highly fluctuating load, which is a steel factory located in Jordan. The simulation test runs indicate the importance of energy storage to increase the penetration of renewable power sources in the microgrids.