# \#constraint

**URL:** https://discourse.julialang.org/tag/constraint/1459.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Debugging Container of Constraints in JuMP](https://discourse.julialang.org/t/debugging-container-of-constraints-in-jump/122509)

<div class="topic-metadata">

**Author:** [@lamont](https://discourse.julialang.org/u/lamont)\
**Replies:** 9\
**Last updated:** [January 28, 2026, 7:56am UTC](https://discourse.julialang.org/t/debugging-container-of-constraints-in-jump/122509 "2026-01-28T07:56:50Z")

</div>

I’m trying to debug a container of constraints built using the vectorized linear algebra syntax and trying to go in through the MOI interface to check the constraint value based on the start\_value of the variables. I’ve…

---

## [How to incorporate state-dependent state constraint in JuMP](https://discourse.julialang.org/t/how-to-incorporate-state-dependent-state-constraint-in-jump/128485)

<div class="topic-metadata">

**Author:** [@stepanoslejsek](https://discourse.julialang.org/u/stepanoslejsek)\
**Replies:** 9\
**Last updated:** [May 2, 2025, 9:33am UTC](https://discourse.julialang.org/t/how-to-incorporate-state-dependent-state-constraint-in-jump/128485 "2025-05-02T09:33:18Z")

</div>

Hi, I am trying to implement energy-efficient optimal control for vehicles, which includes traffic lights in the setup. The following problem is described as: \\text{minimize}\_{u^+, u^-} \\int\_{0}^{S} \\frac{u^+}{\\eta\_1} …

---

## [BilevelJuMP: Symmetric variables not supported?](https://discourse.julialang.org/t/bileveljump-symmetric-variables-not-supported/127346)

<div class="topic-metadata">

**Author:** [@HSt](https://discourse.julialang.org/u/HSt)\
**Replies:** 1\
**Last updated:** [March 25, 2025, 6:58pm UTC](https://discourse.julialang.org/t/bileveljump-symmetric-variables-not-supported/127346 "2025-03-25T18:58:47Z")

</div>

I’ve build functions to add specific variables and constraints one after another, to modularize model creation. Some of the variables should be symmetric, which is fine in regular JuMP when constrained on creation. How…

---

## [Interior-Point Newton tries points outside of the constraint set](https://discourse.julialang.org/t/interior-point-newton-tries-points-outside-of-the-constraint-set/127215)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 5\
**Last updated:** [March 21, 2025, 2:12pm UTC](https://discourse.julialang.org/t/interior-point-newton-tries-points-outside-of-the-constraint-set/127215 "2025-03-21T14:12:59Z")

</div>

Hi, I’m using Interior-Point Newton to solve a constrained optimization problem where my objective function is not (always) defined outside the constraint set. I found that Interior-Point Newton sometimes tries points ou…

---

## [Minimize f(x) with |x|=1](https://discourse.julialang.org/t/minimize-f-x-with-x-1/123307)

<div class="topic-metadata">

**Author:** [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Replies:** 5\
**Last updated:** [December 1, 2024, 7:21am UTC](https://discourse.julialang.org/t/minimize-f-x-with-x-1/123307 "2024-12-01T07:21:05Z")

</div>

What is the simplest way to minimize f(x) with |x|=1 where x is a vector ? (I know the gradient of f) I’ve checked the example on Using Equality and Inequality Constraints · Optimization.jl but the solution calls AmplNL…

---

## [Struggle at using JuMP/MathOptInterface for calculating number of constraints](https://discourse.julialang.org/t/struggle-at-using-jump-mathoptinterface-for-calculating-number-of-constraints/116275)

<div class="topic-metadata">

**Author:** [@SSGD](https://discourse.julialang.org/u/SSGD)\
**Replies:** 6\
**Last updated:** [June 29, 2024, 4:59pm UTC](https://discourse.julialang.org/t/struggle-at-using-jump-mathoptinterface-for-calculating-number-of-constraints/116275 "2024-06-29T16:59:01Z")

</div>

Hello :smiley: I am using JuMP to solve a chance-constrained optimization, the original package is very old and I met issues of reproducing it. Following is one package I am trying to solve but stuck for more than a we…

---

## [How to maximize a scalar function of a scalar argument?](https://discourse.julialang.org/t/how-to-maximize-a-scalar-function-of-a-scalar-argument/115318)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [June 7, 2024, 12:24pm UTC](https://discourse.julialang.org/t/how-to-maximize-a-scalar-function-of-a-scalar-argument/115318 "2024-06-07T12:24:53Z")

</div>

I want to maximize a scala function, say NMaximize\[{1/(x - 1), -10 \< x \< 0}, {x}\] I tried: module test using Optimization, OptimizationOptimJL, NonlinearSolve function f(x, p) return 1 / (x - 1) end u0 = -0.5 p …

---

## [Enforcing nonneg. constraint in parameter Optimization](https://discourse.julialang.org/t/enforcing-nonneg-constraint-in-parameter-optimization/111298)

<div class="topic-metadata">

**Author:** [@paul188](https://discourse.julialang.org/u/paul188)\
**Replies:** 1\
**Last updated:** [March 10, 2024, 3:01pm UTC](https://discourse.julialang.org/t/enforcing-nonneg-constraint-in-parameter-optimization/111298 "2024-03-10T15:01:05Z")

</div>

(I moved this post to “New to Julia”) Hi, I am quite new to Julia, so this might be obvious, but I cannot figure it out. I have a model consisting of parameters and a set of ODEs. In the MWE below, I just substitute by…

---

## [Is using parallel computing to create JuMP constraints possible and useful?](https://discourse.julialang.org/t/is-using-parallel-computing-to-create-jump-constraints-possible-and-useful/109992)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 1\
**Last updated:** [February 9, 2024, 8:17pm UTC](https://discourse.julialang.org/t/is-using-parallel-computing-to-create-jump-constraints-possible-and-useful/109992 "2024-02-09T20:17:00Z")

</div>

I was wondering if there is any advantage to generate JuMP constraints with @threads regarding the CPU times. Threads.@threads for c in set\_curtailments @constraint(model, sum(x\[:, c\]) .\<= y\[c\] \* nrow(data\_s…

---

## [Converting GAMS to JuMP: Defining Sets](https://discourse.julialang.org/t/converting-gams-to-jump-defining-sets/108875)

<div class="topic-metadata">

**Author:** [@sati](https://discourse.julialang.org/u/sati)\
**Replies:** 8\
**Last updated:** [February 2, 2024, 2:14pm UTC](https://discourse.julialang.org/t/converting-gams-to-jump-defining-sets/108875 "2024-02-02T14:14:52Z")

</div>

Hi all, I want to convert GAMS script to JuMP, and I have problems dealing with the sets in GAMS. Here is the constraint in GAMS: eDemIR(d)… demIReal(d) + sum(l,line2dem(l,d)\*lineIReal(l)) =e= 0; l, d are sets in GAM…

---

## [SBRP problem with capacity os bus](https://discourse.julialang.org/t/sbrp-problem-with-capacity-os-bus/106719)

<div class="topic-metadata">

**Author:** [@Victor\_Neto](https://discourse.julialang.org/u/Victor_Neto)\
**Replies:** 5\
**Last updated:** [November 29, 2023, 7:23pm UTC](https://discourse.julialang.org/t/sbrp-problem-with-capacity-os-bus/106719 "2023-11-29T19:23:11Z")

</div>

I’m trying to model a problem with school transport routes, however, according to the code below, whenever the bus capacity is exceeded by the number of students, the code presents an error. I don’t know which constraint…

---

## [Status of constraint programming in JuMP](https://discourse.julialang.org/t/status-of-constraint-programming-in-jump/105580)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 3\
**Last updated:** [October 30, 2023, 7:45pm UTC](https://discourse.julialang.org/t/status-of-constraint-programming-in-jump/105580 "2023-10-30T19:45:03Z")

</div>

Now that MathOptInterface v1 supports constraint programming, what is the status of this modeling paradigm in the JuMP ecosystem? I found this checklist issue but it is a bit hard to parse for outsiders, so I wanted to m…
