I'm a developer of the absolutely amazing power system model medea. The model code is available on github under an MIT license.