當前位置:
首頁 > 知識 > 基於fminsearch的約束優化函數fminsearchbnd, fminsearchcon

基於fminsearch的約束優化函數fminsearchbnd, fminsearchcon

Fminsearch不支持約束條件的搜索。

Fminsearch does not admit bound constraints.

然而,可以採用簡單的變換方法將約束問題轉化為無約束問題。

However simple transformation methods exist to convert a bound constrained problem into an unconstrained problem.

Fminsearchbnd與fminsearch的使用方法非常相近,除了對變數的邊界進行約束。

Fminsearchbnd is used exactly like fminsearch, except that bounds are applied to the variables.

在Fminsearchbnd內部進行了變數的轉換。

The bounds are applied internally, using a transformation of the variables. (Quadratic for single bounds, sin(x) for dual bounds.)

這些邊界包含不等式,並允許包括邊界值本身,但是不允許任何超出邊界的函數求解。

The bounds are inclusive inequalities, which admit the boundary values themselves, but will not permit ANY function evaluations outside the bounds.

注意,fminsearchbnd允許用戶通過將兩個邊界設置為完全相同的值,將變數精確地固定在某個給定值上。

Note that fminsearchbnd allows the user to exactly fix a variable at some given value, by setting both bounds to the exact same value.

使用舉例:

rosen = @(x) (1-x(1)).^2 + 105*(x(2)-x(1).2).2;

% 無約束求解

fminsearch(rosen,[3 3])

ans =

1.0000 1.0000

% Lower bounds, no upper bounds

fminsearchbnd(rosen,[2.5 2.5],[2 2],[])

ans =

2.0000 4.0000

% Lower bounds on both vars, upper bound on x(2)

fminsearchbnd(rosen,[2.5 2.5],[2 2],[inf 3])

ans =

2.0000 3.0000

本源碼包括多個示例說明,下載地址:

http://page5.dfpan.com/fs/alacej1292610209169/

作者: 劉春靜HEU

原文:https://blog.csdn.net/weixin_42825609/article/details/85044392

基於fminsearch的約束優化函數fminsearchbnd, fminsearchcon

打開今日頭條,查看更多圖片
喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 程序員小新人學習 的精彩文章:

用js方法splict()、indexOf()、push()等操作數組Array增刪改查
node+express+mongoDB寫簡單介面,Vue獲取介面

TAG:程序員小新人學習 |