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!
