Scenario Reduction Topic is solved

Problems with syntax of GAMS
Post Reply
paganini
User
User
Posts: 15
Joined: 2 years ago

Scenario Reduction

Post by paganini » 2 months ago

Hello everybody,
I have 315 scenarios for a photovoltaic system and trying to use gams scenario reduction function "SCENRED2" to get 20 scenarios but I don't know how to use it, I read the documentation but get confused.
Here is the data of my 315 scenarios :
I would appreciate it if you could help me do that.

S No. Pload Pwind Ppv Probability
1 6.450 0.000 0.103 9.51E-09
2 6.450 0.000 0.298 1.27E-06
3 6.450 0.000 0.478 1.16E-05
4 6.450 0.000 0.642 2.19E-05
5 6.450 0.000 0.788 5.53E-06
6 6.450 0.327 0.103 2.08E-08
7 6.450 0.327 0.298 2.77E-06
8 6.450 0.327 0.478 2.54E-05
9 6.450 0.327 0.642 4.79E-05
10 6.450 0.327 0.788 1.21E-05
11 6.450 0.982 0.103 1.58E-08
12 6.450 0.982 0.298 2.11E-06
13 6.450 0.982 0.478 1.93E-05
14 6.450 0.982 0.642 3.64E-05
15 6.450 0.982 0.788 9.21E-06
16 6.450 1.636 0.103 6.32E-09
17 6.450 1.636 0.298 8.42E-07
18 6.450 1.636 0.478 7.70E-06
19 6.450 1.636 0.642 1.45E-05
20 6.450 1.636 0.788 3.68E-06
21 6.450 1.800 0.103 1.44E-09
22 6.450 1.800 0.298 1.92E-07
23 6.450 1.800 0.478 1.75E-06
24 6.450 1.800 0.642 3.31E-06
25 6.450 1.800 0.788 8.37E-07
26 6.450 1.800 0.103 1.91E-10
27 6.450 1.800 0.298 2.55E-08
28 6.450 1.800 0.478 2.33E-07
29 6.450 1.800 0.642 4.40E-07
30 6.450 1.800 0.788 1.11E-07
31 6.450 0.000 0.103 1.50E-11
32 6.450 0.000 0.298 2.00E-09
33 6.450 0.000 0.478 1.83E-08
34 6.450 0.000 0.642 3.45E-08
35 6.450 0.000 0.788 8.72E-09
36 6.900 0.000 0.103 2.48E-07
37 6.900 0.000 0.298 3.30E-05
38 6.900 0.000 0.478 0.000302191
39 6.900 0.000 0.642 0.000570836
40 6.900 0.000 0.788 0.000144255
41 6.900 0.327 0.103 5.42E-07
42 6.900 0.327 0.298 7.23E-05
43 6.900 0.327 0.478 0.000661187
44 6.900 0.327 0.642 0.001248975
45 6.900 0.327 0.788 0.000315627
46 6.900 0.982 0.103 4.13E-07
47 6.900 0.982 0.298 5.50E-05
48 6.900 0.982 0.478 0.000502837
49 6.900 0.982 0.642 0.000949853
50 6.900 0.982 0.788 0.000240036
51 6.900 1.636 0.103 1.65E-07
52 6.900 1.636 0.298 2.20E-05
53 6.900 1.636 0.478 0.00020082
54 6.900 1.636 0.642 0.000379347
55 6.900 1.636 0.788 9.59E-05
56 6.900 1.800 0.103 3.75E-08
57 6.900 1.800 0.298 4.99E-06
58 6.900 1.800 0.478 4.57E-05
59 6.900 1.800 0.642 8.63E-05
60 6.900 1.800 0.788 2.18E-05
61 6.900 1.800 0.103 4.99E-09
62 6.900 1.800 0.298 6.64E-07
63 6.900 1.800 0.478 6.08E-06
64 6.900 1.800 0.642 1.15E-05
65 6.900 1.800 0.788 2.90E-06
66 6.900 0.000 0.103 3.91E-10
67 6.900 0.000 0.298 5.21E-08
68 6.900 0.000 0.478 4.76E-07
69 6.900 0.000 0.642 9.00E-07
70 6.900 0.000 0.788 2.27E-07
71 7.350 0.000 0.103 2.51E-06
72 7.350 0.000 0.298 0.000334872
73 7.350 0.000 0.478 0.003063732
74 7.350 0.000 0.642 0.005787355
75 7.350 0.000 0.788 0.001462516
76 7.350 0.327 0.103 5.50E-06
77 7.350 0.327 0.298 0.000732692
78 7.350 0.327 0.478 0.006703373
79 7.350 0.327 0.642 0.012662594
80 7.350 0.327 0.788 0.003199951
81 7.350 0.982 0.103 4.18E-06
82 7.350 0.982 0.298 0.000557217
83 7.350 0.982 0.478 0.005097956
84 7.350 0.982 0.642 0.009629979
85 7.350 0.982 0.788 0.002433582
86 7.350 1.636 0.103 1.67E-06
87 7.350 1.636 0.298 0.000222538
88 7.350 1.636 0.478 0.002035992
89 7.350 1.636 0.642 0.003845965
90 7.350 1.636 0.788 0.00097191
91 7.350 1.800 0.103 3.80E-07
92 7.350 1.800 0.298 5.06E-05
93 7.350 1.800 0.478 0.000463254
94 7.350 1.800 0.642 0.000875081
95 7.350 1.800 0.788 0.000221141
96 7.350 1.800 0.103 5.05E-08
97 7.350 1.800 0.298 6.73E-06
98 7.350 1.800 0.478 6.16E-05
99 7.350 1.800 0.642 0.000116378
100 7.350 1.800 0.788 2.94E-05
101 7.350 0.000 0.103 3.96E-09
102 7.350 0.000 0.298 5.28E-07
103 7.350 0.000 0.478 4.83E-06
104 7.350 0.000 0.642 9.12E-06
105 7.350 0.000 0.788 2.31E-06
106 7.800 0.000 0.103 1.00E-05
107 7.800 0.000 0.298 0.001335843
108 7.800 0.000 0.478 0.012221571
109 7.800 0.000 0.642 0.023086407
110 7.800 0.000 0.788 0.005834141
111 7.800 0.327 0.103 2.19E-05
112 7.800 0.327 0.298 0.002922792
113 7.800 0.327 0.478 0.026740503
114 7.800 0.327 0.642 0.050512502
115 7.800 0.327 0.788 0.01276496
116 7.800 0.982 0.103 1.67E-05
117 7.800 0.982 0.298 0.002222801
118 7.800 0.982 0.478 0.020336314
119 7.800 0.982 0.642 0.038415063
120 7.800 0.982 0.788 0.009707829
121 7.800 1.636 0.103 6.66E-06
122 7.800 1.636 0.298 0.000887729
123 7.800 1.636 0.478 0.008121798
124 7.800 1.636 0.642 0.015341982
125 7.800 1.636 0.788 0.003877056
126 7.800 1.800 0.103 1.52E-06
127 7.800 1.800 0.298 0.000201987
128 7.800 1.800 0.478 0.001847971
129 7.800 1.800 0.642 0.003490796
130 7.800 1.800 0.788 0.000882155
131 7.800 1.800 0.103 2.02E-07
132 7.800 1.800 0.298 2.69E-05
133 7.800 1.800 0.478 0.000245764
134 7.800 1.800 0.642 0.000464245
135 7.800 1.800 0.788 0.000117319
136 7.800 0.000 0.103 1.58E-08
137 7.800 0.000 0.298 2.11E-06
138 7.800 0.000 0.478 1.93E-05
139 7.800 0.000 0.642 3.64E-05
140 7.800 0.000 0.788 9.20E-06
141 8.250 0.000 0.103 1.59E-05
142 8.250 0.000 0.298 0.002116108
143 8.250 0.000 0.478 0.019360185
144 8.250 0.000 0.642 0.036571167
145 8.250 0.000 0.788 0.00924186
146 8.250 0.327 0.103 3.48E-05
147 8.250 0.327 0.298 0.004629993
148 8.250 0.327 0.478 0.042359619
149 8.250 0.327 0.642 0.080016832
150 8.250 0.327 0.788 0.020220968
151 8.250 0.982 0.103 2.64E-05
152 8.250 0.982 0.298 0.003521138
153 8.250 0.982 0.478 0.032214746
154 8.250 0.982 0.642 0.060853285
155 8.250 0.982 0.788 0.015378168
156 8.250 1.636 0.103 1.06E-05
157 8.250 1.636 0.298 0.001406251
158 8.250 1.636 0.478 0.012865736
159 8.250 1.636 0.642 0.024303227
160 8.250 1.636 0.788 0.006141642
161 8.250 1.800 0.103 2.40E-06
162 8.250 1.800 0.298 0.000319968
163 8.250 1.800 0.478 0.00292737
164 8.250 1.800 0.642 0.005529769
165 8.250 1.800 0.788 0.001397422
166 8.250 1.800 0.103 3.19E-07
167 8.250 1.800 0.298 4.26E-05
168 8.250 1.800 0.478 0.000389314
169 8.250 1.800 0.642 0.00073541
170 8.250 1.800 0.788 0.000185845
171 8.250 0.000 0.103 2.50E-08
172 8.250 0.000 0.298 3.34E-06
173 8.250 0.000 0.478 3.05E-05
174 8.250 0.000 0.642 5.76E-05
175 8.250 0.000 0.788 1.46E-05
176 8.700 0.000 0.103 1.00E-05
177 8.700 0.000 0.298 0.001335843
178 8.700 0.000 0.478 0.012221571
179 8.700 0.000 0.642 0.023086407
180 8.700 0.000 0.788 0.005834141
181 8.700 0.327 0.103 2.19E-05
182 8.700 0.327 0.298 0.002922792
183 8.700 0.327 0.478 0.026740503
184 8.700 0.327 0.642 0.050512502
185 8.700 0.327 0.788 0.01276496
186 8.700 0.982 0.103 1.67E-05
187 8.700 0.982 0.298 0.002222801
188 8.700 0.982 0.478 0.020336314
189 8.700 0.982 0.642 0.038415063
190 8.700 0.982 0.788 0.009707829
191 8.700 1.636 0.103 6.66E-06
192 8.700 1.636 0.298 0.000887729
193 8.700 1.636 0.478 0.008121798
194 8.700 1.636 0.642 0.015341982
195 8.700 1.636 0.788 0.003877056
196 8.700 1.800 0.103 1.52E-06
197 8.700 1.800 0.298 0.000201987
198 8.700 1.800 0.478 0.001847971
199 8.700 1.800 0.642 0.003490796
200 8.700 1.800 0.788 0.000882155
201 8.700 1.800 0.103 2.02E-07
202 8.700 1.800 0.298 2.69E-05
203 8.700 1.800 0.478 0.000245764
204 8.700 1.800 0.642 0.000464245
205 8.700 1.800 0.788 0.000117319
206 8.700 0.000 0.103 1.58E-08
207 8.700 0.000 0.298 2.11E-06
208 8.700 0.000 0.478 1.93E-05
209 8.700 0.000 0.642 3.64E-05
210 8.700 0.000 0.788 9.20E-06
211 9.150 0.000 0.103 2.51E-06
212 9.150 0.000 0.298 0.000334872
213 9.150 0.000 0.478 0.003063732
214 9.150 0.000 0.642 0.005787355
215 9.150 0.000 0.788 0.001462516
216 9.150 0.327 0.103 5.50E-06
217 9.150 0.327 0.298 0.000732692
218 9.150 0.327 0.478 0.006703373
219 9.150 0.327 0.642 0.012662594
220 9.150 0.327 0.788 0.003199951
221 9.150 0.982 0.103 4.18E-06
222 9.150 0.982 0.298 0.000557217
223 9.150 0.982 0.478 0.005097956
224 9.150 0.982 0.642 0.009629979
225 9.150 0.982 0.788 0.002433582
226 9.150 1.636 0.103 1.67E-06
227 9.150 1.636 0.298 0.000222538
228 9.150 1.636 0.478 0.002035992
229 9.150 1.636 0.642 0.003845965
230 9.150 1.636 0.788 0.00097191
231 9.150 1.800 0.103 3.80E-07
232 9.150 1.800 0.298 5.06E-05
233 9.150 1.800 0.478 0.000463254
234 9.150 1.800 0.642 0.000875081
235 9.150 1.800 0.788 0.000221141
236 9.150 1.800 0.103 5.05E-08
237 9.150 1.800 0.298 6.73E-06
238 9.150 1.800 0.478 6.16E-05
239 9.150 1.800 0.642 0.000116378
240 9.150 1.800 0.788 2.94E-05
241 9.150 0.000 0.103 3.96E-09
242 9.150 0.000 0.298 5.28E-07
243 9.150 0.000 0.478 4.83E-06
244 9.150 0.000 0.642 9.12E-06
245 9.150 0.000 0.788 2.31E-06
246 9.600 0.000 0.103 2.48E-07
247 9.600 0.000 0.298 3.30E-05
248 9.600 0.000 0.478 0.000302191
249 9.600 0.000 0.642 0.000570836
250 9.600 0.000 0.788 0.000144255
251 9.600 0.327 0.103 5.42E-07
252 9.600 0.327 0.298 7.23E-05
253 9.600 0.327 0.478 0.000661187
254 9.600 0.327 0.642 0.001248975
255 9.600 0.327 0.788 0.000315627
256 9.600 0.982 0.103 4.13E-07
257 9.600 0.982 0.298 5.50E-05
258 9.600 0.982 0.478 0.000502837
259 9.600 0.982 0.642 0.000949853
260 9.600 0.982 0.788 0.000240036
261 9.600 1.636 0.103 1.65E-07
262 9.600 1.636 0.298 2.20E-05
263 9.600 1.636 0.478 0.00020082
264 9.600 1.636 0.642 0.000379347
265 9.600 1.636 0.788 9.59E-05
266 9.600 1.800 0.103 3.75E-08
267 9.600 1.800 0.298 4.99E-06
268 9.600 1.800 0.478 4.57E-05
269 9.600 1.800 0.642 8.63E-05
270 9.600 1.800 0.788 2.18E-05
271 9.600 1.800 0.103 4.99E-09
272 9.600 1.800 0.298 6.64E-07
273 9.600 1.800 0.478 6.08E-06
274 9.600 1.800 0.642 1.15E-05
275 9.600 1.800 0.788 2.90E-06
276 9.600 0.000 0.103 3.91E-10
277 9.600 0.000 0.298 5.21E-08
278 9.600 0.000 0.478 4.76E-07
279 9.600 0.000 0.642 9.00E-07
280 9.600 0.000 0.788 2.27E-07
281 10.050 0.000 0.103 9.51E-09
282 10.050 0.000 0.298 1.27E-06
283 10.050 0.000 0.478 1.16E-05
284 10.050 0.000 0.642 2.19E-05
285 10.050 0.000 0.788 5.53E-06
286 10.050 0.327 0.103 2.08E-08
287 10.050 0.327 0.298 2.77E-06
288 10.050 0.327 0.478 2.54E-05
289 10.050 0.327 0.642 4.79E-05
290 10.050 0.327 0.788 1.21E-05
291 10.050 0.982 0.103 1.58E-08
292 10.050 0.982 0.298 2.11E-06
293 10.050 0.982 0.478 1.93E-05
294 10.050 0.982 0.642 3.64E-05
295 10.050 0.982 0.788 9.21E-06
296 10.050 1.636 0.103 6.32E-09
297 10.050 1.636 0.298 8.42E-07
298 10.050 1.636 0.478 7.70E-06
299 10.050 1.636 0.642 1.45E-05
300 10.050 1.636 0.788 3.68E-06
301 10.050 1.800 0.103 1.44E-09
302 10.050 1.800 0.298 1.92E-07
303 10.050 1.800 0.478 1.75E-06
304 10.050 1.800 0.642 3.31E-06
305 10.050 1.800 0.788 8.37E-07
306 10.050 1.800 0.103 1.91E-10
307 10.050 1.800 0.298 2.55E-08
308 10.050 1.800 0.478 2.33E-07
309 10.050 1.800 0.642 4.40E-07
310 10.050 1.800 0.788 1.11E-07
311 10.050 0.000 0.103 1.50E-11
312 10.050 0.000 0.298 2.00E-09
313 10.050 0.000 0.478 1.83E-08
314 10.050 0.000 0.642 3.45E-08
315 10.050 0.000 0.788 8.72E-09
image.png

