A coordinated and hierarchical operation of active distribution networks with microgrids, specifically when they have distributed energy resources allocated and operated in an optimized way, results in a reduction in operating costs, losses, and greater flexibility and. A coordinated and hierarchical operation of active distribution networks with microgrids, specifically when they have distributed energy resources allocated and operated in an optimized way, results in a reduction in operating costs, losses, and greater flexibility and. Distribution networks have undergone a series of changes, with the insertion of distributed energy resources, such as distributed generation, energy storage systems, and demand response, allowing the consumers to produce energy and have an active role in distribution systems. Thus, it is possible. In particular, Microgrid interconnectivity, active distribution networks, energy hubs, and the ways that all of these technologies support microgrids proves to be a necessity for anyone in the power and energy industry to understand. Clear operating modes and validated models establish a foundation for predictable behaviour that supports.