У нас вы можете посмотреть бесплатно Choosing Between Nonlinear and Big-M Constraints in GEKKO for MINLP Problems или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Learn when to use nonlinear equality constraints vs. big-M inequalities in GEKKO for mixed-integer nonlinear programming (MINLP) and how it impacts solver performance. --- This video is based on the question https://stackoverflow.com/q/79474870/ asked by the user 'Hamiduddin Hamdan' ( https://stackoverflow.com/u/29675788/ ) and on the answer https://stackoverflow.com/a/79475892/ provided by the user 'Erwin Kalvelagen' ( https://stackoverflow.com/u/5625534/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions. Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Is there any benefit of choosing to formulate constraints in a way or another in GEKKO? Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l... The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license. If anything seems off to you, please feel free to drop me a comment under this video. --- Introduction When modeling Mixed-Integer Nonlinear Programming (MINLP) problems in GEKKO, the way you formulate constraints can significantly affect solver performance and solution quality. Consider the common scenario: You have a continuous variable Q. A binary variable z controls whether Q can be non-zero. You want to enforce that Q is zero whenever z equals zero. Two Common Formulations 1. Nonlinear Equality Constraint [[See Video to Reveal this Text or Code Snippet]] This directly enforces that: If z = 0, then Q * 1 = 0 → Q = 0. If z = 1, then constraint is Q * 0 = 0, which holds for any Q. However, this constraint is nonlinear and non-convex. 2. Big-M Linear Inequality Constraint [[See Video to Reveal this Text or Code Snippet]] Where M (e.g., 10000) is an upper bound on Q. This means: If z = 0, then Q <= 0 → Q = 0 (if Q ≥ 0). If z = 1, then Q <= M (upper bound). This is a linear and convex constraint, provided M is known and reasonably tight. Which One is Better? Despite intuition that the nonlinear form might slow solvers down, often the big-M formulation (2) is preferable in MINLP because: It is linear and convex, making relaxations easier for solvers. Can improve solver convergence if M is tight. Big-M Caveats A too large M weakens the relaxation, causing slow convergence or poor solutions. An excessively large M can cause numerical instability. Practical Insights In some models, like heat exchanger network synthesis, the nonlinear form (Q*(1-z)=0) may solve faster and yield better solutions due to specific solver heuristics or problem structure. If the big-M formulation results in slower or poorer solutions, verify if the chosen M is unnecessarily large. Advanced Alternative: Indicator Constraints Some advanced solvers and modeling frameworks support indicator constraints, which more directly link binary variables and continuous variables without big-M constants or nonlinear terms. These constraints can improve solver performance and robustness. Check if your solver supports them via GEKKO or other modeling tools. Summary Use big-M linear constraints when M can be kept small—these are generally better for MINLP solvers. If big-M is large or unavailable, nonlinear constraints may be acceptable but potentially harder to solve. Investigate indicator constraints if supported. Choosing the right formulation depends on your specific problem, solver characteristics, and bounds knowledge.