Multi variable Simulated Annealing with different bounds
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Spyros Polychronopoulos
le 12 Sep 2018
Modifié(e) : Spyros Polychronopoulos
le 21 Sep 2018
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
0 commentaires
Réponse acceptée
Alan Weiss
le 13 Sep 2018
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
Plus de réponses (1)
Spyros Polychronopoulos
le 21 Sep 2018
Modifié(e) : Spyros Polychronopoulos
le 21 Sep 2018
0 commentaires
Voir également
Catégories
En savoir plus sur Simulated Annealing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!