How to define if/else non linear constraint in an optimization problem

4 vues (au cours des 30 derniers jours)
Haydar El Fouany
Haydar El Fouany le 25 Mar 2024
Modifié(e) : Bruno Luong le 25 Mar 2024
if x(1)+x(2)+x(3)= 0 then x(4)= 0
elseif 0<x(1)+x(2)+x(3)<20 then x(4)=10
elseif 20<x(1)+x(2)+x(3)<60 then x(4)=30

Réponses (1)

Bruno Luong
Bruno Luong le 25 Mar 2024
Modifié(e) : Bruno Luong le 25 Mar 2024
Simply solve three different optimization pbs with the three repectively constraints independently and ignore the two other, then select the best of the three solutions.

Catégories

En savoir plus sur Least Squares 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!

Translated by