Optimization of energy and economic scheduling of a hybrid energy plant by using a dynamic programming approach