Add optimization constraint using the maximum value of decision variables
Mostrar comentarios más antiguos
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 comentarios
Matt J
el 31 de Dic. de 2019
More context is needed. What code was used to generate X and D?
Julio Cesar Franco Ardila
el 31 de Dic. de 2019
Walter Roberson
el 31 de Dic. de 2019
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
el 31 de Dic. de 2019
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 31 de Dic. de 2019
Editada: Walter Roberson
el 31 de Dic. de 2019
0 votos
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 comentario
Matt J
el 31 de Dic. de 2019
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.
Categorías
Más información sobre Linear Programming and Mixed-Integer Linear Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
