How to define a binary variable in non linear constraints

1 vue (au cours des 30 derniers jours)
Haydar El Fouany
Haydar El Fouany le 25 Mar 2024
Commenté : John D'Errico le 25 Mar 2024
if x(1)+x(2)+x(3)> 0 then x(4)= 1 otherwise x(4)=0
  1 commentaire
John D'Errico
John D'Errico le 25 Mar 2024
Please stop asking the same question multiple times.

Connectez-vous pour commenter.

Réponses (1)

Torsten
Torsten le 25 Mar 2024
Solve two problems:
One with
x(1)+x(2)+x(3)>= 0
x(4)=1
the other with
x(1)+x(2)+x(3)<= 0
x(4)=0
and take the best of the two runs as the solution.

Community Treasure Hunt

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

Start Hunting!

Translated by