This paper defines and simulates a closed-loop optimal control strategy for load shifting in a plant that is charged for electricity on both time-of-use (TOU) and maximum demand (MD). A model predictive control approach is used to implement the closed-loop optimal control model, and the optimization problem is solved with integer programming. The simulated control model yields near optimal switching times which reduce the TOU and MD costs. The results show a saving of 5.8% for the overall plant, and the largest portion of the saving is due to a reduction in MD. The effect of disturbances, model uncertainty and plant failure is also simulated to demonstrate the benefits of a model predictive control model.