Bruce McCarl’s GAMS Newsletter Number 17

GAMS 21.5 release

GAMS Corporation just released version 21.5 which expands some language capabilities and includes new solver libraries for several solvers. It also includes the new interior-point NLP solver KNITRO. Release notes are available on the GAMS web site at http://www.gams.com/docs/release/release.htm#21.5.  Some of the new features within this release are discussed below.  The software can be downloaded from http://www.gams.com/download/.

Speed Issues

As discussed in the last newsletter GAMS, has been working on execution speed.  Under some circumstances (generally involving leads and lags and index ordering) version 21.4 had some difficulties and version 21.5 corrects those. 

 

I recently discovered a major speed enhancement that when tested can reduce execution speeds for minutes to under a second for certain types of slow statements.  In particular, suppose I want to define a parameter that contains sums of numbers within a more complex parameter where the numbers involved are drawn from the middle of the more complex item.  For example,  

 

Z(I,L,N)=sum((K,J,M),Y(I,J,K,L,M))

 

I have found cases where this can be made much faster by coding it as follows

 

Z(I,L,N)=0;

Loop((I,J,K,L,M)$Y(I,J,K,L,M),

     Z(I,L,N)= Z(I,L,N)+Y(I,J,K,L,M));

 

Naturally you should not do this unless you find the statement to be slow using the profile and profiletol options as discussed in the speed chapter of the McCarl User Guide.  See Speeding up GAMS.

Solvers

Solver capability upgrades are present for CONOPT, CPLEX, MOSEK, XA and XPRESS.  Also, a new interior point NLP solver, KNITRO, has been introduced. Documentation for KNITRO is available from http://www.gams.com/solvers/knitro.pdf.

Put enhancement

A new feature has been added to put files that simplifies adding in several lines of text.  In particular new statements are present that are $onput and $offput that results in all the statements in between being placed into the currently active put file.  Namely

 

set i /1*2/;

file myput

put myput

loop(i,put 'Before set i ' i.tl /);

put '****************' /

$onput

Hello

this is line 1

this is line 2

$offput

put '****************' /

loop(i,put 'After set i ' put i.tl /);

 

results in the file myput.put that contains

 

                 Before set i 1

Before set i 2

****************

Hello

this is line 1

this is line 2

****************

After set i 1

After set i 2

 

Note this set of $ commands differs from all others in GAMS in that they are executed at execution time not at compile time.

Ordering and set elements

Some new features have been entered on set ordering.  Namely the universal set is not in a sorted order and can be used with the ord command or set leads and lags.  Furthermore a new function SortedUels(*,*) allows one to work with elements in the universal set that correspond to individual elements.  I have not worked with this much but it may ease frustration of some who desire to use leads and lags and ord on computed sets.  See the example below

 

set i /1*2/;

set j   this set will be regarded by gams as un ordered /0*6/;

set k(j) this set is computed;

k(j)=yes;

file myput

put myput

alias(*,u,u1);

display u;

loop(SortedUels(u,j),

    put ' j as an universal set element ' j.tl ' order ' ord(u) /);

put /

loop(j,

    put ' j as an individual set element ' j.tl  /);

put /

loop((u,j,u1,k)$(SortedUels(u,j) and SortedUels(u1,k) and ord(u)=ord(u1)),

    put ' element j ' j.tl ' is same in order as element k ' k.tl   /);

 

Herein the sets j and k could not have been used with ord but I can use it on corresponding elements in u and u1.  Note however that the elements are in sorted order not in the normal order one might expect (j will be 1,2,0,3,4,5,6 naturally but becomes 0,1,2,3,4,5,6 when used in association with the sorted uel order).

Other features

The release notes indicate 21.5 also contains

 

·        New entries in the model and test model libraries.

·        New functions: sinh, cosh, tanh

·        $on/offVerbatim commands for use with the GAMS parameter DUMPOPT

·        $setDDlist that causes GAMS to catch misspelled 'double dash' parameters

Courses offered

I teach Basic GAMS  in College Station Nov 30-Dec 3, 2004. An Advanced GAMS class will be offered  January 4-7, 2005.  Further information and other courses are listed on http://www.gams.com/courses.htm.

 

Unsubscribe to future issues of this newsletter

 

To remove your name, send an email to mailto:mccarl-news-request@gams.com containing unsubscribe on the subject line or unsubscribe through the web at http://www.gams.com/maillist/newsletter.htm.

 

This newsletter is not a GAMS Corporation product but it is distributed with their cooperation.

 

November 11, 2004