LINGO ERROR CODE 是1017 我写的代码如下MODEL:1] min = 0.5*C_P*(Q*(1-D/P)-S)^2/(Q*(1-D/P))2] +C_D*D/Q+0.5*C_S*S^2/(Q*(1-D/P));3] T1=(Q*(1-D/P)-S)/(P-D)*365;4] T2=(Q*(1-D/P)-S)/D*365;5] T3=S/D*365;6] T4=S/(P-D)*365;7] T= T1+T2+T3+T4;8] data;9] C

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 23:05:57
LINGOERRORCODE是1017我写的代码如下MODEL:1]min=0.5*C_P*(Q*(1-D/P)-S)^2/(Q*(1-D/P))2]+C_D*D/Q+0.5*C_S*S^2/(Q*(

LINGO ERROR CODE 是1017 我写的代码如下MODEL:1] min = 0.5*C_P*(Q*(1-D/P)-S)^2/(Q*(1-D/P))2] +C_D*D/Q+0.5*C_S*S^2/(Q*(1-D/P));3] T1=(Q*(1-D/P)-S)/(P-D)*365;4] T2=(Q*(1-D/P)-S)/D*365;5] T3=S/D*365;6] T4=S/(P-D)*365;7] T= T1+T2+T3+T4;8] data;9] C
LINGO ERROR CODE 是1017 我写的代码如下
MODEL:
1] min = 0.5*C_P*(Q*(1-D/P)-S)^2/(Q*(1-D/P))
2] +C_D*D/Q+0.5*C_S*S^2/(Q*(1-D/P));
3] T1=(Q*(1-D/P)-S)/(P-D)*365;
4] T2=(Q*(1-D/P)-S)/D*365;
5] T3=S/D*365;
6] T4=S/(P-D)*365;
7] T= T1+T2+T3+T4;
8] data;
9] C_D=500
10] D=4900
11] C_P=1000
12] P=9800
13] C_S=2000;
14] enddata
END

LINGO ERROR CODE 是1017 我写的代码如下MODEL:1] min = 0.5*C_P*(Q*(1-D/P)-S)^2/(Q*(1-D/P))2] +C_D*D/Q+0.5*C_S*S^2/(Q*(1-D/P));3] T1=(Q*(1-D/P)-S)/(P-D)*365;4] T2=(Q*(1-D/P)-S)/D*365;5] T3=S/D*365;6] T4=S/(P-D)*365;7] T= T1+T2+T3+T4;8] data;9] C
出现1017code说明你的lingo版本有问题.
  另外有一些错误.
  修改后如下
  MODEL:
  min = 0.5*C_P*(Q*(1-D/P)-S)^2/(Q*(1-D/P))+C_D*D/Q+0.5*C_S*S^2/(Q*(1-D/P));
  T1=(Q*(1-D/P)-S)/(P-D)*365;
  T2=(Q*(1-D/P)-S)/D*365;
  T3=S/D*365;
  T4=S/(P-D)*365;
  T= T1+T2+T3+T4;
  data:
  C_D=500;
  D=4900;
  C_P=1000;
  P=9800;
  C_S=2000;
  enddata
  END
  运行结果:
  Local optimal solution found.
  Objective value:40414.52
  Total solver iterations:4
  Variable Value Reduced Cost
  C_P 1000.000 0.000000
  Q 121.2436 0.000000
  D 4900.000 0.000000
  P 9800.000 0.000000
  S 20.20726 0.000000
  C_D 500.0000 0.000000
  C_S 2000.000 0.000000
  T1 3.010469 -0.1032174E-07
  T2 3.010469 0.000000
  T3 1.505235 -0.3807276E-07
  T4 1.505235 0.000000
  T 9.031408 0.000000
  Row Slack or Surplus Dual Price
  1 40414.52 -1.000000
  2 0.000000 0.000000
  3 0.000000 0.000000
  4 0.000000 0.000000
  5 0.000000 0.000000
  6 0.000000 0.000000