A computer implemented method of optimizing operation of a utility plant having multiple devices (140, 142, 144, 146, 148) to convert input energy into output energy for a building, the method comprising: in a scheduling mode: receiving a forecast of energy demand for the building; receiving a forecast of factors that will influence the building energy demand and the operation of the utility plant, including weather conditions, building temperature set point and building occupancy; operating an optimizer controller in a feedforward mode to determine future scheduling intervals specifying which of the devices (140, 142, 144, 146, 148) should be on and to provide control actions to specify a set point for each device (140, 142, 144, 146, 148) that is on from the forecast of the energy demand and the forecast of the factors so that the operation of the utility plant is economically optimal and no constraint is violated; and in a feedback control mode: dividing each scheduling interval into several control intervals and for each control interval: obtain a difference between a desired and a measured in-building condition for the building controlled by power output from the multiple devices (140, 142, 144, 146, 148) of the utility plant; obtain current values of the factors that influence the building energy demand and the operation of the utility plant including weather conditions, building temperature set point and building occupancy; determine a new building energy demand of the building expected to decrease the difference; and operating the optimizer controller in a feedback mode to update current set points for the multiple devices using a utility plant model with regards to operation costs that: satisfy the new building energy demand, take into account response times of the devices and their capacities, and minimize utility plant purchased energy cost. in a scheduling mode: receiving a forecast of energy demand for the building; receiving a forecast of factors that will influence the building energy demand and the operation of the utility plant, including weather conditions, building temperature set point and building occupancy; operating an optimizer controller in a feedforward mode to determine future scheduling intervals specifying which of the devices (140, 142, 144, 146, 148) should be on and to provide control actions to specify a set point for each device (140, 142, 144, 146, 148) that is on from the forecast of the energy demand and the forecast of the factors so that the operation of the utility plant is economically optimal and no constraint is violated; and receiving a forecast of energy demand for the building; receiving a forecast of factors that will influence the building energy demand and the operation of the utility plant, including weather conditions, building temperature set point and building occupancy; operating an optimizer controller in a feedforward mode to determine future scheduling intervals specifying which of the devices (140, 142, 144, 146, 148) should be on and to provide control actions to specify a set point for each device (140, 142, 144, 146, 148) that is on from the forecast of the energy demand and the forecast of the factors so that the operation of the utility plant is economically optimal and no constraint is violated; and in a feedback control mode: dividing each scheduling interval into several control intervals and for each control interval: obtain a difference between a desired and a measured in-building condition for the building controlled by power output from the multiple devices (140, 142, 144, 146, 148) of the utility plant; obtain current values of the factors that influence the building energy demand and the operation of the utility plant including weather conditions, building temperature set point and building occupancy; determine a new building energy demand of the building expected to decrease the difference; and operating the optimizer controller in a feedback mode to update current set points for the multiple devices using a utility plant model with regards to operation costs that: satisfy the new building energy demand, take into account response times of the devices and their capacities, and minimize utility plant purchased energy cost. obtain a difference between a desired and a measured in-building condition for the building controlled by power output from the multiple devices (140, 142, 144, 146, 148) of the utility plant; obtain current values of the factors that influence the building energy demand and the operation of the utility plant including weather conditions, building temperature set point and building occupancy; determine a new building energy demand of the building expected to decrease the difference; and operating the optimizer controller in a feedback mode to update current set points for the multiple devices using a utility plant model with regards to operation costs that: satisfy the new building energy demand, take into account response times of the devices and their capacities, and minimize utility plant purchased energy cost.