fminunc for upper and lower bound variable definition ?
古いコメントを表示
Isn't it possible to give upper and lower bound for the variables in the objective function while using fminunc ?
Thank you.
採用された回答
その他の回答 (1 件)
Bruno Luong
2020 年 11 月 4 日
編集済み: Bruno Luong
2020 年 11 月 4 日
You could transform variables, x will be opened bounded by lo/hi
xfun = @(y) lo + (hi-lo).*sin(y).^2
...
y = fminunc(obj(xfun(y)), ...)
x = xfun(y)
Honestly I don't like those kind of transformation.
Use the right tool: fmincon as others have suggested.
9 件のコメント
Walter Roberson
2020 年 11 月 4 日
sin(y) could be negative though
Bruno Luong
2020 年 11 月 4 日
Good catch Walter, I correct it
Walter Roberson
2020 年 11 月 4 日
Could also use the midpoint plus half the difference times sine unsquared, taking advantage of the negative ;)
Bruno Luong
2020 年 11 月 4 日
I could. Just minimize the keyboard skrokes while editing the code. ;-)
Walter Roberson
2020 年 11 月 5 日
No, fmincon() is completely unsuited for finding the minimum of multiple functions at the same time. See gamultiobj()
Walter Roberson
2020 年 11 月 5 日
fun = @(x)[x1L;x2L;x3L]+([x1U;x2U;x3U]-[x1L;x2L;x3L]).*PRSopt_QN1(x(1,:),x(2,:),x(3,:))
Unless two of x1L, x2L, x3L are empty and the third is a scalar, then you can be sure that function is going to return something that is not a scalar. You do not take the mean() there.
カテゴリ
ヘルプ センター および File Exchange で Solver Outputs and Iterative Display についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!