Add optimization constraint using the maximum value of decision variables
古いコメントを表示
Hi, I need to add the following optimization constraint:

Where D_ij is a constant matrix and X_ij is a decision variable matrix.
I tried using:
max(D.*X,[],1)
but its output was :
Error using max
Invalid data type. First argument must be numeric or logical.
Does anyone know how to include it, please?
Thank you.
4 件のコメント
Matt J
2019 年 12 月 31 日
More context is needed. What code was used to generate X and D?
Julio Cesar Franco Ardila
2019 年 12 月 31 日
Walter Roberson
2019 年 12 月 31 日
I see you define an optimization variable R, and I see that you appear to be wanting to constrain R, but I do not see you use R anywhere?
Julio Cesar Franco Ardila
2019 年 12 月 31 日
採用された回答
その他の回答 (1 件)
Walter Roberson
2019 年 12 月 31 日
編集済み: Walter Roberson
2019 年 12 月 31 日
0 投票
max() is not a supported operation on optimization variables or in forming optimization constraints.
In order to implement what you want, you will need to use solver based optimization and non-linear equality constraints (and possibly non-linear inequality constraints for other variables.)
1 件のコメント
Matt J
2019 年 12 月 31 日
And you will need to use a differentiable approximation to the max() operator, e.g., the softmax function
That's assuming you pursue a solution with fmincon. Global Optimization toolbox solvers like ga() and patternsearch() don't care.
カテゴリ
ヘルプ センター および File Exchange で Choose a Solver についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
