Goal:This paper describes a link between GAMS and MATLAB. The aim of this link is two-fold. Firstly, it is intended to provide MATLAB users with a sophisticated nonlinear optimization capability. Secondly, the visualization tools of MATLAB are made available to a GAMS modeler in an easy and extendable manner so that optimization results can be viewed using any of the wide variety of plots and imaging capabilities that exist in MATLAB.
本篇博文介紹Matlab與GAMS的交互,將matlab數據生成能力&畫圖能力與GAMS的優化模型能力相結合。這個過程主要藉助.gdx中間文件來完成。
主要步驟
(1).m文件導出輸入數據到MToGDoc.gdx文件
(2)調用.gms優化模型文件,其中.gms模型讀取MToGDoc.gdx,並將輸出寫到新的GToMDoc.gdx文件
(3).m文件讀取GToMDoc.gdx文件並畫圖
相關參考材料:
[1]https://www.zhihu.com/question/50259729?from=profile_question_card
[2]https://blog.csdn.net/weixin_42421209/article/details/86436008
[3]https://www.gams.com/latest/docs/T_GDXMRW.html