필터 지우기
필터 지우기

Nonlinear constraints not respected in optimization

조회 수: 2 (최근 30일)
Mattia Abrate
Mattia Abrate 2022년 9월 7일
댓글: Matt J 2022년 9월 8일
Dear all, I'm trying to perform a optimization procedure where nonlinear constraints (equality and inequality) are involved. The problem regards the optimization of a double wishbone suspension geometry, where the output will be the optimal coordinates of the joints in order to achieve the goals. In the objective function, after some preliminar step, a simscape model will be simulated and the objectives consists in some performance directly measured from the model. I'm trying to solve the optimization using the MATLAB live optimization, however it seems it completely ignore the nonlinear constraints and when it tests a model that can't be assembled in the simscape model, the optimization fails. The reason of the nonlinear constraints is to only test feaseble solutions and restrict the sarch space and also exclude some solution that will be bad performing, I'm not understending why they are not respected, at the moment I'm using the multi-objective genetic algorithm, but the same behaviour happens also with other solvers.
Thanks to everyone.
Mattia

답변 (1개)

Matt J
Matt J 2022년 9월 7일
편집: Matt J 2022년 9월 7일
Nonlinear constraints are only satisfied at convergence, and then only within the tolerance settings that you've specified.
You must write your objective function so that it can return something without crashing for any input point tested. Usually, you would write it to return NaN or Inf at points where it doesn't already have a real, finite value.
  댓글 수: 4
Bruno Luong
Bruno Luong 2022년 9월 8일
if isempty(ans.zside)
f(1:end) = inf;
else
whatever f is (constraint function?) it looks highly discontinuous. No wonder why the standard optimizer get lost (not sure how much it bother GA though)
Matt J
Matt J 2022년 9월 8일
I don't know what everything means in the code excerpt, but it looks like this would be more apt:
f(1:end) = inf;
simout=[];
try
simopt = simset('SrcWorkspace','current');
simout=sim('DoubleWishbone',Tsim,simopt);
end
if isempty(simout)
return
end
%rest of the objective function

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

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by