« Return to Thread: [AMPL 2612] change variable bound

[AMPL 2620] Re: change variable bound

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View in Thread



The best way to change an upper bound is to define a parameter to represent
it.  For example, in this case, you could say

   param x_ub > 0, default 1.0;
   var x {i in 1..1000} >= 0.1, <= x_ub;

Initially x_ub will be 1.0 by default, but you can change this bound to 0.8
by means of the command "let x_ub := 0.8;".

-- Bob


> -----Original Message-----
> From: ampl@... [mailto:ampl@...]
> On Behalf Of Ali Baharev [ali.baharev@...]
> Sent: Friday, June 26, 2009 9:23 AM
> To: ampl@...
> Subject: [AMPL 2612] change variable bound
>
>
> I would like to change the upper bound of x[28] from 1.0 to 0.8 in
>
> var x{ i in 1..1000} >= 0.1, <= 1.0;
>
> How can i do that?
>
> Any help is appreciated,
>
> Ali
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: [AMPL 2612] change variable bound