필터 지우기
필터 지우기

How to solve an optimization problem over two variables using fmincon?

조회 수: 4 (최근 30일)
Bill Masters
Bill Masters 2021년 4월 5일
댓글: Bill Masters 2021년 4월 7일
Hello, I'm trying to solve an optimization problem in which there is a decision variable in its objective function, and some constraints with afformentioned variable and also another decision variable that must be calculated. this problem could be depicted as below:
Minimize Z=f(x)
subject to: g(x,y)<=0
x and y are both decision variables that in particular y is a binary variable that gonna choose an additional constraint to make it continues.
  댓글 수: 3
Bill Masters
Bill Masters 2021년 4월 6일
Hello,
I found fseminf useful to solve my problem, but there is another issue with this toolbox:
the additional variable must be vectors of at most length two! where in my problem, design variable x and the additional variable y are of the same dimension that could be a reletively large number. I'm confused which toolbox to use and how!
objfun= @(x) C'*x+rho*(norm(AA*x-z-pp+u))^2; %objective function (variable: x)
constaint1= @(x,y) -B*x+subplus(B)*pp+M*(y-ones(L*D,1)); %constraint of two variable x and y with the same dimensions
constaint2= @(x,y) B*x+subplus(-1*B)*pp+M*y;
constraint3= @(y) y-y^2
lb1=zeros(n,1) %lower bound of variable x
lb2=zeros(n,1) %lower bound of variable y
ub=ones(n,1) %upper bound of variable y
Bill Masters
Bill Masters 2021년 4월 7일
does anybody know whether this problem could be solved using CVX toolbox or not?!

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

답변 (1개)

John D'Errico
John D'Errico 2021년 4월 5일
편집: John D'Errico 2021년 4월 5일
You CANNOT use fmincon on a problem with binary variables or any form of discrete variables.
However, IF y is indeed binary, then you have only two cases to consider. So solve the problem to minimize f(x), given y == 0, and then repeat, solving it for the minimum over x of f(x), given y == 1.
Take the better of the two results and you are done. There really is little more than that to do here. You still need to choose intelligent starting values for x of course. Note that if there are multiple disjoint regions for x that satisfy the constraints, thus g(x,y)<=0, then you need to search within EACH of them. Fmincon cannot intelligently jump from one such region to another to search among them all.
If you had a more complicated case where you had multiple binary variables, then you would be forced to use a code like GA, which can handle the fully general problem. But that is apparently not the case here.
  댓글 수: 1
Bill Masters
Bill Masters 2021년 4월 6일
편집: Bill Masters 2021년 4월 6일
Hi, thank you for your reply.
I'm going to use two constraints that may help with this issue of binary variable:
0<=y<=1, y-y^2<=0
I think using these constraints could be helpful to deal with binary variables.
your first suggestion can not be done because every variable exactly is a vector of variables and searching among all of the possiblilities is not efficient.
however, the first obstacle here is to find a way to solve a nonlinear optimization problem with multiple vector variables.
Min Z=f(x)
s.to: g(x)<=0
h(x,y)<=0
y-y^2<=0
x>=0
0<=y<=1

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

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by