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

조회 수: 4 (최근 30일)
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!

채택된 답변

Torsten
Torsten 2022년 4월 24일
편집: Torsten 2022년 4월 24일
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
Torsten
Torsten 2022년 4월 24일
편집: Torsten 2022년 4월 24일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Least Squares에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by