[AMPL 2804] Unbounded or bad scaled problem?

View: New views
3 Messages — Rating Filter:   Alert me  

[AMPL 2804] Unbounded or bad scaled problem?

by janachr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello!

I just tried the following in Lindo and it works. But in AMPL I have a
problem with my files. The AMPL says, my problem seems to be unbounded
or bad scaled. But it is not true... Please help!

The optimization problem in LINDO:
min 4x1 + 4x2 + 20x3 + 4x4 + 12x5 + 12x6
st
x1 + 4x2 + 2x5 + x6 = 75
x1 + 2x3 + x5 = 50
x1 + 3x4 + 2x6 = 110
end
gin x1
gin x2
gin x3
gin x4
gin x5
gin x6

The same task in AMPL:

set WIDTH;
set MUSTER;
param amount {MUSTER, WIDTH};
param waste {MUSTER};
param maxim {WIDTH} >0;
var muster {MUSTER} integer ;  # muster to be used

minimize Waste: sum {i in MUSTER} waste [i]*muster[i];

subject to Width {j in WIDTH}: sum { i in MUSTER} amount[i,j]*muster[i]
=maxim[j];

and data file:

param amount (tr) : m1 m2 m3 m4 m5 m6 :=
w24                           1    4   0     0    2   1
w32                           1    0   0     3    0   2
w40                           1    0   2     0    1   0  ;

param: MUSTER: waste :=
m1  4
m2  4
m3  20
m4  4
m5  12
m6  12 ;

param: WIDTH: maxim :=
w24  75
w32  110
w40  50 ;

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


[AMPL 2806] Re: Unbounded or bad scaled problem?

by Ashutosh Mahajan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


you probably need to tell ampl that muster is non-negative:
var muster {MUSTER} >= 0 integer ;  # muster to be used

cheers.
--
regards
Ashutosh Mahajan
http://coral.ie.lehigh.edu/~asm4



On Wed, 09 Sep 2009, janachr@... wrote:

>
> Hello!
>
> I just tried the following in Lindo and it works. But in AMPL I have a
> problem with my files. The AMPL says, my problem seems to be unbounded
> or bad scaled. But it is not true... Please help!
>
> The optimization problem in LINDO:
> min 4x1 + 4x2 + 20x3 + 4x4 + 12x5 + 12x6
> st
> x1 + 4x2 + 2x5 + x6 = 75
> x1 + 2x3 + x5 = 50
> x1 + 3x4 + 2x6 = 110
> end
> gin x1
> gin x2
> gin x3
> gin x4
> gin x5
> gin x6
>
> The same task in AMPL:
>
> set WIDTH;
> set MUSTER;
> param amount {MUSTER, WIDTH};
> param waste {MUSTER};
> param maxim {WIDTH} >0;
> var muster {MUSTER} integer ;  # muster to be used
>
> minimize Waste: sum {i in MUSTER} waste [i]*muster[i];
>
> subject to Width {j in WIDTH}: sum { i in MUSTER} amount[i,j]*muster[i]
> =maxim[j];
>
> and data file:
>
> param amount (tr) : m1 m2 m3 m4 m5 m6 :=
> w24                           1    4   0     0    2   1
> w32                           1    0   0     3    0   2
> w40                           1    0   2     0    1   0  ;
>
> param: MUSTER: waste :=
> m1  4
> m2  4
> m3  20
> m4  4
> m5  12
> m6  12 ;
>
> param: WIDTH: maxim :=
> w24  75
> w32  110
> w40  50 ;
>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


[AMPL 2809] Re: Unbounded or bad scaled problem?

by janachr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanx a lot!!! It works!

On 10 Sep., 16:21, Ashutosh Mahajan <a...@...> wrote:

> you probably need to tell ampl that muster is non-negative:
> var muster {MUSTER} >= 0 integer ;  # muster to be used
>
> cheers.
> --
> regards
> Ashutosh Mahajanhttp://coral.ie.lehigh.edu/~asm4
>
> On Wed, 09 Sep 2009, jana...@... wrote:
>
> > Hello!
>
> > I just tried the following in Lindo and it works. But in AMPL I have a
> > problem with my files. The AMPL says, my problem seems to be unbounded
> > or bad scaled. But it is not true... Please help!
>
> > The optimization problem in LINDO:
> > min 4x1 + 4x2 + 20x3 + 4x4 + 12x5 + 12x6
> > st
> > x1 + 4x2 + 2x5 + x6 = 75
> > x1 + 2x3 + x5 = 50
> > x1 + 3x4 + 2x6 = 110
> > end
> > gin x1
> > gin x2
> > gin x3
> > gin x4
> > gin x5
> > gin x6
>
> > The same task in AMPL:
>
> > set WIDTH;
> > set MUSTER;
> > param amount {MUSTER, WIDTH};
> > param waste {MUSTER};
> > param maxim {WIDTH} >0;
> > var muster {MUSTER} integer ;  # muster to be used
>
> > minimize Waste: sum {i in MUSTER} waste [i]*muster[i];
>
> > subject to Width {j in WIDTH}: sum { i in MUSTER} amount[i,j]*muster[i]
> > =maxim[j];
>
> > and data file:
>
> > param amount (tr) : m1 m2 m3 m4 m5 m6 :=
> > w24                           1    4   0     0    2   1
> > w32                           1    0   0     3    0   2
> > w40                           1    0   2     0    1   0  ;
>
> > param: MUSTER: waste :=
> > m1  4
> > m2  4
> > m3  20
> > m4  4
> > m5  12
> > m6  12 ;
>
> > param: WIDTH: maxim :=
> > w24  75
> > w32  110
> > w40  50 ;
>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---