GAMS result: Cannot handle function 'round'

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

Are you aware of any example of implementation of coevolutionary algorithms in GAMS?

Thank you
Pantelis Capros


Professor Pantelis CAPROS
National Technical University of Athens
School of Electrical and Computer Engineering
E3MLab - Energy Economy Environment Modelling Lab.
9 Iroon Polytechniou Str., Athens 15773, Greece
tel. +30 210 7723629, 3560, 3641, fax +30 210 7723630
GSM +30 6974933330
http://www.e3mlab.ntua.gr


On 7 February 2014 09:38, Κωνσταντίνος Πετρίδης wrote:

Hello,
the reason why GAMS cannot handle this function is because round, ceil, floor functions turn your model to dnlp. If you turn dnlp from minlp that you have now, gams will run the model.

hope I helped,

Konstantinos Petridis


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Konstantinos,

Thanks a lot.

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Mr. Capros,

Unfortunately, I am not.

Do you mean that I must apply a coevolutionary algorithm in GAMS to solve my model?

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Konstantinos,

Thank you very much for your response.

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Mr. Capros,

I do not know about it. Do you know I must implement coevolutionary algorithm to solve the model?

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Konstantinos,

Thank you very much.

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Mr. Capros,

I did not know about it. Do you mean that I can implement a coevolutionary algorithm to solve the model?

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear friends,

Thanks for your responses.

I did not know that coevolutionary algorithm can be implemented in GAMS. I would appreciate it if you introduce a reference.

Best regards.

On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear friends,

Thank you very much for your responses.

I did not know that coevolutionary algorithms can be implemented on GAMS. I would highly appreciate it if you introduce me a reference that can help.

Best regards.



On Friday, February 7, 2014 12:25:04 PM UTC+8, Zohreh wrote:

Dear Friends,
I have a round function in my model which cannot be handled by GAMS.
The round part is

round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)*(T1+T2))))))

which is repeated in three parts of the model.

The whole model is


SCALARS r1 the manufacturer capacity utilization /0.9/
r2 the supplier capacity utilization /0.8/
q deteriorating rate which is a fraction of the on-hand inventory /0.1/
F supplier setup cost per setup /200 /
A manufacturer ordering setup cost per cycle /50/
c supplier production cost per unit /5/
s the unit price charged by the supplier to the manufacturer /10/
b backorder cost /2/
h manufacturer inventory holding cost rate excluding interest charges /0.1/
j supplier inventory holding cost rate excluding interest charges /0.1/
Is supplier opportunity cost per dollar per unit time /0.02/
Ip manufacturer opportunity cost per dollar per unit time /0.06/
Ie manufacturer interest earned per dollar per unit time /0.04/
M the manufacturer trade credit period offered by the supplier / 0.166666666666667/
N the customer trade credit period offered by the manufacturer / 0.0821917808219178/
k constant in the manufacturer demand function representing his market scale /5000000/
e price elasticity of manufacturer demand rate which is alpha in the thesis /1.5/ ;

VARIABLES
z1 total net profit ;
POSITIVE VARIABLES
T1 production time with backorder at manufacturer’s side
T2 production time when positive stock builds up and the stock depletes due to the demand and deterioration at manufacturers side
v the unit price charged by the manufacturer to the customers ;
T1.lo = 0.01 ;
T2.lo = 0.01 ;
v.lo = 1 ;

INTEGER VARIABLES
g number of shipments from the supplier to the manufacturer per production run;
g.lo = 1;
g.up = 10;


Equations
Profit define objective function
Constraint condition for NP1
PriceConstraint constraint for price ;

Profit … z1 =e= (1/((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))((v-s)(k*(v**(-e)))((1/r1)T1+(T2+((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))))-A-(sh/q)(k(v**(-e)))(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1)))))-(b)((1/2)(T1**2)(k*(v**(-e)))((1/r1)-1)(1/r1))-s*(k*(v**(-e)))((1/r1)T2-(T2+((1/q)(log((1-(1/r1))exp(-qT2)+ 1/r1)))))+(vIe)((k(v**(-e))/(2r1))((M-N)2))-(sIp(k(v*(-e)))/q)(((1/r1)-1)T2-((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))) -vIp*(1/2)(k(v**(-e)))((N(2T2+2((1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))-N))+N(T1+N-M)(1/r1))+(s-c)((k*(v**(-e))/r1)(T1+T2))-F/(round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))- c(j+Is)(((k(v**(-e)))/r1)((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(T1+T2)(r2(1-((round(sqrt(F/(c*(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))/2))+(((round(sqrt(F/(c(j+Is)((-1/2)(1/((k*(v**(-e))(T1+T2))/(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+1/r1)))r1r2)))(((k*(v**(-e))/r1)2)((T1+T2)**2))+(1/2)(((1/r1)T1+T2+(1/q)(log((1-(1/r1))exp(-qT2)+(1/r1))))(k(v(-e))/r1)(T1+T2)))))))-1)/2)))-sIs*((k*(v**(-e))/r1)*(T1+T2)*M)) ;
Constraint … M =l= T1 ;
PriceConstraint … v =g= s ;



MODEL NetProfit /ALL/ ;
SOLVE NetProfit USING MINLP MAXIMIZING z1 ;
option decimals=8;
Display z1.l;
Display T1.l, T2.l, v.l, g.l;

execute_unload
parameter ms, ss;

ms=NetProfit.modelstat;
ss=NetProfit.solvestat;

Is there any other way to ask GAMS to give the nearest integer of a value?


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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.