lingo编程求解

Maxz=(1.25-0.25)*(x1+x2)+(2-0.35)*(x6+x7)+(2.8-0.5)*x9-(5*x1+10*x6)*0.05-(7*x2+9*x7+12*x9)*0.0321-(6*x3+8*x8)*0.0625-(4*x4+11*x9)*0.1119 -7*x5*0.05
s.t 5*x1+10*x6<=6000
7*x2+9*x7+12*x9<=1000
6*x3+8*x8<=4000
4*x4+11*x9<=7000
7*x5<=4000
x1+x2=x3+x4+x5
x6+x7=x8
x1,x2,x3,x4,x5,x6,x7,x8,x9>=0
这个程序在lingo中怎么编程呢

在lingo11中可以如下

max=(1.25-0.25)*(x1+x2)+(2-0.35)*(x6+x7)+(2.8-0.5)*x9-(5*x1+10*x6)*0.05-(7*x2+9*x7+12*x9)*0.0321-(6*x3+8*x8)*0.0625-(4*x4+11*x9)*0.1119 -7*x5*0.05;
5*x1+10*x6<=6000;
7*x2+9*x7+12*x9<=1000;
6*x3+8*x8<=4000;
4*x4+11*x9<=7000;
7*x5<=4000;
x1+x2-x3+x4-x5=0;
x6+x7-x8=0;

结果为

  Global optimal solution found.
  Objective value:                              543.4556
  Infeasibilities:                              0.000000
  Total solver iterations:                             5


                       Variable           Value        Reduced Cost
                             X1        869.8413            0.000000
                             X2        0.000000           0.2638889
                             X6        165.0794            0.000000
                             X7        111.1111            0.000000
                             X9        0.000000           0.1975667
                             X3        298.4127            0.000000
                             X8        276.1905            0.000000
                             X4        0.000000           0.9726000
                             X5        571.4286            0.000000

                            Row    Slack or Surplus      Dual Price
                              1        543.4556            1.000000
                              2        0.000000           0.4500000E-01
                              3        0.000000           0.7345556E-01
                              4        0.000000           0.2500000E-01
                              5        7000.000            0.000000
                              6        0.000000           0.2500000E-01
                              7        0.000000           0.5250000
                              8        0.000000           0.7000000

追问

这是我做的……怎么运行不了呢

追答

第二行末尾少了分号

追问

好的好的~谢谢啦

倒数第二个等式是不是写错啦 应该是x1+x2-x3-x4-x5=0最优解是什么呢~此时的x1-x7分别是多少

追答

改过之后,结果

                       Variable           Value        Reduced Cost
                             X1        1200.000            0.000000
                             X2        0.000000           0.2667556
                             X6        0.000000           0.5160000E-01
                             X7        111.1111            0.000000
                             X9        0.000000           0.3351667
                             X3        518.5185            0.000000
                             X8        111.1111            0.000000
                             X4        110.0529            0.000000
                             X5        571.4286            0.000000

温馨提示:内容为网友见解,仅供参考
无其他回答

在lingo中求解优化问题后怎么利用结果计算别的式子
1、题目:求minz=2*x1+3*x2+x3;s.t.[x1+4*x2+2*x3=8;3*x1+2*x2=6;xj=0,j=1,2,3,]。打开Lingo软件,进入下面编程状态。2、根据实际问题,建立数学模型,即使用数学建模的方法建立优化模型;根据优化模型,利用LINGO来求解模型。主要是根据LINGO软件,把数学模型转译成计算机语...

lingo如何用代码实现全局求解?
根据实际问题,建立数学模型,即使用数学建模的方法建立优化模型;根据优化模型,利用LINGO来求解模型。主要是根据LINGO软件,把数学模型转译成计算机语言,借助于计算机来求解。打开lingo,这是它的主界面。输入程序框架输入问题只需要按照图中的格式去写。可以看到,lingo的编程语言与我们所学到的运筹学公式基...

怎么用lingo求解整数规划
1,打开lingo。2,输入程序框架。3,输入问题,只需要按照图中的格式去写。可以看到,lingo的编程语言与我们所学到的运筹学公式基本一致。4,添加整数约束,希望哪一个变量是整数,就在末尾加一行“@gin(变量);”就可以了。5,得出结果,点击图中的“solve”按钮,即可。6,查看结果,解决后,会弹出一个...

如何编程,用lingo求minz=2*x1+3*x2+x3?
1、题目:求minz=2*x1+3*x2+x3;s.t.[x1 + 4*x2+2*x3>=8 ;3*x1 + 2*x2 >=6 ;xj >= 0 , j=1,2,3, ]。2、打开Lingo软件,进入下面编程状态。3、然后输入目标函数:minz=2*x1+3*x2+x3,如下图所示:4、然后进行运行一下,看看自己是否输入正确,如果没有出现“...

lingo什么意思
Lingo是一种专门用于求解优化问题的编程语言,它广泛应用于线性规划、整数规划、非线性规划等领域。其名称来源于“Linear Interactive and General Optimizer”的缩写,即线性交互式通用优化器,它提供了一种简洁明了的语法和强大的优化求解功能。Lingo的主要特点是直观易用。用户无需深入了解复杂的...

lingo编程问题,感谢呀!麻烦给出具体代码
由于lingo不区分大小写,所以r用lr代替 代码如下:min=s;s=3.1415926*(R+lr)*l+3.1415926*lr*lr;3.1415926*h*(R^2+R*lr+lr^2)=380;l=(h^2+(R-lr)^2)^0.5;lr<R;结果:S 101.7609 R 4.184900 LR 2.295768 L 4.184900 H 3.734243 ...

lingo程序编程
max=y;y=@if(x2-x1#LT#x3-x2,x2-x1,x3-x2);x1>0;x180;x2120;x3<140;求解结果:Globaloptimalsolutionfound.Objectivevalue:60.00000Objectivebound:60.00000Infeasibilities:0.000000Extendedsolversteps:2Totalsolveriterations:11VariableValueReducedCostY60.000000.000000X280.000000.000000X10....

lingo 编程 ,解决以下公式
这个叫做有约束的最小二乘回归,用拉格朗日乘子法就可以解决。不过在LINGO里面也可以:MODEL:SETS:DATAUSED\/1..8\/:X1,X2,X3;COEF\/1,2\/:W;ENDSETS DATA:X1=438.6,543.9,575.6,703.3,816.2,944.6,1095.3,1334.9;X2=438.6,508.2,594.5,695.4,813.5,951.7,1113.3,1302.3;X3...

lingo编程求解
在lingo11中可以如下 max=(1.25-0.25)*(x1+x2)+(2-0.35)*(x6+x7)+(2.8-0.5)*x9-(5*x1+10*x6)*0.05-(7*x2+9*x7+12*x9)*0.0321-(6*x3+8*x8)*0.0625-(4*x4+11*x9)*0.1119 -7*x5*0.05;5*x1+10*x6<=6000;7*x2+9*x7+12*x9<=1000;6*x3+8*x8<=4000...

用Lingo编程 急
difference为正表示库存 为负表示迟交数 model:sets:production\/1..3\/:time,lackloss;season\/1..4\/:;link(production,season):demand,difference,produce;endsets data:demand= 1500 1000 2000 1200 1500 1500 1200 1500 1000 2000 1500 2500;lackloss=20 10 10;time=2 4 3;enddata min=@sum(...

相似回答
大家正在搜