Text this: Optimal energy management of power systems and microgrids incorporating demand response programs