Pattern search with integer decision variable.

조회 수: 11 (최근 30일)
Matlab Noob
Matlab Noob 2016년 5월 25일
댓글: Alan Weiss 2019년 2월 7일
Hello.
I tried to solve Nonlinear integer programming to minimize using Optimization tool box.
I understand how I input both objective function and nonlinear constraint function.
However, I don't know how I obtain some decision variable are integer and others are real variable. Cuz, there is no option in pattern search tool box and function in matlab.
Are there any method to get integer variable using pattern search in matlab tool box?

채택된 답변

Alan Weiss
Alan Weiss 2016년 5월 25일
If you have mixed (some integer, some continuous) variables, then no, there is currently no patternsearch solution. Use ga for this type of problem.
However, if all your variables are integer-valued, then you might be able to use patternsearch. Start at an integer point, set ScaleMesh off, and set TolMesh to 0.9 or so. I believe that, with those settings, patternsearch will search only integer points.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 11
Ryan Potter
Ryan Potter 2019년 2월 7일
Hi, I just wanted to check whether this advice was still valid? I have followed the points above but still generate non-integer values. I'm using the following code:
fun = @computeMagVol;
x0 = [10,25,20,2];
A = [];
b = [];
Aeq = [];
beq = [];
lb = [1, 1, 1,1];
ub = [21,51,41,4];
nonlcon = @combineConstraints;
options = optimoptions('patternsearch', ...
'PollMethod' , 'GPSPositiveBasis2N', ...
'Display' , 'Iter', ...
'ScaleMesh' , 'off', ...
'AccelerateMesh' , false, ...
'TolMesh' , 0.9, ...
'PlotFcn' ,{@psplotbestf,@psplotmeshsize});
[x,fval,exitflag,output] = patternsearch(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options);
My objective function use the integer variables to select discrete, non-integer variables from a list. After the following computations:
Iter Func-count f(x) Constraint MeshSize Method
0 1 75615.1 104.4 0.9
1 50 71970.7 0 0.001 Increase penalty
I obtain that x = [1 44.5, 21, 4] which causes my objective function calculation to fail. The same functions work with the ga algorithm, however I was hoping to use patternsearch as it supports having the object function and non-linear constraints in a single function. Any advice would be greatly appreciated.
Alan Weiss
Alan Weiss 2019년 2월 7일
As I said earlier, I am not at all sure that this method works when you have nonlinear constraints. Sorry.
Alan Weiss
MATLAB mathematical toolbox documentation

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

추가 답변 (1개)

Benjamin Duquenne
Benjamin Duquenne 2017년 6월 1일
Hi, I would like to use patternsearch for full integer problems. To do so, I set the ScaleMesh off, and set TolMesh to 0.9. However I still have problems with the TolBind that has to be way too high (~1e3) to make the code work, otherwise I have errors like 'Constraints are dependent at current iterate'. Could you help me? Thanks in advance.

카테고리

Help CenterFile Exchange에서 Direct Search에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by