Optimizer Question

1 回表示 (過去 30 日間)
Sam Da
Sam Da 2011 年 3 月 15 日
This is an example of matlab optimizer: A =[-1 -2 -2; 1 2 2]; b = [0; 72];
x0 = [10; 10; 10];
[x,fval] = fmincon(@myfun,x0,A,b);
function f = myfun(x) f = x(1) * x(2) * x(3); end
So, but I want to minimize something of the form: f = x1.x2.x3 - 5*(delx1 . delx2. delx3);
Here, delx refers to change in x. i.e. if I use the function and optimize now I also need to worry about change in x.

採用された回答

Walter Roberson
Walter Roberson 2011 年 3 月 15 日
That doesn't seem to make immediate sense: if you sample the same point twice in a row, then the delta from the previous point is 0 and that new term would vanish, but clearly optimization should not depend upon the history of which points you visited before and in which order.
Are you perhaps trying to put in a constraint about wanting the answer to be "close to" a given point? If so then the extra term you want should perhaps be more like sqrt( (x(1)-x0(1)).^2 + (x(2)-x0(2)).^2 + (x(3)-x0(3)).^2 )

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by