This paper illustrates stochastic distributed algorithms that optimally share the electrical and thermal power generation task among the several Distributed Energy Resources (DERs) within a microgrid. We borrow certain concepts from communication network theory, namely Additive-Increase- Multiplicative-Decrease (AIMD) algorithms, which are known to be convenient in terms of communication requirements and network efficiency. We adapt them to minimise a cost utility function of interest in the framework of smart grids. We then implement the AIMD utility optimisation strategies in a realistic power network simulation in Matlab-OpenDSS environment, and we show the performance of the proposed algorithms in achieving thermal and electrical power balancing1. © 2013 IEEE.