【发布时间】:2015-04-17 01:52:24
【问题描述】:
我在解决 Matlab 中的优化问题时遇到问题。我有一个目标函数,我需要最小化。
我在 Matlab 中使用 lsqnonlin 函数运行这段代码:
[objective] = @(E) objective(E);
options = optimoptions(@lsqnonlin,'Algorithm','trust-region-reflective','MaxFunEvals',2000);
lowb = [0.00001 0.00001 0.00001]; % lower bounds
uppb = [30 30 30]; % upper bounds
E0 = [0.00001 0.00001 0.00001]; %initial guess
problem = createOptimProblem('lsqnonlin', 'objective', objective, 'x0', E0, 'lb', lowb, 'ub', uppb, 'options', options);
ms = MultiStart;
matlabpool open
ms.UseParallel = 'always';
startpoints = RandomStartPointSet('NumStartPoints',100);
[E, fval, exitflag, output, solutions] = run(ms, problem, startpoints);
matlabpool close
我终于得到了这个错误,我无法继续: Levenberg-Marquardt 算法不处理有界约束和 trust-region-reflective 算法至少需要与变量一样多的方程;中止。
你能告诉我出了什么问题吗?这些是我在 Matlab 中优化工具箱的第一次尝试,所以我不知道很多事情。
【问题讨论】:
-
在
RandomStartPointSet中使用较少的起点,而不是使用upper/lower边界,我认为这是您得到错误的根源
标签: matlab optimization