Control of imperfect dynamical systems