1 / 7

GAMS Links

GAMS Links. Text Excel Graphics Geographic Maps Powerpoint. Text Output. SET set1 /labor, water/ PARAMETER value(set1); value(set1) = ord(set1); FILE output1 /name.txt/; PUT output1; Output1.lw=0; Output1.nd=2; LOOP(set1, PUT @3 set1.tl," has a value of ",value(set1) /; );

barbie
Download Presentation

GAMS Links

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GAMS Links Text Excel Graphics Geographic Maps Powerpoint

  2. Text Output SET set1 /labor, water/ PARAMETER value(set1); value(set1) = ord(set1); FILE output1 /name.txt/; PUT output1; Output1.lw=0; Output1.nd=2; LOOP(set1, PUT @3 set1.tl," has a value of ",value(set1) /; ); PUTCLOSE;

  3. Text Input $call awk -f script.awk data.txt > data.gms Raw data in text format Processed data in GAMS format

  4. Load Input from Excel Parameter NewData(Set1,Index2); $CALL GDXXRW data.xls Par=NewData Rng=Sheet1!a1:e15 Rdim=1 Cdim=1 $GDXIN Data.gdx $LOAD NewData $GDXIN This statement must remain on one single line!

  5. GAMS Example SETS Period, Region, Soil, Crop; Parameter water_report(period,region,soil,crop); $CALL GDXXRW landmodel.xls DSet=crop Rng=water!d1:f1 Rdim=0 Cdim=1 DSet=soil Rng=water!c2 Rdim=1 Cdim=0 DSet=period Rng=water!a2 Rdim=1 Cdim=0 DSet=region Rng=water!b2 Rdim=1 Cdim=0 Par=water_report Rng=water!a1 Rdim=3 Cdim=1 $GDXIN landmodel.gdx $LOAD period region soil crop water_report $GDXIN DISPLAY water_report;

  6. Save Output to Excel Parameter water_report(period,region,soil,crop); water_report(period,region,soil,crop) = …; Execute_Unload 'model_report' water_report; Execute 'gdxxrw model_report.gdx Output=landmodel.xls Par=water_report Rng=water!A1 Rdim=3 Cdim=1'; This statement must remain on one single line!

  7. GAMS Example SETS Period /January,March/ Region /World,Austria,Kenya/ Soil /Sand,Clay/ Crop /Cassava,Turnips,Figus/ ; Parameter water_report(period,region,soil,crop); water_report(period,region,soil,crop) = normal(200,10); Execute_Unload 'model_report' water_report; Execute 'gdxxrw model_report.gdx Output=landmodel.xls Par=water_report Rng=water!A1 Rdim=3 Cdim=1';

More Related