Confronting dates in a constrain
조회 수: 1 (최근 30일)
이전 댓글 표시
I am implementing an optimisation problem on matlab and one of the constraints imposes an inequality of the type: date(x) * decision variable> date(y) + duration
Obviously I cannot multiply a date by a number so how could I solve the problem?
Thanks in advance for the help!
댓글 수: 0
답변 (1개)
Walter Roberson
2024년 2월 26일
이동: Walter Roberson
2024년 2월 26일
Perhaps
decision_variable * (date(x) > date(y) + duration)
leading to
date(y) - date(x) + duration
multiplied by something. But the something is not necessarily the decision variable: it depends on what the intent is when the decision variable is false, whether that is intended to cause the constraint to pass or to fail.
댓글 수: 5
Eric Sofen
2024년 2월 28일
@Walter Roberson, whoops! Of course, you're right about the epoch for datenum. I went back and edited my post.
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!