Optimal energy consumption in the production of bioethanol from lignocellulosic biomass