• API
• FAQ
• Tools
• Archive
daily pastebin goal
51%
SHARE
TWEET

# GAMS

a guest May 4th, 2018 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. SET      n /One, Two, Three/
2.          t /One, Two, Three/;
3. PARAMETER
4.    c(n)     /one   5   ,   two   9   ,   three   13/
5.    q(n)     /one   4   ,   two   3   ,   three 8/;
6. POSITIVE VARIABLES     x(n,t), mu(n,t), lambda(n,t);
7. EQUATIONS KKT(n,t), sl(n,t);
8. KKT(n,t).. 0 =e= c(n) + mu(n,t) + lambda(n,t);
9. sl(n,t).. 0 =e= mu(n,t)*(x(n,t) - q(n))
10. MODEL problem /ALL/;
11. SOLVE problem using MCP;
12.
13.
14. Output:
15.
16. GAMS 24.7.4  r58773 Released Sep 19, 2016 WEX-WEI x86 64bit/MS Windows 05/04/18 14:52:16 Page 1
17. G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
18. C o m p i l a t i o n
19.
20.
21.    1  SET      n /One, Two, Three/
22.    2           t /One, Two, Three/;
23.    3  PARAMETER
24.    4     c(n)     /one   5   ,   two   9   ,   three   13/
25.    5     q(n)     /one   4   ,   two   3   ,   three 8/;
26.    6  POSITIVE VARIABLES     x(n,t), mu(n,t), lambda(n,t);
27.    7  EQUATIONS KKT(n,t), sl(n,t);
28.    8  KKT(n,t).. 0 =e= c(n) + mu(n,t) + lambda(n,t);
29.    9  sl(n,t).. 0 =e= mu(n,t)*(x(n,t) - q(n))
30.   10  MODEL problem /ALL/;
31.   11  SOLVE problem using MCP;
32.   12
33.   13
34.
35.
36. COMPILATION TIME     =        0.016 SECONDS      3 MB  24.7.4 r58773 WEX-WEI
37. GAMS 24.7.4  r58773 Released Sep 19, 2016 WEX-WEI x86 64bit/MS Windows 05/04/18 14:52:16 Page 2
38. G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
39. Equation Listing    SOLVE problem Using MCP From line 11
40.
41.
42. ---- KKT  =E=
43.
44. KKT(One,One)..  - mu(One,One) - lambda(One,One) =E= 5 ; (LHS = 0
45.      , INFES = 5 ****)
46.
47. KKT(One,Two)..  - mu(One,Two) - lambda(One,Two) =E= 5 ; (LHS = 0
48.      , INFES = 5 ****)
49.
50. KKT(One,Three)..  - mu(One,Three) - lambda(One,Three) =E= 5 ;
51.
52.       (LHS = 0, INFES = 5 ****)
53.
54. REMAINING 6 ENTRIES SKIPPED
55.
56.
57. ---- sl  =E=
58.
59. sl(One,One)..  (0)*x(One,One) + (4)*mu(One,One) =E= 0 ; (LHS = 0)
60.
61. sl(One,Two)..  (0)*x(One,Two) + (4)*mu(One,Two) =E= 0 ; (LHS = 0)
62.
63. sl(One,Three)..  (0)*x(One,Three) + (4)*mu(One,Three) =E= 0 ; (LHS = 0)
64.
65. REMAINING 6 ENTRIES SKIPPED
66.
67. GAMS 24.7.4  r58773 Released Sep 19, 2016 WEX-WEI x86 64bit/MS Windows 05/04/18 14:52:16 Page 3
68. G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
69. Column Listing      SOLVE problem Using MCP From line 11
70.
71.
72. ---- x
73.
74. x(One,One)
75.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
76.        (0)      sl(One,One)
77.
78. x(One,Two)
79.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
80.        (0)      sl(One,Two)
81.
82. x(One,Three)
83.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
84.        (0)      sl(One,Three)
85.
86. REMAINING 6 ENTRIES SKIPPED
87.
88. ---- mu
89.
90. mu(One,One)
91.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
92.        -1       KKT(One,One)
93.        (4)      sl(One,One)
94.
95. mu(One,Two)
96.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
97.        -1       KKT(One,Two)
98.        (4)      sl(One,Two)
99.
100. mu(One,Three)
101.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
102.        -1       KKT(One,Three)
103.        (4)      sl(One,Three)
104.
105. REMAINING 6 ENTRIES SKIPPED
106.
107. ---- lambda
108.
109. lambda(One,One)
110.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
111.        -1       KKT(One,One)
112.
113. lambda(One,Two)
114.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
115.        -1       KKT(One,Two)
116.
117. lambda(One,Three)
118.                 (.LO, .L, .UP, .M = 0, 0, +INF, 0)
119.        -1       KKT(One,Three)
120.
121. REMAINING 6 ENTRIES SKIPPED
122.
123. **** Unmatched variable not free or fixed
124.      x(One,One)
125.
126. **** Unmatched variable not free or fixed
127.      x(One,Two)
128.
129. **** Unmatched variable not free or fixed
130.      x(One,Three)
131.
132. **** Unmatched variable not free or fixed
133.      x(Two,One)
134.
135. **** Unmatched variable not free or fixed
136.      x(Two,Two)
137.
138. **** Unmatched variable not free or fixed
139.      x(Two,Three)
140.
141. **** Unmatched variable not free or fixed
142.      x(Three,One)
143.
144. **** Unmatched variable not free or fixed
145.      x(Three,Two)
146.
147. **** Unmatched variable not free or fixed
148.      x(Three,Three)
149.
150. **** Unmatched variable not free or fixed
151.      mu(One,One)
152.
153. **** Unmatched variable not free or fixed
154.      mu(One,Two)
155.
156. **** Unmatched variable not free or fixed
157.      mu(One,Three)
158.
159. **** Unmatched variable not free or fixed
160.      mu(Two,One)
161.
162. **** Unmatched variable not free or fixed
163.      mu(Two,Two)
164.
165. **** Unmatched variable not free or fixed
166.      mu(Two,Three)
167.
168. **** Unmatched variable not free or fixed
169.      mu(Three,One)
170.
171. **** Unmatched variable not free or fixed
172.      mu(Three,Two)
173.
174. **** Unmatched variable not free or fixed
175.      mu(Three,Three)
176.
177. **** Unmatched variable not free or fixed
178.      lambda(One,One)
179.
180. **** Unmatched variable not free or fixed
181.      lambda(One,Two)
182.
183. **** Unmatched variable not free or fixed
184.      lambda(One,Three)
185.
186. **** Unmatched variable not free or fixed
187.      lambda(Two,One)
188.
189. **** Unmatched variable not free or fixed
190.      lambda(Two,Two)
191.
192. **** Unmatched variable not free or fixed
193.      lambda(Two,Three)
194.
195. **** Unmatched variable not free or fixed
196.      lambda(Three,One)
197.
198. **** Unmatched variable not free or fixed
199.      lambda(Three,Two)
200.
201. **** Unmatched variable not free or fixed
202.      lambda(Three,Three)
203.
204. **** Counts do not match
205.      Single equations in unmatched =E= blocks       18
206.      Unmatched single free variables                 0
207.
208. **** Unmatched free variables = 0
209.
210. **** Unmatched =E= equations = 18
211.      KKT(One,One)
212.      KKT(One,Two)
213.      KKT(One,Three)
214.      KKT(Two,One)
215.      KKT(Two,Two)
216.      KKT(Two,Three)
217.      KKT(Three,One)
218.      KKT(Three,Two)
219.      KKT(Three,Three)
220.      sl(One,One)
221.      sl(One,Two)
222.      sl(One,Three)
223.      sl(Two,One)
224.      sl(Two,Two)
225.      sl(Two,Three)
226.      sl(Three,One)
227.      sl(Three,Two)
228.      sl(Three,Three)
229. GAMS 24.7.4  r58773 Released Sep 19, 2016 WEX-WEI x86 64bit/MS Windows 05/04/18 14:52:16 Page 4
230. G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
231. Model Statistics    SOLVE problem Using MCP From line 11
232.
233.
234. MODEL STATISTICS
235.
236. BLOCKS OF EQUATIONS           2     SINGLE EQUATIONS           18
237. BLOCKS OF VARIABLES           3     SINGLE VARIABLES           27
238. NON ZERO ELEMENTS            36     NON LINEAR N-Z             18
239. DERIVATIVE POOL              20     CONSTANT POOL              19
240. CODE LENGTH                  64
241.
242.
243. GENERATION TIME      =        0.015 SECONDS      4 MB  24.7.4 r58773 WEX-WEI
244.
245. **** SOLVE from line 11 ABORTED, EXECERROR = 28
246.
247.
248. EXECUTION TIME       =        0.015 SECONDS      4 MB  24.7.4 r58773 WEX-WEI
249.
250.
251. USER: GAMS Development Corporation, Washington, DC   G871201/0000CA-ANY
252.       Free Demo,  202-342-0180,  sales@gams.com,  www.gams.com   DC0000
253.
254.
255. **** FILE SUMMARY
256.
257. Input      C:\Users\apfan\Documents\A (School)\General ISE\Research\KKT_research
258.            .gms
259. Output     C:\Users\apfan\Documents\gamsdir\projdir\KKT_research.lst
260.
261. **** USER ERROR(S) ENCOUNTERED
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top