@@ -102,7 +102,7 @@ function diff_reverse(model::Model, ϵ::Float64 = 1.0)
102102 perturbation = zeros (I + 1 )
103103
104104 # # Loop for each primal variable
105- for i in 1 : I+ 1
105+ for i in 1 : ( I+ 1 )
106106 # # Set the perturbation in the Primal Variables and set the context to Backward
107107 perturbation[i] = ϵ
108108 MOI. set .(model, DiffOpt. ReverseVariablePrimal (), vect_ref, perturbation)
156156# Result Primal Values:
157157Plots. plot (
158158 d,
159- data_results[1 , :, 1 : I+ 1 ];
159+ data_results[1 , :, 1 : ( I+ 1 ) ];
160160 title = " Generation by Demand" ,
161161 label = [" Thermal Generation 1" " Thermal Generation 2" " Thermal Generation 3" " Generation Deficit" ],
162162 xlabel = " Demand [unit]" ,
@@ -166,7 +166,7 @@ Plots.plot(
166166# Result Sensitivity Analysis:
167167Plots. plot (
168168 d,
169- data_results[1 , :, I+ 2 : 2 * (I+ 1 )];
169+ data_results[1 , :, ( I+ 2 ) : ( 2 * (I+ 1 ) )];
170170 title = " Sensitivity of Generation by Demand" ,
171171 label = [" T. Gen. 1 Sensitivity" " T. Gen. 2 Sensitivity" " T. Gen. 3 Sensitivity" " Gen. Deficit Sensitivity" ],
172172 xlabel = " Demand [unit]" ,
@@ -177,7 +177,7 @@ Plots.plot(
177177# Result Primal Values:
178178Plots. plot (
179179 d,
180- data_results[2 , :, 1 : I+ 1 ];
180+ data_results[2 , :, 1 : ( I+ 1 ) ];
181181 title = " Generation by Demand" ,
182182 label = [" Thermal Generation 1" " Thermal Generation 2" " Thermal Generation 3" " Generation Deficit" ],
183183 xlabel = " Demand [unit]" ,
@@ -187,7 +187,7 @@ Plots.plot(
187187# Result Sensitivity Analysis:
188188Plots. plot (
189189 d,
190- data_results[2 , :, I+ 2 : 2 * (I+ 1 )];
190+ data_results[2 , :, ( I+ 2 ) : ( 2 * (I+ 1 ) )];
191191 title = " Sensitivity of Generation by Demand" ,
192192 label = [" T. Gen. 1 Sensitivity" " T. Gen. 2 Sensitivity" " T. Gen. 3 Sensitivity" " Gen. Deficit Sensitivity" ],
193193 xlabel = " Demand [unit]" ,
0 commit comments