This repository contains a complete workflow that demonstrates how to design, simulate, and analyze complex microgrid architectures using MATLAB® and Simscape™. The concept of microgrids presents a promising solution to the challenges posed by traditional grid systems, offering resilience, sustainability, and efficiency. Despite the growing interest in microgrids, achieving their full potential requires a deep understanding of their diverse structures and. Microgrid design and optimization represent a transformative approach to energy management by integrating local power generation, energy storage, and advanced control systems. As distributed energy systems, microgrids can function independently or in conjunction with the traditional utility grid. This repository shows how to develop, evaluate, and operate different types of microgrids. The International Council on Large Electric Systems (CIGRE) defines microgrids as 'electricity distribution systems containing loads and distributed energy resources, (such as distributed generators, storage. Sandia National Laboratories developed the Microgrid Design Toolkit (MDT), a decision support software for microgrid designers that is publicly available for download. Department of Energy's National Nuclear Security Administration under contract.