Model formulation with the Waterloo Energy Modelling System (WATEMS)