Switched Controller Synthesis for Constrained Nonlinear Systems