Optimization function based on different domain of optimized variables

Hello,
I have an linear objective function f(x1,x2,x3.. ) which is defined for a fixed domain of x1 say x1< (constant k). Also the objective function changes to g(x1,x2,x3 ... ) if x1> (constant k). The objective function in both the cases is linear. x1,x2,x3 are the optimization variables. There are set of other equality and inquality constraints on the other variables.
I was trying to solve this optimization problem using linprog .
How can I switch the optimization function based on the domain of x1? Can I iterate over the current value of x1 and check if it is less than that constant in 'linprog' solver and accordingly select the optimization function f or g?

 採用された回答

Matt J
Matt J 2020 年 11 月 26 日
編集済み: Matt J 2020 年 11 月 26 日

0 投票

Solve the problem twice, once with the constraint x1<=k and once with x1>=k, imposing the appropriate objective function in each case. Whichever of the solutions gives the best objective function value wins.

1 件のコメント

vanguard478
vanguard478 2020 年 11 月 26 日
Okay.. Thank you for the reply.
I asked this because I was just wondering if there was any other more succint way of doing this instead of writing the same constraints x2,x,3...etc ( which don't affect the objective functions ,being the same for both f and g) as many times as the different domains of the constraint x1 specified.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Nonlinear Optimization についてさらに検索

製品

リリース

R2019a

タグ

質問済み:

2020 年 11 月 26 日

コメント済み:

2020 年 11 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by