Mathematical programming formulations for approximate simulation and optimization of closed–loop systems.