Matlab fmincon inital猜麻烦

时间:2015-09-02 20:14:02

标签: matlab optimization fminsearch

我试图计算具有多个变量的函数的最小值,我唯一的约束是变量的上限和下限。我遇到的问题是fmincon不会改变我给出的初始猜测值的输入值。

这是我得到的输出:

initGuess = 0.6159
x = 0.6159

初始点是满足约束的局部最小值。

优化已完成,因为在初始点,目标函数不会减少 在可行的方向上,在功能公差的选定值范围内,和 在约束容差的选定值内满足约束。

<stopping criteria details>

This is my call to fmincon:
A = [];
b = [];
Aeq = [];
beq = [];
lb = 0;
ub = 1;
initGuess = 0.6159;
options = optimset('TolX',1e-12,'TolCon',1e-12,'TolFun',1e-12,'Algorithm','interior-point');
[optAM,optBC] = fmincon(@(x) cmpBC(x,epochDate,epochDate2,root,rvfm),[initGuess],A,b,Aeq,beq,lb,ub,nonlcon,options);

我尝试了多次初步猜测,同样的事情发生了,请帮忙不确定如何解决这个问题。

EDIT ****

cmpBC:
function output = cmpBC(x,epochDate,epochDate2,root,rvfm)

cmdParamString = ['HPOP */Satellite/COMDEV_Sat Drag On 2.2 ' num2str(x(1)) ' "NRLMSISE 2000" File "C:\Program Files (x86)\AGI\STK 10\Data\sw20100101.txt"'];

root.ExecuteCommand(cmdParamString);


cmd = horzcat('Propagate */Satellite/COMDEV_Sat', ' "', epochDate, '" "', epochDate2,'"');
root.ExecuteCommand(cmd);
cmd = 'Report_RM */Satellite/COMDEV_Sat Style "J2000 Position Velocity"';
variableB = root.ExecuteCommand(cmd);
theSize = variableB.count;
posArray2=variableB.Item(theSize-2);

C = strread(posArray2,'%s','delimiter',',');


output = norm([str2num(C{2})-rvfm(1) str2num(C{3})-rvfm(2) str2num(C{4})-rvfm(3)]);
%rvfm is the known position of the satellite
end

0 个答案:

没有答案