在 GAMS 中包含 txt 文件 - 我的 txt 文件第一行中的错误 140 和 36



我是GAMS的新用户,我试图在代码中包含一个txt文件,但我在txt文件的第一行中一次又一次地收到相同的错误(错误140&错误36(。有人能帮忙吗?

我的代码是这样的,我还附上了txt文件

* define the set of asset classes
set n Number of returns /n1*n120/;
* define Tables, Parameters, Scalars
Scalar T /120/;
$INCLUDE prices.txt

请注意,在代码的后面,我需要使用文本文件中的数据,如下所示:

EQ1..     sum(n, p(n)*prices(n)) =e= price0*exp(r*time);

感谢

prices.txt文件

您的prices.txt不包含有效的GAMS语法。你需要的是这样的东西:

Parameter prices(n) /
n1 455.5
n2 44545.5
/;

最新更新