Parametric Optimization And Constrained Optimal Control For Polynomial Dynamical Systems