Flexible dispatch of a building energy system using building thermal storage and battery energy storage. (1st June 2019)