Multiple linear equality constraints in fmincon

17 vues (au cours des 30 derniers jours)
sharadhi
sharadhi le 4 Avr 2019
Modifié(e) : sharadhi le 4 Avr 2019
Hi
I am optimising the elements of a matrix X based on an ojbective function. I know what value of sum of row elements and sum of column elements should be. I want to optimize the matrix based on these 2 constraints.
If the size of the matrix is , for row and column,
1) sum of column 1 elements: = known column 1 sum.
This can be done for every column giving n column constraints.
I can represent this in
where =ones(1,n) and = known vector
2) I need to do the same for row elements too. I have the known vector.
I'm unable to define one and which constraints the row sum as well as column sum of matrix X
Thank you

Réponse acceptée

Torsten
Torsten le 4 Avr 2019
Aeq = [1 0 1 0 ; 0 1 0 1 ; 1 1 0 0 ; 0 0 1 1];
beq = [sum of column 1 ; sum of column 2 ; sum of row 1 ; sum of row 2]
X = [X11 ; X12 ; X21 ; X22]
This is the configuration for n=2. Can you take it from here ?
  1 commentaire
sharadhi
sharadhi le 4 Avr 2019
Modifié(e) : sharadhi le 4 Avr 2019
Yes. That was something I didn't think of. Thanks Torsten

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by