Short-Term Planning of Cogeneration Energy Systems via Mixed-Integer Nonlinear Optimization