Minimize a function with 2 variables and 2 inequality constraints.

1 回表示 (過去 30 日間)
Imanitxka imane
Imanitxka imane 2020 年 11 月 26 日
編集済み: Stephan 2020 年 11 月 26 日
Hello community,
i have a function with 2 variables to minimize.
f(x,y)= 0.5*(a*x+b*y)+0.5*((x+y)-P)) ^2
0.2 <=x<= 0.6
0<=y<= 0.2
i have to find the values of x, and y
thank you for helping me.

採用された回答

Stephan
Stephan 2020 年 11 月 26 日
編集済み: Stephan 2020 年 11 月 26 日
fmincon appears to be the right choice for this. Note that you in fact have 4 constraints. You find examples how to write the code for this under the provided link.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by