Optimal battery schedule for grid-connected photovoltaic-battery systems of office buildings based on a dynamic programming algorithm