Nonlinear constraints not respected in optimization
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Matt J
el 7 de Sept. de 2022
Editada: Matt J
el 7 de Sept. de 2022
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 comentarios
Bruno Luong
el 8 de Sept. de 2022
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
el 8 de Sept. de 2022
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
Ver también
Categorías
Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!