Energy management in electric grids with multiple energy sources, generators, storage devices, and interacting loads along with their complex behaviours requires grid wide control. Communication infrastructure that aggregates information from heterogeneous devices in the electric grid making the applications completely independent of physical connectivity are essential for building in the context
... [Show full abstract] of control applications. This investigation presents a semantic middleware that is used to implement a receding horizon based optimal power flow in smart grids. The presence of renewable energy sources, storage systems and loads dispersed all along the grid necessitates the use of grid wide control and a communication infrastructure to support it. To this extent the proposed middleware will serve as the basis for representing various components of the power grid. It is enriched with intelligence by semantic annotation and ontologies that provide situation awareness and context discovery. The middleware deployment is demonstrated by implementing the receding horizon OPF in a network in Steinkjer, Norway. Our results demonstrate the advantages of both the middleware and the algorithm. Furthermore, the results prove the added flexibility obtained in the grid due to the addition of renewable energy and storage systems. The significant advantage of the proposed approach is that the real-time monitoring infrastructure is used for improving the flexibility, reliability and efficiency of the grid.