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개)

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 CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by