# Creating a collection of ordered tuple

**URL:** <https://discourse.julialang.org/t/creating-a-collection-of-ordered-tuple/11507>\
**Category:** Optimization (Mathematical)\
**Created:** [June 7, 2018, 3:28pm UTC](https://discourse.julialang.org/t/creating-a-collection-of-ordered-tuple/11507 "2018-06-07T15:28:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharabh\_Shukla](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@Sharabh\_Shukla](https://discourse.julialang.org/u/Sharabh_Shukla)\
**Post date:** [June 7, 2018, 3:28pm UTC](https://discourse.julialang.org/t/creating-a-collection-of-ordered-tuple/11507/1 "2018-06-07T15:28:25Z")

</div>

Hi All,

I am relatively new to Julia, moving from GAMS and AMPL. I am building a JuMP mode, for Distribution Optimal power Flow. The grid is mostly radial, so I am thinking of creating a collection of order tuples (branches, sending\_node, receiving\_node). This then permits me to write each branch voltage drop constraints as V(sending\_node) - V(receiving\_node) - r(branches)\*i(branches) = 0, Where each branch has a sending node and receiving node.

I was thinking if I could create a bunch of ordered tuples, I can iterate these constraints over the indices present in the tuples.

Any ideas on how I can write this??

Thanks

---

<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:** [June 9, 2018, 9:46pm UTC](https://discourse.julialang.org/t/creating-a-collection-of-ordered-tuple/11507/2 "2018-06-09T21:46:53Z")

</div>

Hey @Sharabh_Shukla,

You can find documentation for JuMP here:  
[http://www.juliaopt.org/JuMP.jl/0.18/quickstart.html](http://www.juliaopt.org/JuMP.jl/0.18/quickstart.html)

There are also lots of examples on Github, for example:  
[https://github.com/JuliaOpt/JuMP.jl/blob/v0.18.1/examples/transp.jl](https://github.com/JuliaOpt/JuMP.jl/blob/v0.18.1/examples/transp.jl)

You might also be interested in [GitHub - lanl-ansi/PowerModels.jl: A Julia/JuMP Package for Power Network Optimization](https://github.com/lanl-ansi/PowerModels.jl)
