Development Of Methodology And Test Platform For Local Energy System Analysis And Optimal Operation