# How to build a constraint with summation?

**URL:** <https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [June 17, 2020, 6:20pm UTC](https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618 "2020-06-17T18:20:39Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![RaquelSantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raquelsantos/32/3668_2.png) [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Post date:** [June 29, 2020, 8:16pm UTC](https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618/12 "2020-06-29T20:16:00Z")

</div>

@chisquared

The error that appears is exactly this `BoundsError: attempt to access 8-element Array{Int64,1} at index [1,5]`

---

_[View the full topic](https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618)._
