How to use parallel computation in globalsearch function?

조회 수: 5 (최근 30일)
Devin
Devin 2019년 2월 7일
댓글: Kailin 2019년 8월 9일
Greetings,
Currently, I am working on a constraint nonlinear optimization problem and expect to find the feasible global minimum solution.
I try to creat a GlobalSearch object with MultiStart and use parallel computation to find global optimal solution. But I feel confused about documents. In this document (https://www.mathworks.com/help/gads/globalsearch-and-multistart-properties-options.html#bsdkk6), it mentions that I can creat GlobalSearch object with MultiStart.
In another document, it mentioned that MultiStart can use parallel computation (https://www.mathworks.com/help/gads/example-parallel-multistart.html). However, in another documentation (https://www.mathworks.com/help/gads/how-solvers-compute-in-parallel.html#bsc7xyp), it mentioned that GlobalSearch function cannot use parallel computation. How can I use multiStart with parallel computation to find global minimum?
I find this following code does not work.
ms = MultiStart('FunctionTolerance',1e-4,'UseParallel',true,'XTolerance',1e-4,'Display','iter',...
'StartPointsToRun','all','options',optimoptions(@fminunc,'UseParallel',true));
gs = GlobalSearch(ms);
problem = createOptimProblem('fmincon','x0',uInit,...
'objective',@ocp.cost,'Aineq',ocp.opt.A,'bineq',ocp.opt.b,'lb',ocp.opt.lb,'ub',ocp.opt.ub);
u = run(gs,problem);
I got error:
Error using AbstractGlobalSolver (line 187)
No public property options exists for MultiStart.
Error in MultiStart (line 111)
ms = ms@AbstractGlobalSolver(varargin{:});
If I use this code. It works but it is slow and seems that parallel computation does not work.
ms = MultiStart('FunctionTolerance',1e-4,'UseParallel',true,'XTolerance',1e-4,'Display','iter',...
'StartPointsToRun','all');
gs = GlobalSearch(ms);
problem = createOptimProblem('fmincon','x0',uInit,...
'objective',@ocp.cost,'Aineq',ocp.opt.A,'bineq',ocp.opt.b,'lb',ocp.opt.lb,'ub',ocp.opt.ub);
u = run(gs,problem);
How can I use multiStart with parallel computation to find global minimum; Or how can I find global minimum quickly?

답변 (2개)

Kailin
Kailin 2019년 8월 8일
Global search does not have parallel functionality according to this link.
Best,
K

Alan Weiss
Alan Weiss 2019년 8월 9일
I think that you are confused about what GlobalSearch and MultiStart do. Bottom line: I think that you should not use GlobalSearch at all, and instead should just use MultiStart.
Details: GlobalSearch is a heuristic algorithm that does not promise to find a global solution. It is worthwhile if your objective function is not very expensive, and if the basins of attraction in your problem are roughly spherical.
MultiStart is well described by its name: it starts a local solver (often fmincon) multiple times from different start points. Obviously, this does not guarantee that you get a global solution, but the longer you run, the more likely you are to get one. MultiStart can run in parallel, but GlobalSearch cannot.
I hope that I have convinced you that GlobalSearch is not the right choice for you, and you should ignore it.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Kailin
Kailin 2019년 8월 9일
Thanks a lot Alan! I am running both but now I can drop globalsearch.
Best,
K

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

카테고리

Help CenterFile Exchange에서 Global or Multiple Starting Point Search에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by