sets t / 1*5 / h / 1*4 / s sth scenario / 1*3 / parameters a(t) / 1 1000, 2 11, 3 1200, 4 13, 5 14 / b(h) / 1 20 2 21 3 22 4 23/ c(s) / 1 10 2 2000 3 3 / * this is the scenario dependent parameter cc * cc is c(s), used as a dummy parameter in order to solve the deterministic * under different scenarios variables Z1(t),Z2(h), NPV binary variable Y(t) equations e1, e2, e3 ; e1(t).. Z1(t) =e= (a(t) + cc)*Y(t) ; e2(h).. Z2(h) =e= -b(h)* sum(t,Y(t)) ; e3.. NPV =e= sum[t,Z1(t)] + sum[h,Z2(h)] ; option solprint = off; option limcol = 0; option limrow = 0; option optcr = 0.00; model single_scenario /all/; parameter Xc,sc,scn ; for{sc =1 to 3, * this 'for' statement allows performing the deterministic problem under different scenarios Xc(s) = 0 + 1$(ord(s)= sc); cc = sum[s,Xc(s)*c(s)]; * here we fix the value of cc with the correspondent values of c(s) for each scenario solve single_scenario using minlp minimizing NPV; Y.fx(t) = Y.l(t); * we fix the solution found to obtain the NPV for each scenario under that solution found display Y.l; for[scn = 1 to 3, Xc(s) = 0 + 1$(ord(s)= scn); cc = sum[s,Xc(s)*c(s)]; solve single_scenario using minlp minimizing NPV; display NPV.l, Y.l; ]; Y.lo(t) = 0; Y.up(t) = 1; * we let free the variables and start again. };