楼主: 昨天雨夹雪
1473 2

[問題求助] GAMS 源代码,运筹学软件,高级优化软件 [推广有奖]

  • 0关注
  • 0粉丝

已卖:27份资源

高中生

5%

还不是VIP/贵宾

-

威望
0
论坛币
669 个
通用积分
0.2250
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
3630 点
帖子
16
精华
0
在线时间
13 小时
注册时间
2017-12-19
最后登录
2019-3-29

楼主
昨天雨夹雪 发表于 2017-12-21 18:10:39 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
新手  遇到点麻烦,望大神帮忙 看一下,谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:gams 源代码 学软件 GAM AMS GAMS源代码 运筹学软件 高级优化软件

Untitled_11.txt
下载链接: https://bbs.pinggu.org/a-2383377.html

1.11 KB

求大神帮忙看一下

沙发
nuomin 发表于 2017-12-21 19:43:15
原书上的代码:
$Title The Transportation Problem of Linear Programming

Sets
    i canning plants /Seattle,SanDiego/
    j markets /NewYork,Chicago,Detroit/;

Parameters
    a(i) capacity of plant i in cases
         /Seattle 350
         SanDiego 600/
    b(j) demand at market j in cases
         /NewYork 325
          Chicago 300
          Detroit 275/;
Table d(i,j) distance in thousands of miles
                     NewYork    Chicago    Detroit
          Seattle     2.5          1.7        1.8
          SanDiego    2.5          1.8        1.4

Scalar f in dollars per thousand miles /90/;

Parameter c(i,j) transpor cost in 1000s of dollars per cases;
          c(i,j) = f*d(i,j)/1000;

Variables
         x(i,j) shipment quantities in cases
         z total transportation costs in 1000s of dollars;

Positive Variable x;

Equation
         cost define objective function
         supply(i) observe supply limit at plant i
         demand(j) satisly demand at market j;
cost.. z =e= sum((i,j),c(i,j)*x(i,j));
supply(i)..   sum(j,x(i,j)) =l= a(i);
demand(j)..  sum(i,x(i,j)) =g= b(j);

Model transport /all/;
solve transport using lp minimizing z;
display x.l,x.m;

藤椅
昨天雨夹雪 发表于 2017-12-21 22:41:17
谢谢啦!!我最后一个求和公式里面错了。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
扫码
拉您进交流群
GMT+8, 2026-1-17 16:13