hi,everyone
after my model solved with gams error Equation infeasible due to rhs value occured. please help me to correct it.
my code is following:
1 sets
2 j activity / a1a7 /
3 k resource type / k1k3 /
4 t time period / 120 /
5 m mode /m1m2 / ;
6 alias(i,j) ;
7 alias(u,t);
8 variables
9 x(j,m,t) activity j in mode m in time t
10 sr(k) recruitment date of resource type k
11 fr(k) release date of resource type k
12 z1 total present value
13 z2 total cost of resource ;
14 binary variables x ;
15 integer variables sr, fr ;
16 parameters
17 c(k) unit cost of resource types per unit time
18 / k1 14
19 k2 23
20 k3 17 /
21 d(j,m) duration of activity j in mode m
22 / a2. m1 = 4
23 a2. m2 = 7
24 a3. m1 = 3
25 a3. m2 = 7
26 a4. m1 = 2
27 a4. m2 = 4
28 a5. m1 = 6
29 a5. m2 = 8
30 a6. m1 = 3
31 a6. m2 = 5 /
32 cf(j,m) cashflow of activity j in mode m
33 / a2. m1 = 100
34 a2. m2 = 200
35 a3. m1 = 300
36 a3. m2 = 400
37 a4. m1 = 500
38 a4. m2 = 600
39 a5. m1 = 700
40 a5. m2 = 800
41 a6. m1 = 900
42 a6. m2 = 1000 /
43 r(j,k,m) resource requirement of activity j in mode m for resource type k
44 / a2. k1. m1 = 9
45 a2. k1. m2 = 6
46 a3. k1. m1 = 12
47 a3. k1. m2 = 6
48 a3. k3. m1 = 11
49 a3. k3. m2 = 6
50 a4. k1. m1 = 3
51 a4. k1. m2 = 1
52 a4. k2. m1 = 4
53 a4. k2. m2 = 1
54 a4. k3. m1 = 3
55 a4. k3. m2 = 2
56 a5. k2. m1 = 3
57 a5. k2. m2 = 2
58 a5. k3. m1 = 4
59 a5. k3. m2 = 3
60 a6. k1. m1 = 9
61 a6. k1. m2 = 6
62 a6. k2. m1 = 4
63 a6. k2. m2 = 2 /
64 a(k) constant availability of renewable resource type k
65 / k1 30
66 k2 40
67 k3 50 /
68 ES(j) earliest start time of activity j
69 /a2 1
70 a3 1
71 a4 5
72 a5 5
73 a6 4
74 a7 20/
75 LS(j)
76 /a2 7
77 a3 7
78 a4 17
79 a5 13
80 a6 16
81 a7 20/ ;
82 scalar w deadline of the project /20/ ;
83 scalar v discount rate /0.05/ ;
84 equations
85 value define objective function 1
86 cost define objective function 2
87 precedence(i,j) precedence constraint
88 execution(j) start time in one execution mode
89 resources(k,t) renewable resources limitations
90 recruitment(j,k) recruitment dates for resources
91 release(j,k) release dates for resources
92 deadline(j,m) project deadline is not violated ;
93 value… z1 =e= sum((j,m,t)(ord(t)>= ES(j)and ord(t)= ES(j)and ord(t)= ES(i)and ord(t)= ES(j)and ord(t)=(ord(t)-d(j,m)+1)),r(j,k,m)*x(j,m,u)
)=l= a(K) ;
98 recruitment(j,k).. sr(k)=l= sum((t,m)(ord(t)>= ES(j)and ord(t)= ES(j)and ord(t)= ES(j)and ord(t)<= LS(j)),ord(t)*x(j,m,t))=
l= w ;
101 model MRCPSP /all/ ;
102 solve MRCPSP using mip maximizing z1 ;
103 solve MRCPSP using mip minimizing z2 ;
104 display x.l,sr.l,fr.l,z1.l,z2.l ;
---- value =E= define objective function 1
value… - 95.1229424500714x(a2,m1,1) - 90.4837418035959x(a2,m1,2)
-
86.0707976425058x(a2,m1,3) - 81.8730753077982x(a2,m1,4)
-
77.8800783071405x(a2,m1,5) - 74.0818220681718x(a2,m1,6)
-
70.4688089718713x(a2,m1,7) - 190.245884900143x(a2,m2,1)
-
180.967483607192x(a2,m2,2) - 172.141595285012x(a2,m2,3)
-
163.746150615596x(a2,m2,4) - 155.760156614281x(a2,m2,5)
-
148.163644136344x(a2,m2,6) - 140.937617943743x(a2,m2,7)
-
285.368827350214x(a3,m1,1) - 271.451225410788x(a3,m1,2)
-
258.212392927517x(a3,m1,3) - 245.619225923395x(a3,m1,4)
-
233.640234921421x(a3,m1,5) - 222.245466204515x(a3,m1,6)
-
211.406426915614x(a3,m1,7) - 380.491769800286x(a3,m2,1)
-
361.934967214384x(a3,m2,2) - 344.283190570023x(a3,m2,3)
-
327.492301231193x(a3,m2,4) - 311.520313228562x(a3,m2,5)
-
296.327288272687x(a3,m2,6) - 281.875235887485x(a3,m2,7)
-
389.400391535702x(a4,m1,5) - 370.409110340859x(a4,m1,6)
-
352.344044859357x(a4,m1,7) - 335.16002301782x(a4,m1,8)
-
318.814075810887x(a4,m1,9) - 303.265329856317x(a4,m1,10)
-
288.474905190243x(a4,m1,11) - 274.405818047013x(a4,m1,12)
-
261.022888380508x(a4,m1,13) - 248.292651895705x(a4,m1,14)
-
236.183276370507x(a4,m1,15) - 224.664482058611x(a4,m1,16)
-
213.707465974363x(a4,m1,17) - 467.280469842843x(a4,m2,5)
-
444.490932409031x(a4,m2,6) - 422.812853831228x(a4,m2,7)
-
402.192027621384x(a4,m2,8) - 382.576890973064x(a4,m2,9)
-
363.91839582758x(a4,m2,10) - 346.169886228292x(a4,m2,11)
-
329.286981656416x(a4,m2,12) - 313.22746605661x(a4,m2,13)
-
297.951182274846x(a4,m2,14) - 283.419931644609x(a4,m2,15)
-
269.597378470333x(a4,m2,16) - 256.448959169236x(a4,m2,17)
-
545.160548149983x(a5,m1,5) - 518.572754477202x(a5,m1,6)
-
493.281662803099x(a5,m1,7) - 469.224032224948x(a5,m1,8)
-
446.339706135241x(a5,m1,9) - 424.571461798843x(a5,m1,10)
-
403.864867266341x(a5,m1,11) - 384.168145265818x(a5,m1,12)
-
365.432043732711x(a5,m1,13) - 623.040626457124x(a5,m2,5)
-
592.654576545374x(a5,m2,6) - 563.750471774971x(a5,m2,7)
-
536.256036828511x(a5,m2,8) - 510.102521297419x(a5,m2,9)
-
485.224527770107x(a5,m2,10) - 461.559848304389x(a5,m2,11)
-
439.049308875221x(a5,m2,12) - 417.636621408813x(a5,m2,13)
-
736.857677770184x(a6,m1,4) - 700.920704764264x(a6,m1,5)
-
666.736398613546x(a6,m1,6) - 634.219280746842x(a6,m1,7)
-
603.288041432075x(a6,m1,8) - 573.865336459596x(a6,m1,9)
-
545.87759374137x(a6,m1,10) - 519.254829342438x(a6,m1,11)
-
493.930472484624x(a6,m1,12) - 469.841199084914x(a6,m1,13)
-
446.926773412269x(a6,m1,14) - 425.129897466913x(a6,m1,15)
-
404.396067705499x(a6,m1,16) - 818.730753077982x(a6,m2,4)
-
778.800783071405x(a6,m2,5) - 740.818220681718x(a6,m2,6)
-
704.688089718713x(a6,m2,7) - 670.320046035639x(a6,m2,8)
-
637.628151621773x(a6,m2,9) - 606.530659712633x(a6,m2,10)
-
576.949810380487x(a6,m2,11) - 548.811636094026x(a6,m2,12)
-
522.045776761016x(a6,m2,13) - 496.585303791409x(a6,m2,14)
-
472.366552741015x(a6,m2,15) - 449.328964117222x(a6,m2,16) + z1 =E= 0 ;
(LHS = 0)
---- cost =E= define objective function 2
cost… 420sr(k1) + 920sr(k2) + 850sr(k3) - 420fr(k1) - 920*fr(k2)
- 850*fr(k3) + z2 =E= 0 ; (LHS = 0)
---- precedence =G= precedence constraint
precedence(a1,a2)… x(a2,m1,1) + 2x(a2,m1,2) + 3x(a2,m1,3) + 4*x(a2,m1,4)
-
5x(a2,m1,5) + 6x(a2,m1,6) + 7x(a2,m1,7) + x(a2,m2,1) + 2x(a2,m2,2)
-
3x(a2,m2,3) + 4x(a2,m2,4) + 5x(a2,m2,5) + 6x(a2,m2,6) + 7*x(a2,m2,7)
=G= 0 ; (LHS = 0)
precedence(a1,a3)… x(a3,m1,1) + 2x(a3,m1,2) + 3x(a3,m1,3) + 4*x(a3,m1,4)
-
5x(a3,m1,5) + 6x(a3,m1,6) + 7x(a3,m1,7) + x(a3,m2,1) + 2x(a3,m2,2)
-
3x(a3,m2,3) + 4x(a3,m2,4) + 5x(a3,m2,5) + 6x(a3,m2,6) + 7*x(a3,m2,7)
=G= 0 ; (LHS = 0)
precedence(a1,a4)… 5x(a4,m1,5) + 6x(a4,m1,6) + 7x(a4,m1,7) + 8x(a4,m1,8)
-
9x(a4,m1,9) + 10x(a4,m1,10) + 11x(a4,m1,11) + 12x(a4,m1,12)
-
13x(a4,m1,13) + 14x(a4,m1,14) + 15x(a4,m1,15) + 16x(a4,m1,16)
-
17x(a4,m1,17) + 5x(a4,m2,5) + 6x(a4,m2,6) + 7x(a4,m2,7)
-
8x(a4,m2,8) + 9x(a4,m2,9) + 10x(a4,m2,10) + 11x(a4,m2,11)
-
12x(a4,m2,12) + 13x(a4,m2,13) + 14x(a4,m2,14) + 15x(a4,m2,15)
-
16x(a4,m2,16) + 17x(a4,m2,17) =G= 0 ; (LHS = 0)
REMAINING 44 ENTRIES SKIPPED
**** Exec Error at line 96: Equation infeasible due to rhs value
**** INFEASIBLE EQUATIONS …
---- execution =E= start time in one execution mode
execution(a1)… 0 =E= 1 ; (LHS = 0, INFES = 1 ****)
REMAINING 6 ENTRIES SKIPPED
\
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.