  We present SmartGridToolbox: a C++ library for simulating modern and future
electricity networks. SmartGridToolbox is distinguished by the fact that it is
a general purpose library (rather than an application), that emphasizes
flexibility, extensibility, and ability to interface with a wide range of other
tools, such as optimization technologies. It incorporates fully unbalanced
network modelling, fast power flow and OPF solvers, a discrete-event simulation
engine, and a component library that includes network components like lines,
cables, transformers, ZIP loads and generators, renewable and storage
components like PV generation and batteries, inverters, tap changers, PV,
generic time dependent loads and more. We anticipate that SmartGridToolbox will
be useful to researchers who require accurate simulations of electricity
networks that go beyond simple applications of load flow - for example, by
incorporating custom optimisation algorithms, controllers, devices, or network
management strategies. Being a library, it is also perfect for developing a
wide range of end use applications. We start with a comparison to existing open
source software, and move on to present its main features and benchmark
results. We conclude by discussing four applications, most notably, the use of
SmartGridToolbox in the CONSORT Bruny Island Battery Trial, conducted between
2016 and 2019.
