Hi guys, i have a set j from j=1 to j=20 (j=1, 2, 3...20)
And i have a constraint:
const(j)... equation
But i need to apply this constraint just for specific j. In this const. just for j=1, j=4, j=7, j=10, j=13, j=16, j=19 (the last one plus 3)
How can i implement this?
Equation Domain Restriction
Re: Equation Domain Restriction
You can simply write
const(i)$(mod(ord(i), 3) eq 1).. equation
mod(a, b) gives remainder when a is divided by b.
The above mentioned constraint is valid only for the elements 1,4, 7,... and so on
You can similarly use any condition on the set using $ and ord.
Hope this helps
- Atharv
const(i)$(mod(ord(i), 3) eq 1).. equation
mod(a, b) gives remainder when a is divided by b.
The above mentioned constraint is valid only for the elements 1,4, 7,... and so on
You can similarly use any condition on the set using $ and ord.
Hope this helps
- Atharv