After a high-flux thermal nuclear reactor is shut down, the concentration of fission product xenon may rise for many hours as a result of the decay of fission product iodine into Xe135. This results in reactor poisoning and may, with consequent loss of efficiency, postpone the time at which the reactor may be restarted. This poisoning may be minimized by carefully controlling the rate at which the neutron flux is decreased during the shut-down operation. The determination of optimal control in this situation leads to some nonclassical problems in the calculus of variations. The aim of this paper is to show how they can be treated by the functional equation technique of dynamic programming. The methods we present rely upon the use of high-speed digital computers with large memories. The method automatically produces a valuable parameter study and results in stable designs.