Nonlinear and Dynamic Programming