Simscape Electrical Toolbox provides the necessary tools for modelling a microgrid with various components. There is a trade-off between the level of model fidelity and the simulation speed.
Kindly refer to the following links for more insights:
- https://www.mathworks.com/support/search.html/videos/microgrid-system-development-and-analysis-part-3-using-simscape-power-systems-to-simulate-microgrids-1522853406434.html(Microgrid simulation using Simscape)
- https://www.mathworks.com/support/search.html/videos/microgrid-modeling-on-the-right-level-of-detail-for-short-and-long-term-simulations-1593454332839.html (Important aspects for fast and robust simulation)