problem

37 views
Skip to first unread message

Elham Taghi

unread,
Feb 4, 2012, 4:16:30 AM2/4/12
to gams...@googlegroups.com
dear all
I have a problem with my objective function.my objective function is
Min ∑_j[(2bh∑_i∑_r liYijr (1-q)qr)1/2
my objective function has a power 1/2 and i dont know how show it in gams and my code is
sum(j,((2*b*h*l)**(0.5)*(sum((i,r),y(i,j,r)*(1-q)*(q**u(r))))**(0.5)))
 I want to know is it true or not
and in my model i have 3variable and all of them binary and two variable is free but when i solve with gams the output for my variables are between 0 and 1
how can i change my model and my solver rminlp maybe i chose my solver wrong???
thank u

Babak Saleck Pay

unread,
Feb 6, 2012, 4:24:45 AM2/6/12
to gams...@googlegroups.com
Hi
why did you choose "rminlp"?


--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
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.



--
Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran

Elham Taghi

unread,
Feb 6, 2012, 2:29:11 PM2/6/12
to gams...@googlegroups.com
hi
becuase i dont know choose any of solver and gams sugest me choose rminlp,minlp,.... and gams can solve my problem with out any errors with rminlp ..........which solver u sugest me???

Alireza Bahari

unread,
Feb 6, 2012, 4:42:21 PM2/6/12
to gams...@googlegroups.com
Hi
Send me your model. I reply you as soon.

Babak Saleck Pay

unread,
Feb 7, 2012, 1:24:46 AM2/7/12
to gams...@googlegroups.com
Hi

I don't know what is your problem exactly, but as I know, rminlp is
relaxed mixed integer nonlinear programming, as you can see. it's
"relaxed".

I suggest you try minlp. but don't forget that workng with "nlp"s is
not as easy as "mip"s and "lp"s. it does not assure optimal solution
and sometimes need an initial feasible solutions.

to change the solver, you can click on "file" and then "option", or in
your code before solve statement add this:

Option MINLP=solvername;

solver name is something link CPLEX or XPress or etc.

bests.


On 2/6/12, Elham Taghi <elha...@yahoo.com> wrote:
> hi
> becuase i dont know choose any of solver and gams sugest me choose
> rminlp,minlp,.... and gams can solve my problem with out any errors with
> rminlp ..........which solver u sugest me???
>
>

> ________________________________

Elham Taghi

unread,
Feb 7, 2012, 1:01:32 PM2/7/12
to gams...@googlegroups.com
hi my code is:
 
set
i "customers" /1*15/
j "distrubtion centers" /1*4/
t "demntion" /1/
r "level of failur" /0*3/
s "virtual disrubtion centers" /0*2/;
$onecho > book3.txt
i="%system.fp%data.xls"
r1=d!a1:f16
o1="%system.fp%d.inc"
r2=k!a1:b6
o2="%system.fp%k.inc"
r4=f!a1:b6
o4="%system.fp%f.inc"
r9=p!a1:b16
o9="%system.fp%p.inc"
r8=l!a1:b16
o8="%system.fp%l.inc"
$offecho
$call =xls2gms @book3.txt
Table d(i,j) "distance between i and j"
$include "%system.fp%d.inc";
table k(j,t)"capacity of disrubtion center j"
$include "%system.fp%k.inc";
table f(j,t)"fixed cost of disrubtion center j"
$include "%system.fp%f.inc";
table p(i,t)"penalty of customer i"
$include "%system.fp%p.inc";
table l(i,t)"demand of customers"
$include "%system.fp%l.inc";
scalar q "PROBABILITY failur of disrubtion centers" /0.1/;
scalar b "order cost of disrubtion center"/10/;
scalar h "holding cost of disrubtion center" /10/;
scalar w "weight of targets" /0.9/;
scalar kh "price of kharid" /10000/;
parameters
u(r) "parameter 1"
/0 0
1 1
2 2
3 3/
o(s) "parameter 2"
/0 0
1 1
2 2/;
variables
y(i,j,r) "DESIG of customer i to disrubtion center j in level r"
x(j) "opened disrubtion j"
z(i,s) "not design customer i to any disrubtion centers"
C "total target"
g "max favourit time"
Binary variables y,x,z;
Equations
target "define objective function"
constrain1 "constrain1"
constrain2 "constrain2"
constrain3 "constrain3"
constrain4"constrain4"
constrain5"constrain5";
constrain3(i,j).. sum(r,y(i,j,r))=l=1;
constrain4(j,t).. sum((i,r),l(i,t)*y(i,j,r))=l=k(j,t)*x(j);
constrain5(j).. sum((i,r),y(i,j,r))=l=x(j);
constrain2(i,r).. sum(j,y(i,j,r))+sum(s,z(i,s))=e=1;
constrain1(i,t).. sum((j,r),(l(i,t)*y(i,j,r)*d(i,j))*(1-q)*(q**u(r)))+sum(s,(l(i,t)*p(i,t)*z(i,s)*(q**o(s))))=l=g;
target(t)..w*(sum(j,f(j,t)*x(j))+sum(j,sum((i,r),l(i,t)*y(i,j,r)*kh*(1-q)*(q**u(r)))+(sum((i,r),2*b*h*l(i,t)*y(i,j,r)*(1-q)*(q**u(r))))**0.5))+(1-w)*g=e=C;
model reliability/all/;
solve reliability using rminlp min C;

Elham Taghi

unread,
Feb 16, 2012, 12:04:07 PM2/16/12
to gams...@googlegroups.com
hi every body
i wrote my code in gams and my solver is RMINLP but my code has error of lincence how can i give a better lincence plz help me

----- Forwarded Message -----
From: Elham Taghi <elha...@yahoo.com>
To: Alireza Bahari <alireza...@gmail.com>
Sent: Saturday, February 11, 2012 10:06 PM
Subject: Re: problem

hi Alireza
i sent u my data
From: Alireza Bahari <alireza...@gmail.com>
To: elha...@yahoo.com
Sent: Tuesday, February 7, 2012 10:20 PM
Subject: Re: problem

Hi Elham
If it possible, send me your data too.
data.xls
Reply all
Reply to author
Forward
0 new messages