编写约束
提供边界、线性约束和非线性约束
如何表示各种不同类型问题的约束。
函数
checkGradients | Check first derivative function against finite-difference approximation (自 R2023b 起) |
主题
编写约束
- 约束的类型
为您的约束选择最合适的形式。 - 迭代可能违反约束
有约束问题的注意事项。 - 边界约束
如何为单个分量编写约束。 - 线性约束
包括可以表示为矩阵不等式或等式的约束。 - 非线性约束
如何包含一般不等式和等式约束。 - Checking Validity of Gradients or Jacobians
Check whether a derivative function matches finite difference estimates. - Or Instead of And Constraints
Optimize when only one constraint of a set is necessary. - Objective and Nonlinear Constraints in the Same Function
Save function evaluations, typically useful in simulations. - 如何使用所有类型的约束
显示所有约束的示例。
传递额外参数
- 传递额外参数
在目标或非线性约束函数中包含额外的参数或数据。
约束参量详细信息
- 矩阵参量
处理多维参量。