Nonlinear Constraints in Multijob optimization

조회 수: 1 (최근 30일)
Panagiotis Koronaios
Panagiotis Koronaios 2021년 4월 7일
댓글: Panagiotis Koronaios 2021년 4월 8일
Hello,
I am running a multijob optimization with some design variables (3 or even more like 15 let's say x1,x2,...,x15) and I want to minimize my objective function let's say f. With every set of (x1,x2,...,x15) a specific array can be computed (let's say Y) and I want my constraint to be the elements of Y be always descending (Y1<Y2<...<Yn) . I thought that the solution to this was to introduce a variable k that when it is equal to zero then Y would be descending and when it k equals to 1 then Y would not be descending but it did not work. I got results that did not take into consideration this constraint. How can I prevent matlab from giving me such a result?
Another relevant question is how to say to matlab that ''dont give me results that f (objective function) is biger than 0.2 for example...
Thank you

답변 (1개)

Alan Weiss
Alan Weiss 2021년 4월 8일
Your constraints can be formulated as nonlinear constraints. Make sure that you read and follow the note on that page.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Panagiotis Koronaios
Panagiotis Koronaios 2021년 4월 8일
function [C Ceq] = nonlinear_constraints(x)
[....]
flag=0;
for i=1:numel(Y)-1
if Y(i+1)>Y(i)
flag=flag+1;
end
end
C = flg-5;
Ceq = [];
The truth is that my design variables and the restriction is not directly connected as you can see above. I want to prevent matlab from giving my results that C>=5 but this constraint is ignored. Do you know how to fix this?

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

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by