Multi variable Simulated Annealing with different bounds

조회 수: 4 (최근 30일)
Hi there, I have this function that has two variables x and y
fun = @(x,y) x+y-5;
I would like to find the global minimum of this function using SA optimiser. Now the problem that I have here is that I want to use different boundary conditions for x and y like so
x0 = rand;
LBx = 0; % LBx - lower bound for x
UBx= 10; % UBx - upper bound for x
y0 = rand;
LBy = -2; % LB - lower bound for x
UBy= 3; % UB - upper bound for y
The line below is obviously not working but I am posting it as a reference to explain what I am trying to do
[x,y,fval]=simulannealbnd(fun,x0,LBx,UBx,y0,LBy,UBy); %simulated annealing
Thank you very much in advance for your help

채택된 답변

Alan Weiss
Alan Weiss 2018년 9월 13일
Global Optimization Toolbox solvers, like Optimization Toolbox™ solvers, require you to put all your variables into one vector. The same with the bounds. See Compute Objective Functions and Bound Constraints.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Spyros Polychronopoulos
Spyros Polychronopoulos 2018년 9월 14일
I thought that, that was the case. I would be a bit difficult to code that now but I will try. Thank you Alan!

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

추가 답변 (1개)

Spyros Polychronopoulos
Spyros Polychronopoulos 2018년 9월 21일
편집: Spyros Polychronopoulos 2018년 9월 21일
Would you maybe know a way to obtain a matrix with all the values x (for all the iterations) the optimizer tried? Thanks in advance

카테고리

Help CenterFile Exchange에서 Simulated Annealing에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by