aileen
User
User
Posts: 131
Joined: 1 year ago

Re: Scenario Reduction

Post by aileen » 2 months ago

Hi paganini,

Can you say more specifically where you got confused reading the documenation of SCENRED2 and what it is you are confused about? You might want to check out the simplified interface to SCENRED2. You need to specify n the set of nodes in the tree, tree the set of ancestor relations describing the tree und p a parameter containing the node probabilities. rv1, rv2,... are parameters containing the stochastic data of the nodes (here you communicate the relevant stochastic data for reduction, i.e. Pload, Pwind and Ppv data from your table). Note that parameters containing the stochastic data must have the node set as their last index. rtree and rp are outputs of SCENRED2. I attached an example using your provided data (I assumed a fan structure). Note that the probabilities you have provided are not adding up to 1, thus, I added a line scaling the probabilities to sum up to 1 before using SCENRED2.

GAMS World Forum is a community forum, where community members can receive help from many other experienced and helpful GAMS users in the community. Here you find some useful guidelines when sending a question to the community, if you follow these guidelines, you are more likely to get helpful replies. For example, instead of copying data tables you can attach data files to your post, so community members can more easily experiment with your data.

Best,
Aileen
SCENRED2_example.gms
(11.19 KiB) Downloaded 63 times

paganini
User
User
Posts: 15
Joined: 2 years ago

Re: Scenario Reduction

Post by paganini » 2 months ago

thank you a lot Aileen
and sorry for not attaching data, my bad!
thanks again for your help and support and your example code that cleared up my misunderstanding, It's very kind of you.

behrad
User
User
Posts: 4
Joined: 2 years ago

Re: Scenario Reduction

Post by behrad » 2 months ago

Hi paganini,
I run the attached Scenred code, but there are two errors. Please help me to solve these errors.

paganini
User
User
Posts: 15
Joined: 2 years ago

Re: Scenario Reduction

Post by paganini » 2 months ago

Hi
I attached the modified file.
SCENRED2_example (1).gms
(11.19 KiB) Downloaded 44 times

behrad
User
User
Posts: 4
Joined: 2 years ago

Re: Scenario Reduction

Post by behrad » 1 month ago

Thank you very much.
Are these scenarios specific to one hour? What if we want to generate and reduce the scenario for 24 hours?

Post Reply