Effacer les filtres
Effacer les filtres

Using "fminimax" in Matlab to solve the Max-Min programming problem

4 vues (au cours des 30 derniers jours)
JacobsonRadical
JacobsonRadical le 24 Avr 2022
Commenté : JacobsonRadical le 24 Avr 2022
Consider the following function defined in the following picture.
Define a finite set of points as follows:
I want to solve the following programing problem:
My idea is the following:
This programing is the first step of a general programing I am studying at. So it should not give trivial solution like 0 or something like this. However, when I attempted it in Matlab, the solution is not desirable.
The following is my code:
fun = @(x)[-log(max(1,0.1037))+x(1)*log(abs(poly1(0.1037)))+x(2)*log(abs(poly2(0.1037)))...
+x(3)*log(abs(poly3(0.1037)))+...
x(4)*log(abs(poly4(0.1037)));
-log(max(1,0.0259))+x(1)*log(abs(poly1(0.0259)))+x(2)*log(abs(poly2(0.0259)))...
+x(3)*log(abs(poly3(0.0259)))+...
x(4)*log(abs(poly4(0.0259)));
-log(max(1,0.2288))+x(1)*log(abs(poly1(0.2288)))+x(2)*log(abs(poly2(0.2288)))...
+x(3)*log(abs(poly3(0.2288)))+...
x(4)*log(abs(poly4(0.2288)));
-log(max(1,0.0938))+x(1)*log(abs(poly1(0.0938)))+x(2)*log(abs(poly2(0.0938)))...
+x(3)*log(abs(poly3(0.0938)))+...
x(4)*log(abs(poly4(0.0938)));
-log(max(1,0.0917))+x(1)*log(abs(poly1(0.0917)))+x(2)*log(abs(poly2(0.0917)))...
+x(3)*log(abs(poly3(0.0917)))+...
x(4)*log(abs(poly4(0.0917)));
-log(max(1,0.2386))+x(1)*log(abs(poly1(0.2386)))+x(2)*log(abs(poly2(0.2386)))...
+x(3)*log(abs(poly3(0.2386)))+...
x(4)*log(abs(poly4(0.2386)));
-log(max(1,0.2003))+x(1)*log(abs(poly1(0.2003)))+x(2)*log(abs(poly2(0.2003)))...
+x(3)*log(abs(poly3(0.2003)))+...
x(4)*log(abs(poly4(0.2003)));];
A= [];
b= [];
Aeq = [];
beq = [];
x0 = [0,0,0,0];
lb = [0,0,0,0];
up = [1000,1000,1000,1000];
[x,fval] = fminimax(fun,x0,A,b,Aeq,beq,lb,ub)
where in the code:
The solution that Matlab provides is the following:
I don't quite understand why this happens. Is there anything wrong in my idea or code? Thank you so much for your help!

Réponse acceptée

Torsten
Torsten le 24 Avr 2022
Modifié(e) : Torsten le 24 Avr 2022
Yes, [0 0 0 0] is the correct solution to your problem.
For all other c vectors >= 0, min g(x,c) would be negative.
Since your problem is linear in the c's, here is an easier way to solve your problem:
poly1=@(x)x.^2-x-1;
poly2=@(x)x.^4-x.^3-3*x.^2+x+1;
poly3=@(x)x.^8-x.^7-7*x.^6+4*x.^5+13*x.^4-4*x.^3-7*x.^2+x+1;
poly4=@(x)x.^3+x.^2-2*x-1;
X = [0.1037;0.0259;0.2288;0.0938;0.0917;0.2386;0.2003];
A = [log(abs(poly1(X))),log(abs(poly2(X))),log(abs(poly3(X))),log(abs(poly4(X))),ones(numel(X),1)] b = zeros(numel(X),1);
f = [0 0 0 0 -1].';
lb = [0 0 0 0 -Inf].';
ub = [1000 1000 1000 1000 Inf].';
c = linprog(f,A,b,[],[],lb,ub)
  3 commentaires
Torsten
Torsten le 24 Avr 2022
Modifié(e) : Torsten le 24 Avr 2022
log(max(1,x)) can always be neglected because it does not depend on c1,...,c4.
c(5) is min_(x in X) g(x,c) which is to be maximized - therefore min: -c(5) in the code.
JacobsonRadical
JacobsonRadical le 24 Avr 2022
Great. Thank you so much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Linear Programming and Mixed-Integer Linear Programming dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by