# How to change the RHS for a set of constraints and solve the problem iteratively using JuMP?

**URL:** <https://discourse.julialang.org/t/how-to-change-the-rhs-for-a-set-of-constraints-and-solve-the-problem-iteratively-using-jump/22069>\
**Category:** General Usage\
**Tags:** jump\
**Created:** [March 19, 2019, 7:40pm UTC](https://discourse.julialang.org/t/how-to-change-the-rhs-for-a-set-of-constraints-and-solve-the-problem-iteratively-using-jump/22069 "2019-03-19T19:40:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)\
**Post date:** [March 19, 2019, 8:02pm UTC](https://discourse.julialang.org/t/how-to-change-the-rhs-for-a-set-of-constraints-and-solve-the-problem-iteratively-using-jump/22069/2 "2019-03-19T20:02:21Z")

</div>

Please try to format your code to make it more readable. This is explained in [PSA: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

It looks like you are create many constraints in nested loops, but always reuse the same identifier `Demandsconst`. You can not refer to all of these constraints with a single name.

Try moving the loops “into” the `@constraint` macro call and storing the constraint references in an array, like `@constraint(IMTLP, Demandsconst[t in 1:n_echelons, ...], ...)` as described in the JuMP docs.

Later you will have to update the right-hand side of all these constraints individually, I guess.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-change-the-rhs-for-a-set-of-constraints-and-solve-the-problem-iteratively-using-jump/22069)._
