# How to set @variable(m, tau\[1:N\] \>0 ) with JuMP

**URL:** <https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244>\
**Category:** Optimization (Mathematical)\
**Created:** [June 12, 2020, 5:42am UTC](https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244 "2020-06-12T05:42:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![namch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/namch/32/15606_2.png) [@namch](https://discourse.julialang.org/u/namch)\
**Post date:** [June 12, 2020, 5:42am UTC](https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244/1 "2020-06-12T05:42:20Z")

</div>

I get an error when trying to set variables larger than zero. Is there any way to over come this?

ERROR: LoadError: LoadError: In `@variable(m, tau[1:N] > 0)`: Unknown sense \>

Thank you

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [June 12, 2020, 7:27am UTC](https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244/2 "2020-06-12T07:27:18Z")

</div>

I am not sure to understand what you are trying to do. Can you share the error and a minimal code reproducing it?  
See [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) for more details.

---

<div class="post-metadata">

**Author:** ![namch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/namch/32/15606_2.png) [@namch](https://discourse.julialang.org/u/namch)\
**Post date:** [June 12, 2020, 7:47am UTC](https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244/3 "2020-06-12T07:47:06Z")

</div>

Thank you for your help. I have updated the error.

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [June 12, 2020, 8:14am UTC](https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244/4 "2020-06-12T08:14:58Z")

</div>

Thanks, it’s much clearer now. You cannot use strict constraints in JuMP (no solver supports it anyway).  
You can use `@variable(m, tau[1:N] >= 0)` if you are ok with the variable being zero. Otherwise, you need to model things differently but it’s difficult to give recommendation without more context on what you are trying to do.

---

<div class="post-metadata">

**Author:** ![namch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/namch/32/15606_2.png) [@namch](https://discourse.julialang.org/u/namch)\
**Post date:** [June 15, 2020, 8:10am UTC](https://discourse.julialang.org/t/how-to-set-variable-m-tau-1-n-0-with-jump/41244/5 "2020-06-15T08:10:45Z")

</div>

Thank you for your help. I fixed it by very small number, e.g. 10^-8
