  High penetration of renewable energy source makes microgrid (MGs) be
environment friendly. However, the stochastic input from renewable energy
resource brings difficulty in balancing the energy supply and demand.
Purchasing extra energy from macrogrid to deal with energy shortage will
increase MG energy cost. To mitigate intermittent nature of renewable energy,
energy trading and energy storage which can exploit diversity of renewable
energy generation across space and time are efficient and cost-effective
methods. But current energy storage control action will impact the future
control action which brings challenge to energy management. In addition, due to
MG participating energy trading as prosumer, it calls for an efficient trading
mechanism. Therefore, this paper focuses on the problem of MG energy management
and trading. Energy trading problem is formulated as a stochastic optimization
one with both individual profit and social welfare maximization. Firstly a
Lyapunov optimization based algorithm is developed to solve the stochastic
problem. Secondly the double-auction based mechanism is provided to attract MG
truthful bidding for buying and selling energy. Through theoretical analysis,
we demonstrate that individual MG can achieve a time average energy cost close
to offline optimum with tradeoff between storage capacity and energy trading
cost. Meanwhile the social welfare is also asymptotically maximized under
double auction. Simulation results based on real world data show the
effectiveness of our algorithm.
