A microgrid is a small network of electricity users with a local source of supply that is usually attached to a larger grid but can function independently. The interconnection of small scale generating units, such as PV and wind turbines, and energy storage systems, such as batteries, to a low voltage distribution grid involves three major challenges: variability, scalability, and stability. It must keep delivering reliable and stable power also when changing, or repairing, any component, or under varying wind and solar conditions. It also must be able to accept additional units, i.e. be scalable. This reference discusses these three challenges facing engineers and researchers in the field of power systems, covering topics such as demand side energy management, transactive energy, optimizing and sizing of microgrid components. Case studies and results provide illustrative examples in each chapter.