Using optimal control methods with constraints to generate singlet states in NMR.