Optimal energy management in a grid-tied solar PV-battery microgrid for a public building under demand response | Synapse