{"id":80,"date":"2023-11-10T12:22:45","date_gmt":"2023-11-10T12:22:45","guid":{"rendered":"https:\/\/dataenvelopment.com\/gams\/?p=80"},"modified":"2024-03-25T10:54:25","modified_gmt":"2024-03-25T10:54:25","slug":"chapter-1-fig-1-05","status":"publish","type":"post","link":"https:\/\/dataenvelopment.com\/gams\/chapter-1-fig-1-05\/","title":{"rendered":"Chapter 1 (Fig. 1.05) &#8211; Mathematical formulation of the transportation model and the corresponding GAMS formulation &#8211; importing data to GAMS"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">$Title Chapter 1 (Fig. 1.5)\r\n$Title An example of importing data from Excel to GAMS\r\n$Title Data for supply (Si), demand (Dj), and unit transportation cost (ci,j)\r\n$Title You need to save the dataset \"Chapter1_data.xls\" in the same folder of this file.\r\n\r\n$onText\r\n\r\nIf using this code, please cite:\r\n\r\n---------------------------------------------------------------------------------\r\nEmrouznejad, A., P. Petridis, and V. Charles (2023). Data Envelopment Analysis\r\nwith GAMS: A Handbook on Productivity Analysis, and Performance Measurement,\r\nSpringer, ISBN: 978-3-031-30700-3.\r\n---------------------------------------------------------------------------------\r\n\r\nWebsite: https:\/\/dataenvelopment.com\/GAMS\/\r\n\r\n$offText\r\n\r\nSets i Plants \/Plant1*Plant3\/\r\n     j Markets \/Market1*Market4\/;\r\n\r\n$CALL GDXXRW.EXE Chapter1_data.xls par=S rng=Sheet1!B3:C5 Rdim=1\r\nParameter S(i);\r\n$GDXIN Chapter1_data.gdx\r\n$LOAD S\r\n$GDXIN\r\n\r\n$CALL GDXXRW.EXE Chapter1_data.xls par=D rng=Sheet1!E3:F6 Rdim=1\r\nParameter D(j);\r\n$GDXIN Chapter1_data.gdx\r\n$LOAD D\r\n$GDXIN\r\n\r\n$CALL GDXXRW.EXE Chapter1_data.xls par=c rng=Sheet1!H3:L6  Cdim=1 Rdim=1\r\nParameter c(i,j);\r\n$GDXIN Chapter1_data.gdx\r\n$LOAD c\r\n$GDXIN\r\n\r\nVariables\r\nTC Total cost\r\n\r\nNonnegative variables\r\nx(i,j) quantity transported from plant i to market j\r\n\r\nEquations\r\nTotalCost objective function\r\nSupply(i) supply constraint\r\nDemand(j) demand constraint;\r\n\r\nTotalCost.. TC=E=SUM(i,SUM(j,c(i,j)*x(i,j)));\r\n\r\nSupply(i).. SUM(j,x(i,j))=L=S(i);\r\nDemand(j).. SUM(i,x(i,j))=G=D(j);\r\n\r\nModel Transportation_example \/All\/\r\nSolve Transportation_example min TC using LP\r\n\r\nDisplay TC.l, x.l, x.m;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$Title Chapter 1 (Fig. 1.5) $Title An example of importing data from Excel to GAMS $Title Data for supply (Si), demand (Dj), and unit transportation cost (ci,j) $Title You need to save the dataset &#8220;Chapter1_data.xls&#8221; in the same folder of this file. $onText If using this code, please cite: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Emrouznejad, A., P. Petridis, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/posts\/80"}],"collection":[{"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":2,"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/posts\/80\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dataenvelopment.com\/gams\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}