# Change the constraints name iteratively to JUMP model

**URL:** <https://discourse.julialang.org/t/change-the-constraints-name-iteratively-to-jump-model/81359>\
**Category:** Optimization (Mathematical)\
**Created:** [May 20, 2022, 10:56am UTC](https://discourse.julialang.org/t/change-the-constraints-name-iteratively-to-jump-model/81359 "2022-05-20T10:56:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayodyas](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@ayodyas](https://discourse.julialang.org/u/ayodyas)\
**Post date:** [May 20, 2022, 10:56am UTC](https://discourse.julialang.org/t/change-the-constraints-name-iteratively-to-jump-model/81359/1 "2022-05-20T10:56:48Z")

</div>

I am new to JUMP model and Julia,

I have created a JUMP model, with a constraint inside a while loop

I wanted to change the constraint name in each iteration and optimize the model again

for example:  
if i=1  
@constraint(model, constraint\_1[t=1:nt], flow\<= maxflow])

optimise(model)

again if i=2  
@constraint(model, constraint\_2[t=1:nt], flow\>= minflow])  
optimise(model)

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 22, 2022, 8:34pm UTC](https://discourse.julialang.org/t/change-the-constraints-name-iteratively-to-jump-model/81359/2 "2022-05-22T20:34:12Z")

</div>

Hi @ayodyas, I’m not really sure what you mean by changing the constraint names? Do you want to add new constraints? Or delete `constraint_1` and add `constraint_2`?

Is `flow` a variable and `maxflow` a constant? If so, you can use `set_lower_bound` and `delete_upper_bound` to add and remove different bounds.

- [Variables · JuMP](https://jump.dev/JuMP.jl/stable/manual/variables/#Create,-delete,-and-modify-variable-bounds)

Otherwise you can delete constraints:

- [Constraints · JuMP](https://jump.dev/JuMP.jl/stable/manual/constraints/#Delete-a-constraint)

p.s., You might want to take a read of [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757). It explains how to format your code, and it’s easier to help if you can provide a fully reproducible example.
