Optimal weed population control using nonlinear programming