gams display precision - tried all settings

Dear all,

I am having trouble displaying the optimal solution. I am sure that Gams is not displaying the solution correctly, when it passes 8 digits. I ve tried to output the solution via scientific formatting but no luck.

Currently I am solving a queuing model, and obtaining q, r, and z variables results.

Solve dual_queuing using LP minimizing z;
Display q.l,r.l, z.l;

I am interested in non-zero q’s - however the solution as provided is incomplete.

I ve tried the following as well:

file output /output.txt/;
output.nr = 2 ;
output.nd = 15 ;
output.nw = 0 ;
put output;
loop((i,j,Tall,u,v),
put i.tl, j.tl, Tall.tl, u.tl, v.tl, q.l(i,j,Tall,u,v)/
);
;


put the mimimum q value that I get ( apart from 0) is on the order of 10^-7 - and I m sure there must be smaller values than that. I ve tried converting the model into an mps and solving via gurobi shell and the optimal value is correct. However I have a serious issue in displaying here.

Any help appreciated thank you very much…

Ahmet


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/6mlgY1KHgGEJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Ahmet



The preset solution precision of the solver is 1E-7, so you have to change this (look for the options in the gams manual how to do this).


Cheers



Renger


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch







From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Ahmet Gurel
Sent: Sonntag, 13. Januar 2013 21:12
To: gamsworld@googlegroups.com
Subject: gams display precision - tried all settings



Dear all,



I am having trouble displaying the optimal solution. I am sure that Gams is not displaying the solution correctly, when it passes 8 digits. I ve tried to output the solution via scientific formatting but no luck.



Currently I am solving a queuing model, and obtaining q, r, and z variables results.



Solve dual_queuing using LP minimizing z;

Display q.l,r.l, z.l;



I am interested in non-zero q’s - however the solution as provided is incomplete.



I ve tried the following as well:



file output /output.txt/;

output.nr = 2 ;

output.nd = 15 ;

output.nw = 0 ;

put output;

loop((i,j,Tall,u,v),

put i.tl, j.tl, Tall.tl, u.tl, v.tl, q.l(i,j,Tall,u,v)/

);

;





put the mimimum q value that I get ( apart from 0) is on the order of 10^-7 - and I m sure there must be smaller values than that. I ve tried converting the model into an mps and solving via gurobi shell and the optimal value is correct. However I have a serious issue in displaying here.



Any help appreciated thank you very much…



Ahmet


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/6mlgY1KHgGEJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Ahmet,

There are two separate (but related) issues here: what values a solver should return and how to display those values.

Typically, “small values” are not significant so they are filtered out. This happens in many places: in applications when preparing data, in the solver, and in GAMS. The GAMS practice of rounding small values to zero in the display and put facilities is one facet of this, and is done to benefit the majority of users.

A consequence of this is that it can be difficult and frustrating to see very small values. But it is possible. The code below illustrates this. Note that the .nz put option is important here. Also, consider using GDX. For example, if you run with “gdx=aaa” and use the IDE’s GDX viewer you see all the values, even the small ones, displayed to almost full precision. The viewer doesn’t quite display full precision, not sure why.

set e / e0 * e27 /;
parameter a(e);
a(‘e0’) = 1.1e0;
loop{e$[ord(e) > 1],
a(e) = a(e-1) / 10;
};

file output /output.txt/;
output.nr = 2 ;
output.nd = 15 ;
output.nw = 0 ;
output.nz = 1e-30;
put output;
loop{e,
put 'a(‘e.tl’) = ’ a(e) /;
};


The question of what small values a solver should return is more subtle, but in they often filter out small values. There has been plenty written on this subject: e.g. search the GAMS list for scaling, especially Arne Drud’s posts.

-Steve


On Sun, Jan 13, 2013 at 3:12 PM, Ahmet Gurel wrote:

Dear all,

I am having trouble displaying the optimal solution. I am sure that Gams is not displaying the solution correctly, when it passes 8 digits. I ve tried to output the solution via scientific formatting but no luck.

Currently I am solving a queuing model, and obtaining q, r, and z variables results.

Solve dual_queuing using LP minimizing z;
Display q.l,r.l, z.l;

I am interested in non-zero q’s - however the solution as provided is incomplete.

I ve tried the following as well:

file output /output.txt/;
output.nr = 2 ;
output.nd = 15 ;
output.nw = 0 ;
put output;
loop((i,j,Tall,u,v),
put i.tl, j.tl, Tall.tl, u.tl, v.tl, q.l(i,j,Tall,u,v)/
);
;


put the mimimum q value that I get ( apart from 0) is on the order of 10^-7 - and I m sure there must be smaller values than that. I ve tried converting the model into an mps and solving via gurobi shell and the optimal value is correct. However I have a serious issue in displaying here.

Any help appreciated thank you very much…

Ahmet


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/6mlgY1KHgGEJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com