Main Content

迭代可以违反约束ts

Intermediate Iterations can Violate Constraints

Be careful when writing your objective and constraint functions. Intermediate iterations can lead to points that are infeasible (do not satisfy constraints). If you write objective or constraint functions that assume feasibility, these functions can error or give unexpected results.

For example, if you take a square root or logarithm ofx, andx< 0, the result is not real. You can try to avoid this error by setting0as a lower bound onx. Nevertheless, an intermediate iteration can violate this bound.

Algorithms That Satisfy Bound Constraints

Some solver algorithms satisfy bound constraints at every iteration:

  • fminconinterior-point,sqp, andtrust-region-reflectivealgorithms

  • lsqcurvefittrust-region-reflectivealgorithm

  • lsqnonlintrust-region-reflectivealgorithm

  • fminbnd

Note

If you set a lower bound equal to an upper bound, iterations can violate these constraints.

Solvers and Algorithms That Can Violate Bound Constraints

The following solvers and algorithms can violate bound constraints at intermediate iterations:

  • fminconactive-setalgorithm

  • fgoalattainsolver

  • fminimaxsolver

  • fseminfsolver

Related Topics