$149 message error

Archive of Gamsworld Google Group
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: $149 message error

Post by Archiver »


Hi Kiran



You have to make sure that there is no equation for January (as you don’t have information on the December last year), so you add:

c1(j)$(ord(j) gt 1).. y(j-1) - y(j) + x(j) =e= d(j);



This drops the equation for January. Note that you must define the equations over the whole set.

You don’t need an alias (but you could have used i as an alias for j and keep your code with the j as well as the i index



Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Kiran Sopanrao Patil
Sent: Samstag, 2. April 2016 05:37
To: gamsworld@googlegroups.com
Subject: Re: $149 message error



Hi Renger,



That has worked. Thanks!



However, even though I have no errors, resulting in normal compilation, my model is turning in-feasible because of row 'c1'.



Below is my code -

sets

j number of month / jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec /

;



variables

x(j) number of CP32A units assembled in month j

y(j) inventory of CP32A at the end of month j

;



Positive Variables x, y



variable z;



Parameters

cap(j) historical CP32A assembly capacity in period i

/jan 6

feb 1

mar 1

apr 3

may 26

jun 17

jul 36

aug 20

sep 5

oct 16

nov 21

dec 2/



d(j) forecast of CP32A in month j

/jan 17

feb 17

mar 16

apr 16

may 15

jun 18

jul 17

aug 16

sep 15

oct 17

nov 15

dec 15/



equations obj,c1,c2,c3;

obj.. 0 =e= -z + 46164.5*(Sum(j,x(j))) + 100*(Sum(j,y(j)));

c1(j).. y(j-1) - y(j) + x(j) =e= d(j);

c2.. 200*(Sum(j,x(j))) =l= 2400;

c3(j).. x(j) =l= cap(j);

model CP32A /all/ ;

solve CP32A using lp minimizing z ;





Logically, I want -

Beginning inventory - Ending inventory + Production amount = Demand



What am I missing?

How exactly can I use 'alias'?



Thanks again,

Kiran.


Kiran Patil

Assistant Professor

Department of Mechanical Engineering

Sandip Institute of Engineering & Management

Nasik, MH, India

Cell: +91-9


Kiran Patil

Assistant Professor

Department of Mechanical Engineering

Sandip Institute of Engineering & Management

Nasik, MH, India

Cell: +91-9405128669



On Thu, Mar 31, 2016 at 1:42 PM, Renger van Nieuwkoop wrote:

Hi



In this equation

c3.. Sum(j,x(j)) =l= cap(i);

you have cap(i) on the right-hand side, but you don’t reference i:

This would work: C3(i).. Sum(j,x(j)) =l= cap(i);

But this doesn’t make much sense: total assembled in one year is in each month less than the monthly capacity. You are probably looking for something like c3(j).. x(j) =l= cap(j)



Some other hint: It is better to define the months as one set i, and alias it with j and define x,cap, and d over i.



Cheers

Renger









From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of kiran.patil@siem.org.in
Sent: Mittwoch, 30. März 2016 21:56
To: gamsworld
Subject: Re: $149 message error



Hi Renger,



I have tried your solution, for the same error 'uncontrolled set entered as constant'. But it has not worked for me, yet.



What am I missing?? Please enlighten, asap.



Below is my code -

sets

j number of month / jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec /

i number of month / j, f, m, ap, my, ju, jl, au, s, o, n, d /

;



integer variables

x(j) number of CP32A units assembled in month j

y(j) inventory of CP32A at the end of month j

;

variable z;



Parameters

cap(i) historical CP32A assembly capacity in month j

/j 6

f 1

m 1

ap 3

my 26

ju 17

jl 36

au 20

s 5

o 16

n 21

d 2/

d(j) forecast of CP32A in month j

/jan 17

feb 17

mar 16

apr 16

may 15

jun 18

jul 17

aug 16

sep 15

oct 17

nov 15

dec 15/



equations obj,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10;

obj.. 0 =e= -z + 46164.5*(Sum(j,x(j))) + 100*(Sum(j,y(j)));

c1.. Sum(j,(x(j)-d(j))) =g= 0;

c2.. 200*(Sum(j,x(j))) =l= 2400;

c3.. Sum(j,x(j)) =l= cap(i);



Thanks,

Kiran


On Wednesday, November 21, 2012 at 2:46:44 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Sener



Take a good look at your equations: you define demand as a single equation, but in the equation itself, you have the set h as index but on the left hand side you have q without an index.

demand..q =g=c(h) + d(h)*p(h);



so GAMS gets confused:

This would work better





Equation demand;



Demand..q=g=sum(h, c(h) + d(h)*p(h));



Or:



Equation demand(h);



Demand(h)..q(h) =g=c(h) + d(h)*p(h);



Cheers





____________________

Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

In...@modelworks.ch

blog.modelworks.ch













Von: gams...@googlegroups.com [mailto:gams...@googlegroups.com] Im Auftrag von Sener Salci
Gesendet: Mittwoch, 21. November 2012 06:49
An: gams...@googlegroups.com
Betreff: Re: $149 message error



Hi



I also need help PLSSSSS



I have equilibrium model such that



h= 7 days and I want equilibrium for each day seperatelly given the firms

f=4 firms



h=1,2,3,4,5,6,7

f=f1,f2,f3,f4

I define demand function as demand(h)=a+bP

I define supply function for each firm as supply(h)=c+dP



Therefore, I define a and b demand parameters for each day. Also,c and d are cost parameters for each firm!



At the equilibrium D=S



equations

demand

supply;



demand..q =g=c(h) + d(h)*p(h)=;

supply.. a(i) + b(i)*q(i)=g=p(h);



model equilibrium /supply.q, demand.p/;



solve equilibrium using mcp;



i want to find both equilibrium price and quantities. I want to see that may be 2 firms will sell in the market because they charge lower than other firms.



I have the same problem, it says for each parameter I define above, demand and supply - uncontrolled set entered as constant: 149.



hope you can help me.



thanks




On Saturday, October 15, 2011 11:38:31 AM UTC, alice wrote:

hi.

i am a new user in gams, so any help would be grateful!!!

i have created a set where time /t1*t40/
types /inputs, outputs /

Alias (time, t)
(types, j);

and created a table where prices(t, j) are depicted. By pressing F9
status is normal completion.

The problem i am facing is the below:
i have placed the variables c(j), p (j) also named the equation as
RCon but by writting down the equation

R(n) =E= sum(j, c(j)*prices(t, j)) + sum (j, p(j)*prices(t, j)) the
$149 error message is appeared.

Any idea?

Thanks in advance,

Alice.

--
To view this discussion on the web visit https://groups.google.com/d/msg/gamswor ... 7v3FixsaUJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "gamsworld" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamsw ... nsubscribe.
To unsubscribe from this group and all its topics, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.



--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: $149 message error

Post by Archiver »


Thanks for being with me all the way, Renger.

Your solution helped me!

Plus, I changed my formulation to a transportation simplex to get a sensible solution.

Regards,
Kiran

Kiran Patil
Assistant Professor
Department of Mechanical Engineering
Sandip Institute of Engineering & Management
Nasik, MH, India
Cell: +91-9405128669

On Sun, Apr 3, 2016 at 9:29 PM, Renger van Nieuwkoop wrote:

Hi Kiran



You have to make sure that there is no equation for January (as you don’t have information on the December last year), so you add:

c1(j)$(ord(j) gt 1).. y(j-1) - y(j) + x(j) =e= d(j);



This drops the equation for January. Note that you must define the equations over the whole set.

You don’t need an alias (but you could have used i as an alias for j and keep your code with the j as well as the i index



Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Kiran Sopanrao Patil
Sent: Samstag, 2. April 2016 05:37
To: gamsworld@googlegroups.com

Subject: Re: $149 message error



Hi Renger,



That has worked. Thanks!



However, even though I have no errors, resulting in normal compilation, my model is turning in-feasible because of row 'c1'.



Below is my code -

sets

j number of month / jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec /

;



variables

x(j) number of CP32A units assembled in month j

y(j) inventory of CP32A at the end of month j

;



Positive Variables x, y



variable z;



Parameters

cap(j) historical CP32A assembly capacity in period i

/jan 6

feb 1

mar 1

apr 3

may 26

jun 17

jul 36

aug 20

sep 5

oct 16

nov 21

dec 2/



d(j) forecast of CP32A in month j

/jan 17

feb 17

mar 16

apr 16

may 15

jun 18

jul 17

aug 16

sep 15

oct 17

nov 15

dec 15/



equations obj,c1,c2,c3;

obj.. 0 =e= -z + 46164.5*(Sum(j,x(j))) + 100*(Sum(j,y(j)));

c1(j).. y(j-1) - y(j) + x(j) =e= d(j);

c2.. 200*(Sum(j,x(j))) =l= 2400;

c3(j).. x(j) =l= cap(j);

model CP32A /all/ ;

solve CP32A using lp minimizing z ;





Logically, I want -

Beginning inventory - Ending inventory + Production amount = Demand



What am I missing?

How exactly can I use 'alias'?



Thanks again,

Kiran.


Kiran Patil

Assistant Professor

Department of Mechanical Engineering

Sandip Institute of Engineering & Management

Nasik, MH, India

Cell: +91-9


Kiran Patil

Assistant Professor

Department of Mechanical Engineering

Sandip Institute of Engineering & Management

Nasik, MH, India

Cell: +91-9405128669



On Thu, Mar 31, 2016 at 1:42 PM, Renger van Nieuwkoop wrote:

Hi



In this equation

c3.. Sum(j,x(j)) =l= cap(i);

you have cap(i) on the right-hand side, but you don’t reference i:

This would work: C3(i).. Sum(j,x(j)) =l= cap(i);

But this doesn’t make much sense: total assembled in one year is in each month less than the monthly capacity. You are probably looking for something like c3(j).. x(j) =l= cap(j)



Some other hint: It is better to define the months as one set i, and alias it with j and define x,cap, and d over i.



Cheers

Renger









From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of kiran.patil@siem.org.in
Sent: Mittwoch, 30. März 2016 21:56
To: gamsworld
Subject: Re: $149 message error



Hi Renger,



I have tried your solution, for the same error 'uncontrolled set entered as constant'. But it has not worked for me, yet.



What am I missing?? Please enlighten, asap.



Below is my code -

sets

j number of month / jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec /

i number of month / j, f, m, ap, my, ju, jl, au, s, o, n, d /

;



integer variables

x(j) number of CP32A units assembled in month j

y(j) inventory of CP32A at the end of month j

;

variable z;



Parameters

cap(i) historical CP32A assembly capacity in month j

/j 6

f 1

m 1

ap 3

my 26

ju 17

jl 36

au 20

s 5

o 16

n 21

d 2/

d(j) forecast of CP32A in month j

/jan 17

feb 17

mar 16

apr 16

may 15

jun 18

jul 17

aug 16

sep 15

oct 17

nov 15

dec 15/



equations obj,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10;

obj.. 0 =e= -z + 46164.5*(Sum(j,x(j))) + 100*(Sum(j,y(j)));

c1.. Sum(j,(x(j)-d(j))) =g= 0;

c2.. 200*(Sum(j,x(j))) =l= 2400;

c3.. Sum(j,x(j)) =l= cap(i);



Thanks,

Kiran


On Wednesday, November 21, 2012 at 2:46:44 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Sener



Take a good look at your equations: you define demand as a single equation, but in the equation itself, you have the set h as index but on the left hand side you have q without an index.

demand..q =g=c(h) + d(h)*p(h);



so GAMS gets confused:

This would work better





Equation demand;



Demand..q=g=sum(h, c(h) + d(h)*p(h));



Or:



Equation demand(h);



Demand(h)..q(h) =g=c(h) + d(h)*p(h);



Cheers





____________________

Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

In...@modelworks.ch

blog.modelworks.ch













Von: gams...@googlegroups.com [mailto:gams...@googlegroups.com] Im Auftrag von Sener Salci
Gesendet: Mittwoch, 21. November 2012 06:49
An: gams...@googlegroups.com
Betreff: Re: $149 message error



Hi



I also need help PLSSSSS



I have equilibrium model such that



h= 7 days and I want equilibrium for each day seperatelly given the firms

f=4 firms



h=1,2,3,4,5,6,7

f=f1,f2,f3,f4

I define demand function as demand(h)=a+bP

I define supply function for each firm as supply(h)=c+dP



Therefore, I define a and b demand parameters for each day. Also,c and d are cost parameters for each firm!



At the equilibrium D=S



equations

demand

supply;



demand..q =g=c(h) + d(h)*p(h)=;

supply.. a(i) + b(i)*q(i)=g=p(h);



model equilibrium /supply.q, demand.p/;



solve equilibrium using mcp;



i want to find both equilibrium price and quantities. I want to see that may be 2 firms will sell in the market because they charge lower than other firms.



I have the same problem, it says for each parameter I define above, demand and supply - uncontrolled set entered as constant: 149.



hope you can help me.



thanks




On Saturday, October 15, 2011 11:38:31 AM UTC, alice wrote:

hi.

i am a new user in gams, so any help would be grateful!!!

i have created a set where time /t1*t40/
types /inputs, outputs /

Alias (time, t)
(types, j);

and created a table where prices(t, j) are depicted. By pressing F9
status is normal completion.

The problem i am facing is the below:
i have placed the variables c(j), p (j) also named the equation as
RCon but by writting down the equation

R(n) =E= sum(j, c(j)*prices(t, j)) + sum (j, p(j)*prices(t, j)) the
$149 error message is appeared.

Any idea?

Thanks in advance,

Alice.

--
To view this discussion on the web visit https://groups.google.com/d/msg/gamswor ... 7v3FixsaUJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "gamsworld" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamsw ... nsubscribe.
To unsubscribe from this group and all its topics, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.



--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "gamsworld" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamsw ... nsubscribe.
To unsubscribe from this group and all its topics, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Post Reply