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 /1100/

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.