フィルターのクリア

How can write a max expression in constraint using problem based optimization?

7 ビュー (過去 30 日間)
S AsZ
S AsZ 2024 年 1 月 1 日
編集済み: Torsten 2024 年 1 月 1 日
hi everyone. I want to write the following constraint in matlab using problem based optimization. But this error is appeared: Error using max Invalid data type. First argument must be numeric or logical. My constraint is: cons1 = x == max(a,b); a and b are decision variables.
  4 件のコメント
S AsZ
S AsZ 2024 年 1 月 1 日
編集済み: S AsZ 2024 年 1 月 1 日
I added my m file at my question
Torsten
Torsten 2024 年 1 月 1 日
編集済み: Torsten 2024 年 1 月 1 日
Usually, max(a,b) can be implemented by introducing a new variable p with constraints a <= p, b <= p.
This means a scalar p with c_ik <= p with a new variable p.
This means a matrix pIK with pIK(I-1,K-1) >= c_ik(I-1,K), pIK(I-1,K-1) >= c_ik(I,K-1) (I=2,...,i, K = 2,...k) with a new array pIK.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Problem-Based Optimization and Equations についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by