Optimal control problems for nonlinear dynamic systems