$eolcom # $title jejuwind model *-------------------------------------------------------------------------------------------------------- * This model has been developed for the optimization of wind turbine deployment in Jeju Island * by Seongwhan Kang, 2021, Korea Advanced Institute of Science and Technology (KAIST). *-------------------------------------------------------------------------------------------------------- $offupper * Generate binary file and download the parameters $onecho >input_jejuwind_210428.txt # define excel range where to read input data Set=i rng=Index!A2:A9999 Rdim=1 par=ws rng=ws!A2:ZZ9999 Rdim=1 par=dc rng=dc!A2:ZZ9999 Rdim=1 Cdim=1 par=c_cab rng=c_cab!A2:ZZ9999 Rdim=1 Cdim=2 $offecho $CALL GDXXRW.EXE input_jejuwind.xlsx @input_jejuwind_210428.txt $GDXIN input_jejuwind.gdx # Open the binary file * SETS Definition SETS i(*) Potential wind turbine and offshore substation location c inner array cable capacity /1,2,3/ alias(i,j) $LOAD i # Read the set from binary file Parameters ws(i) wind speed of location l dc(i,j) decay of wind speed at location l when wind turbine is installed at location ll * cc(i) capital cost of wind turbine at location l c_cab(i,j,c) cost per m of cable with capacity c k(c) /1 5000000 2 7000000 3 9000000/ ; Scalars N_max /6/ q /0/ cc /10000/ ; * Reads the parameter value from the binary file $LOAD ws dc c_cab $GDXIN # Close the binary file $GDXIN input_jejuwind.gdx binary variables x(i) 1 if the wind turbine is constructed in location l y(i,j,c) 1 if the inner array cable with capacity c is constructed between location l and ll z(i,j) 1 if the inner array cable is constructed between location l and ll ; variables ws_d(i) decayed wind speed of location l p(i) average annual power generation of turbine l f(i,j) TotalPower sum of power generated by constructed turbines CableCost total cost of inner array cable TurbineCost total cost of wind turbine TotalCost obv ; positive variables ws_d, p, f ; Equations Eq1(i) Eq2(i) Eq3 Eq4(i,j) Eq5(j) Eq6(i,j) Eq7(i) Eq7b(i) Eq8(i,j) Eq10 Eq11 Eq12 Eq13 Eq14(i) Eq15(i) obj ; Eq1(i).. ws_d(i) =e= ws(i)*x(i)-sum(j, x(j)*dc(i,j)); Eq2(i).. p(i) =e= (482.1*ws_d(i)-2048*x(i))*8760; Eq3.. TotalPower =e= sum(i, p(i)); Eq4(i,j).. sum(c, y(i,j,c)) =e= z(i,j); Eq5(j).. sum(i, f(j,i)-f(i,j)) =e= p(j); Eq6(i,j).. sum(c, k(c)*y(i,j,c)) =g= f(i,j); Eq7(i).. sum(j, z(i,j)) =e= x(i); Eq7b(i).. sum(j, z(j,i)) =e= x(i); Eq8(i,j).. z(i,j) + z(j,i) =l= 1; Eq10.. CableCost =e= sum((i,j,c), c_cab(i,j,c)*y(i,j,c)); Eq11.. TurbineCost =e= sum(i, cc*x(i)); Eq12.. TotalCost =e= CableCost + TurbineCost; Eq13.. sum(i, x(i)) =e= 5; Eq14(i).. z(i,i) =e= 0; Eq15(i).. f(i,i) =e= 0; obj.. obv =e= TotalCost-TotalPower; option optcr = 0; Model jejuwind /All/; Option MIP = Cplex; jejuwind.optfile=1; $onecho>cplex.opt solvefinal 0 datacheck 2 quality 1 $offecho Solve jejuwind using mip maximizing obv; display x.l; display y.l; display z.l; display ws_d.l; display p.l;