You could think of writing
subject to constraint_5 {g in interval(0,30)}: tan(g*(pi/180)) >= y;
But this would define an infinite number of constraints, and so AMPL rejects it, with the error message "Attempt to iterate over an interval". Instead you could try to define one constraint like this:
subject to constraint_5: forall {g in interval(0,30)} tan(g*(pi/180)) >= y;
But AMPL rejects this with the same error message. Basically, AMPL will reject any statement that contains indexing, explicit or implicit, over a continuous interval.
(In this particular case you could reason that since tan(0) = 0 and the tan function is increasing from 0 to 30, the constraint is equivalent to 0 >= y.)
--
Robert Fourer
am...@googlegroups.com