Hi. My problem is suppose I have 5 hours and hence 5 variables and i want that variables to lie between 0 to 500 with the constraint that next variable should lie between X(previous)-60<X(new)<X(previous)+180. First variable can be any. Apart from this each variable can either be 0 or 50% i.e 250 or lie between 250 to 500 following the previous constraint (of consecutive values). I am able to put the first constraint X(previous)-60<X(new)<X(previous)+180 but stuck up in 2nd one. It takes any value between 0 to 250 in between. Objective function is set.