Dynamic bounds in an optimizer

조회 수: 4 (최근 30일)
Spyros Polychronopoulos
Spyros Polychronopoulos 2020년 6월 18일
답변: Alan Weiss 2020년 6월 19일
I would like to have relationship constraints between variables an optimizer is trying. For example: If variable x(1) is greater than 10 then 8<= x(2) <= 12.
O = @(x) x(1)+x(2)+x(3);
IN= [10 10 10]; % Initial Values
LB=[5 5 5]; % Low Bound
UB=[15 15 15]; % Upper Bound
[set_matrix,best_cost]=simulannealbnd(O,IN,LB,UB); % Simulated Annealing
% if x(1)>10 then x(2) has to take values between 8 and 12

채택된 답변

Alan Weiss
Alan Weiss 2020년 6월 19일
You are describing a nonlinear constraint. This is a type of constraint that simulannealbnd cannot handle.
In fact, your constraint is not differentiable. This can be a problem for solvers. However, if your underlying variables are integer-valued, then you can use some techniques from integer linear programming to create the constraint. See Optimal Dispatch of Power Generators for an example.
Solvers that can handle nonlinear constraints include fmincon, patternsearch, ga, and the recent version of surrogateopt. Solvers that handle integer variables include intlinprog, ga, and surrogateopt.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

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