Title: Optimisation of local and national energy systems