| 所在主题: | |
| 文件名: Spatial equilibrium.zip | |
| 资料下载链接地址: https://bbs.pinggu.org/a-2499620.html | |
本附件包括:
|
|
| 附件大小: | |
|
求GAMS大神帮我看一下如下文献中看到的代码为啥在软件里跑不出来、持续报错。
$ontext Simple Spatial Equilibrium Example Primal or quantity formulation. Erwin Kalvelagen, nov 2001 Data from: Takayama and Judge, Spatial and temporal price and allocation models North Holland, 1971 $offtext set i ’regions’ /region1,region2,region3/; alias (i,j); positive variables d(j) ’demand’ s(i) ’supply’ pd(j) ’price (demand)’ ps(i) ’price (supply)’ x(i,j) ’shipments’ ; free variable welfare ’quasi welfare’ ; equations excess_demand(j) ’no excess demand allowed’ excess_supply(i) ’excess supply is possible’ objective ’net quasi welfare function’ price_demand(j) ’demand curve (inverse)’ price_supply(i) ’supply curve (inverse)’ ; table data(i,*,*) ’data for inverse demand and supply equations’ intercept slope region1.demand 20 -0.1 region1.supply 5 0.1 region2.demand 20 -0.2 region2.supply 2.5 0.05 region3.demand 20 -0.125 region3.supply 5 0.1 ; table c(i,j) ’transportation costs’ region1 region2 region3 region1 2 2 region2 2 1 region3 2 1 ; parameters zeta(j),eta(j),theta(i),lambda(i); zeta(j) = data(j,’demand’,’intercept’); eta(j) = data(j,’demand’,’slope’); theta(i) = data(i,’supply’,’intercept’); lambda(i) = data(i,’supply’,’slope’); price_demand(j).. pd(j) =e= zeta(j)+eta(j)*d(j); price_supply(i).. ps(i) =e= theta(i)+lambda(i)*s(i); objective.. welfare =e= sum(j,zeta(j)*d(j)+0.5*eta(j)*sqr(d(j))) -sum(i,theta(i)*s(i)+0.5*lambda(i)*sqr(s(i))) -sum((i,j), c(i,j)*x(i,j)); excess_demand(j).. sum(i, x(i,j)) =g= d(j); excess_supply(i).. sum(j, x(i,j)) =l= s(i); model m /objective,excess_demand,excess_supply,price_demand,price_supply/; solve m using nlp maximizing welfare; 感谢 |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明