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!
