Optimal energy management via day-ahead scheduling considering renewable energy and demand response in smart grids