-
Notifications
You must be signed in to change notification settings - Fork 4
/
oilseednl.mod
91 lines (66 loc) · 4.52 KB
/
oilseednl.mod
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
set GrowingArea; # Growing areas G1....G8
set TechPlant; # oilseed oil ecxtraction plants locations
set Tech; # Technology available of TechPlants
set ExtractPlant; # seedcake oil extraction plant locations
set ExTech; # Technology available of ExTechPlants
#=================Parameters=========================
param TechCap{Tech}; # Capacity of TechPlants type "T"
param TechFixedCost{Tech} ; # Fixed cost of TechPlants type "T"
param TechProcessCost{Tech}; # Processing cost of TechPlants type "T" (Rs/T)
param TechOil{Tech}; # Oil extraction in TechPlants type "T" (kg/T)
param TechSeedCake{Tech}; # Seedcake output from TechPlant type "T" (kg/T)
param TechSCoilPer{Tech}; # pecetage of oil remaining in seedcake at TechPlant type "T"
param CostTechmat{GrowingArea,TechPlant}; # Cost between oil Tech Plant and growing area
param ExTechCap{ExTech}; # Capacity of ExtractPlant of level "l"
param ExTechFixedCost{ExTech}; # Fixed cost of ExtractPlant of level "l"
param ExTechProcessCost{ExTech}; # Processing cost of ExtractPlant of level "l"
param CostExTechmat{TechPlant,ExtractPlant}; # Cost between the ExtractPlant and TechPlant
#================Variables=====================================
# x{Tech,TechPlants} takes value 1 if Tech "T" establish at TechPlant and 0 otherwise
var x{Tech,TechPlant} binary;
#U{Tech,TechPlants, GrowingArea} takes value 1 if flow from Growing area (G1..G8) to oil Tech plants type Tech(T1,T2,T3)
var U{Tech,TechPlant, GrowingArea} binary;
# y{ExtractPlant,ExTech} takes value 1 if extraction plant of type ExTech established
var y{ExTech,ExtractPlant} binary;
# incomming seedcake at Ectraction plant (e1,e2) of type ExTech from TechPlant
var z{ExTech,ExtractPlant,TechPlant} >=0;
# multipication of z{ExTech,E1,TechPlant}*x{Tech,TechPlant}
var r1{ExTech, TechPlant, Tech } >=0;
var r2{ExTech, TechPlant, Tech } >=0;
var Total_oil>=0;
#============================M=O=D=E=L=============================#
#==============Objective================================================================
minimize TotalCost: (sum{j in TechPlant, t in Tech}(TechFixedCost[t]*x[t,j])+ sum{j in TechPlant, t in Tech, g in GrowingArea}(1500*U[t,j,g]*TechProcessCost[t])+sum{j in TechPlant, t in Tech, g in GrowingArea}(1500*U[t,j,g]*CostTechmat[g,j])+
sum{l in ExTech,e in ExtractPlant }(ExTechFixedCost[l]*y[l,e]) + sum{ l in ExTech,e in ExtractPlant,j in TechPlant}(z[l,e,j]*ExTechProcessCost[l])+ sum{ l in ExTech,e in ExtractPlant,j in TechPlant}(z[l,e,j]*CostExTechmat[j,e])+
sum{t in Tech,j in TechPlant,g in GrowingArea}(U[t,j,g]*TechOil[t]*CostExTechmat[j,'E2']*1.5)+sum{t in Tech,l in ExTech,j in TechPlant}(TechSCoilPer[t]*600*r1[l,j,t]))/(Total_oil);
#=============Contraints=========================================================
# supply from g from any j (enforcing contraint)
s.t. con1{g in GrowingArea}: sum{t in Tech, j in TechPlant}(U[t,j,g])=1;
# j can have only one technology {T1,T2,T3}
s.t. con2{j in TechPlant}: sum{t in Tech}(x[t,j]) <= 1;
# oilseed incomming at plant j of tech t is not more than the it's capacity
s.t. con3{t in Tech, j in TechPlant}: sum{g in GrowingArea}(U[t,j,g])<= (TechCap[t]/1500)*x[t,j];
# any extraction plant can have only {L,M,H} level
s.t. con4{e in ExtractPlant}: sum{l in ExTech}(y[l,e]) <=1;
# seedcake comming at extraction plant e from j is equal to seedcake going from j to e
s.t. con5{j in TechPlant}:sum{e in ExtractPlant,l in ExTech}(z[l,e,j]) = sum{t in Tech, g in GrowingArea}(U[t,j,g]*TechSeedCake[t]*1.5);
#
s.t. con6{e in ExtractPlant,l in ExTech} : sum{j in TechPlant}(z[l,e,j]) <= ExTechCap[l]*y[l,e];
#
s.t. con7{l in ExTech,t in Tech, j in TechPlant}: r1[l,j,t]<= ExTechCap[l]*x[t,j];
#
s.t. con8{l in ExTech,t in Tech, j in TechPlant}: r1[l,j,t]-z[l,'E1',j]>= -1*(1-x[t,j])*ExTechCap[l];
#
s.t. con9{l in ExTech,t in Tech, j in TechPlant}: r1[l,j,t]-z[l,'E1',j]<= (1-x[t,j])*ExTechCap[l];
# for E2 alway be there in system
#s.t. con10:sum{l in ExTech} y[l,'E2']=1;
#
s.t. con10{l in ExTech,t in Tech, j in TechPlant}: r2[l,j,t] <= ExTechCap[l]*x[t,j];
#
s.t. con11{l in ExTech,t in Tech, j in TechPlant}: r2[l,j,t]-z[l,'E2',j]>= -1*(1-x[t,j])*ExTechCap[l];
#
s.t. con12{l in ExTech,t in Tech, j in TechPlant}: r2[l,j,t]-z[l,'E2',j]<= (1-x[t,j])*ExTechCap[l];
# Total Oil
s.t. con13: Total_oil = sum{t in Tech, j in TechPlant,g in GrowingArea } U[t,j,g]*TechOil[t]*1.5+ sum{l in ExTech,t in Tech, j in TechPlant} r1[l,j,t]*TechSCoilPer[t]+sum{l in ExTech,t in Tech, j in TechPlant} r2[l,j,t]*TechSCoilPer[t];
#16302040
#16026008