Assign set index the values of a parameter

Problems with modeling
Post Reply
Luca
User
User
Posts: 13
Joined: 5 months ago

Assign set index the values of a parameter

Post by Luca » 5 months ago

Dear all,

I am new in the forum. I am using GAMS to model and solve a MIP. After the solve statement I would like to plot a function. I use the LIBINCLUDE Interface to Create Excel Charts from GAMS developed by T.F. Rutherford, see http://www.mpsge.org/xlchart/index.html. In order to plot the function I need to specify a domain which has to be a set index. Now, I need to assign to the set index the value of a parameter already defined. Is it possible? There are any idea you can suggest me?

Thanks in advance for all your effort.
Luca

User avatar
bussieck
Moderator
Moderator
Posts: 162
Joined: 2 years ago

Re: Assign set index the values of a parameter

Post by bussieck » 5 months ago

Luca,

I never worked with this package, so I can't answer your questions.

Nevertheless, nowadays I like to create my plots via Python's matplotlib and GAMS embedded code (see https://www.gams.com/latest/docs/UG_EmbeddedCode.html). You do need an up-to-date GAMS system and need to install the Python packages matplotlib and pandas (at least for the attached example). For that you open a cmd prompt cd into c:\gams\win64\25.1\GMSPython\scripts and run "pip install matplotlib pandas". Next you run the attached pickstock model and you will find some png files in your current directory:
weight.png
price.png
index.png
errors.png
-Michael
Attachments
pickstock.gms
(3.92 KiB) Downloaded 18 times
dowjones2016.csv
(259.67 KiB) Downloaded 16 times

Post Reply