Several studies have been published in the literature addressing the management problems between energy storage and renewable energy sources. In ref. [22] an optimal power flow is presented by an energy storage device which is subjected to several constraints on the mentioned storage device, power, voltages, and currents. The suggested solver achieves an optimal solution globally even when the power grid shows a degree of complexity. In ref. [23] an algorithm is applied to a hybrid ultracapacitor-battery as storage device in order to improve the microgrid efficiency and decrease its operational cost. This is done by introducing a combined ESS including both a high power density ultracapacitor and a high energy density battery. In ref. [24] an optimized ESS management and sizing are presented which takes into account the renewable energy and the dynamic pricing. The optimization model is framed as a stochastic program which has the intention to minimize the electricity cost and storage investment while meeting the whole demand. The energy management in an offline control mode is studied in several studies which are specifically sensitive to the uncertainty. In ref. [25,26] the authors address the wind power and PV system participation, respectively, in the frequency control of a power system, but none of them included the uncertainty of the power generation in their proposed plan. Offline uncertainty is considered in ref. [27] by using stochastic programming, but they are restricted operationally due to the lack of feedback from real system. On the other hand, in some publications, the energy management is considered by an online model predictive control (MPC) method [28; 29]. Although the MPC can enhance the robustness by its feedback mechanism, their performance is limited due to the complexity of modeling and its associated errors. In ref. [30] a scheme is proposed to increase the resiliency of a microgrid which is equipped with PV and battery storage. This is accomplished by considering the uncertainty in the electricity price and the generated power. In ref. [31] a unit commitment model based on a two-stage stochastic method is proposed which considers demand response and energy storage. In ref. [32] stochastic optimization is formulated in two stages, where the decisions made regarding the battery charging and discharging and the ultracapacitor in the first stage do not change in the second stage. In ref. [33] a virtual power plant, including a conventional power plant, renewable power generations, and an energy storage system, is presented in order to find the maximum profit while committing to its bilateral contracts. Nevertheless, most of the literature on optimal energy management in power systems, including the mentioned references, minimize the cost or maximize the profit regardless of the uncertainty consideration in the price, the demand, and renewable energy sources. This is not sufficient for an efficient and optimal energy management and it is needed to incorporate uncertainty and risk measure in the problem formulation. In ref. [34] the uncertainties of day-ahead programming are studied under different scenarios. In ref. [35] an online optimal energy storage control method is suggested which considers the uncertainty in the net demand and the renewable power generation prediction. In this case the problem is formulated based on a mixed integer linear program optimization. The authors in ref. [36] studied the risk management topic in electricity and fuel markets. Multidimensional modeling is suggested in ref. [37] with the aim of assessing the performance of a smart grid under risk consideration and managing the load and demand for the purpose of optimization in operation. The model of incorporation of the energy storage device with the distributed renewable energy besides the smart grid structure will support the power performance optimization when it comes to load and demand control.