matlab - 使用 fmincon 内点算法的最优容差
问题描述
我正在尝试使用 MatLab 的 fmincon 函数和“内点”算法来解决非线性约束优化问题。问题是应力约束下的体积最小化。这个求解器已成功应用于我的问题,但它并没有给我一个好的结果,音量应该会下降更多。优化器找到一个局部最小值,但优化在 3 次迭代后停止显示按摩:
Local minimum possible. Constraints satisfied.
fmincon stopped because the size of the current step is less than the selected value of the step size tolerance and constraints are satisfied to within the selected value of the constraint tolerance.
使用的选项:
The options that I use: options=optimset('Algorithm','interior-point','Display','iter-detailed',...
'MaxFunEvals',10000,'TolX',1e-20,'TolFun',1e-20,','DiffMinChange',1e-1);
我不知道如何使用“内点”算法将 OptimalityTolerance 更改为 1e-6。我试过:
opts = optimoptions('fmincon','OptimalityTolerance',1e-12);
但是如果我运行它,OptimalityTolerance 保持在 1e-6 并且无论我以前使用什么,我的结果都没有什么不同。
解决方案
您正在使用局部优化(无论您使用 fmincon 的内部点还是信任区域反射版本)。通常,除非您的成本函数被严重缩放,即它需要非常小的值(< 1e-4),否则无需增加MaxFunEvals
公差或公差,而不是您更早达到公差(但您可以缩放参数以提高收敛性) .
无论如何,您正在寻找的选项是OptimalityTolerance
. 但我建议检查像模式搜索这样的全局优化算法(ga 非常慢而且有点夸张。)
您可以通过键入检查默认选项
opts = optimoptions('fmincon')
选择 =
fmincon 选项:
当前算法使用的选项('interior-point'):(
其他可用算法:'active-set'、'sqp'、'sqp-legacy'、'trust-region-reflective')
设置属性:未设置
选项。
默认属性:
算法:'interior-point'
CheckGradients:0
ConstraintTolerance:1.0000e-06
显示:'final'
FiniteDifferenceStepSize:'sqrt(eps)'
FiniteDifferenceType:'forward'
HessianApproximation:'bfgs'
HessianFcn:[]
HessianMultiplyFcn:[]
荣誉边界:
MaxIterations: 1000
ObjectiveLimit: -1.0000e+20
OptimalityTolerance: 1.0000e-06
OutputFcn: []
PlotFcn: []
ScaleProblem: 0
SpecifyConstraintGradient: 0
SpecifyObjectiveGradient: 0
StepTolerance: 1.0000e-10 SubproblemAlgorithm
: 'factorization'typicalX
: 'ones(numberOfVariable ,1)'
使用并行:0
推荐阅读
- php - 使用散列密码的安全登录和注册系统
- matlab - 计算、存储和绘制线和多边形的交点
- powershell - Powershell 输出为数组
- arrays - 如何将固定长度的十六进制符文数组转换为单个整数
- javascript - 为什么当我调用 api 时我的代码会无限循环?
- python - 按值范围Python查找时间间隔
- powerbi - Calendar/GenerateSeries DAX 函数给出错误“日历函数中的开始日期或结束日期不能为空白值”。
- r - R - 使用序列但排除特定数字的 For 循环
- python - 无法将 NumPy 数组转换为张量(不支持的对象类型 numpy.ndarray)
- groovy - 尝试使用 Groovy Spock Mock 模拟两个类:GroovyCastException