fmincon function not working well
显示 更早的评论
I have prepared a simulation model and done some parametric analysis using MATLAB. The results found are ok. Now I am trying to optimize the cycle using MATLAB fmincon function. I have applied all constraints and parameter ranges correct to my information but what I am getting is that the fmincon function runs just near by to the initial value of parameters. Please tell me the solution or the alteration to be made in fmincon function.
回答(1 个)
Alan Weiss
2012-6-29
0 个投票
fmincon is a gradient-based optimization function. It estimates gradients of your objective and constraints by finite differences. Frequently, simulations do not change much for very small changes in position, so give spurious estimated gradients of zero or some other incorrect value.
One thing you can try is to take larger finite difference steps. Set the FinDiffRelStep option to 1e-4 or something else above the default. For older versions of MATLAB, set the DiffMinChange option to 1e-3 or something, and maybe set the DiffMaxChange to 1 or something.
You can also set the FinDiffType option to 'central' in order to take central finite differences, which might be more accurate, though it is more time-consuming.
Also, if you want a global rather than a local minimum, try starting from a variety of points. If you have Global Optimization Toolbox, look at GlobalSearch or MultiStart.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
类别
在 帮助中心 和 File Exchange 中查找有关 Choose a Solver 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!