Filter löschen
Filter löschen

Minimize a function with equality, inequality, and product in constraints

4 Ansichten (letzte 30 Tage)
Imanitxka imane
Imanitxka imane am 27 Feb. 2023
Verschoben: Torsten am 27 Feb. 2023
Hello community, can anyone please help me to get the solution of this problem.
I have to minimize the following objective function:
OF= (x1+x2)*0.1– x3*0.3+ (x4+x5)*0.9-(x6+x7)*0.8
With respect to the following constraints:
X1+x2+x6= 10
X1+x3+x4=12
(x5+x2)*( x3+x7)= 0
0.1 <= (x5+x2)*10-(x3+x7)*0.9 <= 0.9
0<=x5+x2<=P3
0<=x3+x7<=P4
xLowerBound: [0 0 0 0 0 0 0]
xUpperBound: [12 4 4 12 4 10 4]
  1 Kommentar
Askic V
Askic V am 27 Feb. 2023
Please have a loook at this part of the documentation:
https://www.mathworks.com/help/optim/ug/nonlinear-constraints.html

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Torsten
Torsten am 27 Feb. 2023
Verschoben: Torsten am 27 Feb. 2023
x2,x3,x5 and x7 are all >= 0.
Thus the constraint (x5+x2)*(x3+x7) = 0 either gives x5=x2=0 or x3=x7=0.
Thus use "linprog" twice:
In the first run, optimize your function under the constraint x5=x2=0, in the second run, use the constraint x3=x7=0.
After these two runs, take the better of these two runs as solution.

Community Treasure Hunt

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

Start Hunting!

Translated by