How to define a binary variable in non linear constraints

1 回表示 (過去 30 日間)
Haydar El Fouany
Haydar El Fouany 2024 年 3 月 25 日
コメント済み: John D'Errico 2024 年 3 月 25 日
if x(1)+x(2)+x(3)> 0 then x(4)= 1 otherwise x(4)=0
  1 件のコメント
John D'Errico
John D'Errico 2024 年 3 月 25 日
Please stop asking the same question multiple times.

サインインしてコメントする。

回答 (1 件)

Torsten
Torsten 2024 年 3 月 25 日
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.

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by