maximum of a variable

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


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.

Denote y=max(x1,x2,…,xn), and then use these constraints: y>=x1, y>=x2,…, y>=xn.
Sent from my BlackBerry® smartphone
From:
Sender: gamsworld@googlegroups.com
Date: Thu, 29 Aug 2013 00:48:11 -0700 (PDT)
To:
ReplyTo: gamsworld@googlegroups.com
Subject: maximum of a variable

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


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.

Reply-to: gamsworld@googlegroups.com

Dear Justin,

thank you very much for your help.

Yet the problem is that if I had a small scale problem, this would be feasible (to write each variable as y=max(x1, x2,…xn)).

In my case what I need is how to replace y=max(x(i)), without using the max function as it does not work in this way.

Can I model it differently?

Thank you anyway,

Konstantinos


Τη Πέμπτη, 29 Αυγούστου 2013 11:06:18 π.μ. UTC+3, ο χρήστης Justin έγραψε:

Denote y=max(x1,x2,…,xn), and then use these constraints: y>=x1, y>=x2,…, y>=xn.
Sent from my BlackBerry® smartphone
From:
Sender: gams...@googlegroups.com
Date: Thu, 29 Aug 2013 00:48:11 -0700 (PDT)
To:
ReplyTo: gams...@googlegroups.com
Subject: maximum of a variable

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@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.

What I want to model is the following:

SUM(i,X(i)Z(i))=E=MAX(X(i));
set i /1
100/
where X(i) is a continuous non negative variable and Z(i) is a binary variable.

Any ideas how to find the maximum of variables X(i) without using function MAX??

Τη Πέμπτη, 29 Αυγούστου 2013 10:48:11 π.μ. UTC+3, ο χρήστης Κωνσταντίνος Πετρίδης έγραψε:

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


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 Konstantinos,

you might try :

EQ_XMAX(i) … Y =g= X(i) ;
EQ_SUMX … sum(i, X(i)*Z(i)) =e= Y ;

you need some convexity conditions on the objective function for this to work properly.
but if your model is “well behaved”, this should do the trick.

otherwise, you might want to give a try at DNLP solvers, which allow for explicit “MAX” in equations.
cheers

dax


Le jeudi 29 août 2013 16:28:37 UTC+2, Κωνσταντίνος Πετρίδης a écrit :

What I want to model is the following:

SUM(i,X(i)Z(i))=E=MAX(X(i));
set i /1
100/
where X(i) is a continuous non negative variable and Z(i) is a binary variable.

Any ideas how to find the maximum of variables X(i) without using function MAX??

Τη Πέμπτη, 29 Αυγούστου 2013 10:48:11 π.μ. UTC+3, ο χρήστης Κωνσταντίνος Πετρίδης έγραψε:

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


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 Dax,

thank you for your helpful reply.

I will try to implement it.

Konstantinos



Τη Παρασκευή, 30 Αυγούστου 2013 10:18:18 π.μ. UTC+3, ο χρήστης dax έγραψε:

hi Konstantinos,

you might try :

EQ_XMAX(i) … Y =g= X(i) ;
EQ_SUMX … sum(i, X(i)*Z(i)) =e= Y ;

you need some convexity conditions on the objective function for this to work properly.
but if your model is “well behaved”, this should do the trick.

otherwise, you might want to give a try at DNLP solvers, which allow for explicit “MAX” in equations.
cheers

dax


Le jeudi 29 août 2013 16:28:37 UTC+2, Κωνσταντίνος Πετρίδης a écrit :

What I want to model is the following:

SUM(i,X(i)Z(i))=E=MAX(X(i));
set i /1
100/
where X(i) is a continuous non negative variable and Z(i) is a binary variable.

Any ideas how to find the maximum of variables X(i) without using function MAX??

Τη Πέμπτη, 29 Αυγούστου 2013 10:48:11 π.μ. UTC+3, ο χρήστης Κωνσταντίνος Πετρίδης έγραψε:

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


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.

I believe that it is not necessary to use function max.

For example if you have one variable with two dimensions P(N,T) and you want to find for every N the maximum price you can write

P(N,T) =l= K(N);



Τη Παρασκευή, 30 Αυγούστου 2013 7:30:40 μ.μ. UTC+3, ο χρήστης Κωνσταντίνος Πετρίδης έγραψε:

hi Dax,

thank you for your helpful reply.

I will try to implement it.

Konstantinos



Τη Παρασκευή, 30 Αυγούστου 2013 10:18:18 π.μ. UTC+3, ο χρήστης dax έγραψε:

hi Konstantinos,

you might try :

EQ_XMAX(i) … Y =g= X(i) ;
EQ_SUMX … sum(i, X(i)*Z(i)) =e= Y ;

you need some convexity conditions on the objective function for this to work properly.
but if your model is “well behaved”, this should do the trick.

otherwise, you might want to give a try at DNLP solvers, which allow for explicit “MAX” in equations.
cheers

dax


Le jeudi 29 août 2013 16:28:37 UTC+2, Κωνσταντίνος Πετρίδης a écrit :

What I want to model is the following:

SUM(i,X(i)Z(i))=E=MAX(X(i));
set i /1
100/
where X(i) is a continuous non negative variable and Z(i) is a binary variable.

Any ideas how to find the maximum of variables X(i) without using function MAX??

Τη Πέμπτη, 29 Αυγούστου 2013 10:48:11 π.μ. UTC+3, ο χρήστης Κωνσταντίνος Πετρίδης έγραψε:

Hello all,

is there a function that would compute the maximum of a variable?

I checked in GAMS manual and I found function max, but is used when my problem is anallyticaly written i.e max(x1, x2,…xn).

How can I find the max of x(i) ( in algebraic form)?

I wrote max(x(i)) which provides me with an error and I tried smax(i,x(i)) but this is for parameters only.

Any ideas?

Konstantinos


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.