An open-source framework for formal specification and simulation of electrical energy systems