Positive variable Positive variable Positive variable product_I_add Po

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
Positive variable A;
Positive variable B;
Positive variable product_I_add;
Positive variable alpha;
Positive variable product_I;
Positive variable product_II_raw;
Positive variable product_II_partI;
Positive variable product_II_partII;
Positive variable product_II;
variable earned;
Positive variable total;
Positive variable I_part1;
Positive variable I_part2;
Positive variable I_part3;
variable product_I_price;
equations
Alimit
Blimit
TotalEq
A_plus_B_limit
alpha_limit
First_type_needed
First_type_count
RawSecond_type_count
Second_type_count
Count_earn
Count_earn_task2
Part_first_type
Part1_limit
Part2_limit
Converter_limit
Need_to_earn
;
Blimit .. 30000 =g= B;
Alimit .. 100000 =g= A;
A_plus_B_limit .. total =l= 100000;
alpha_limit .. product_II_raw =g= product_II_partI + product_II_partII;
TotalEq .. total =e= A + B;
First_type_count .. product_I =e= 0.15 * A + 0.25 * B + 0.5 * product_II_partI;
RawSecond_type_count .. product_II_raw =e= 0.85 * A + 0.75 * B;
Second_type_count ..product_II =e= product_II_partII + 0.5 * product_II_partI;
Converter_limit .. product_II_partI =l= 50000;
First_type_needed .. product_I + product_I_add =g= 40000;
Part_first_type .. product_I + product_I_add =e= I_part1 + I_part2 + I_part3;
Part1_limit .. I_part1 =l= 45000;
Part2_limit .. I_part2 =l= 4000;
Count_earn .. earned =e= -1 * (3.25 * A + 3.4 * B + 0.35 * (A + B) + product_I_add * 5.75 + product_II_partI * 0.25)
-1 * (0.1 * product_I + product_I * 0.15)
+ 5.5 * I_part1 + I_part2 * 5.2 + I_part3 * 5.0 + 3.8 * product_II;
Count_earn_task2 .. earned =e= -1 * (3.25 * A + 3.4 * B + 0.35 * (A + B) + product_I_add * 5.75
+ product_II_partI * 0.25)
-1 * ((product_I + product_I_add) * (0.15 + 0.1))
+ ((product_I + product_I_add )* product_I_price) + 3.8 * product_II;
Need_to_earn .. earned =g= 50000;
model task1 /
Alimit
Blimit
TotalEq
A_plus_B_limit
alpha_limit
First_type_needed
First_type_count
RawSecond_type_count
Second_type_count
Count_earn
Part_first_type
Part1_limit
Part2_limit
Converter_limit
/;
model task2 /
Alimit
Blimit
TotalEq
A_plus_B_limit
alpha_limit
First_type_needed
First_type_count
RawSecond_type_count
Second_type_count
Converter_limit
Count_earn_task2
Need_to_earn
/;
* solve task1 using nlp maximizing earned; *
solve task2 using nlp minimizing product_I_price;
* lp *
* mip *
* nlp *
* minlp *
* 1) 68 65*
* display earned.l, A.l, B.l, alpha.l, product_I.l, product_I_add.l, product_II.l, I_part1.l, I_part2.l, I_part3.l, product_I_price.l; *
display product_I_price.l, A.l, B.l;