Similar Items: Optimal energy management of power systems and microgrids incorporating demand response programs