Abstract-The structure and behavior of Electrical Grids share many of the properties of Complex Computer Systems, with microgrids and other decentralized electrical systems attached to them, so they can be interpreted as Systems of Systems. Furthermore, the evolution of the future electrical system will bring a higher degree of decentralization concerning specially production and control. To deal with this paradigm change, new models and tools are necessary. In this paper a model of an electrical microgrid is presented. The approach used in the development of the model is Agent-Based in combination with System Dynamics. By mixing these approaches the different entities of the electrical system (production, demand, storage, etc.) have been represented. Through the individual behavior of the agents it is possible to reproduce the complex behavior of the system as a whole. This behavior can produce expected and unexpected emergent properties on the interconnected system that can be analyzed through simulation. A case study is presented to analyze the capabilities of such kind of models. The example shows the simulation of an integrated microgrid system, where different components such as renewable energy sources and storage have been implemented. The simulation results of this case study are discussed.Index Terms-electrical grid, microgrid, agent-based models, complex computer systems, system of systems.