Skip to content

Commit

Permalink
Remove iterations of solver for ACOPF solving. Now, 200 iterations ma…
Browse files Browse the repository at this point in the history
…ximum. (#60)

Signed-off-by: parvy <pierre.arvy@artelys.com>
  • Loading branch information
p-arvy authored Mar 28, 2024
1 parent 18424ae commit 2f21380
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions open-reac/src/main/resources/openreac/reactiveopf.run
Original file line number Diff line number Diff line change
Expand Up @@ -979,45 +979,6 @@ if (log_level_knitro <= 1) then {
let nb_iter_last := problem_acopf_objective.numiters;
let nb_iter_total := nb_iter_total + nb_iter_last;

# <= 103 : feasible
# 200 convergence to unfeasible
# > 200 : failure
param solve_result_num_limit := 200;

if solve_result_num > solve_result_num_limit then
for {n in 1 .. 2}
{
# solve acopf and avoid knitro printing if user asks
if (log_level_knitro <= 1) then {
solve problem_acopf_objective > (nullDevice);
} else {
solve problem_acopf_objective;
}

let nb_iter_last := problem_acopf_objective.numiters;
let nb_iter_total := nb_iter_total + nb_iter_last;
if solve_result_num <= solve_result_num_limit then break;
}

# In case of failure and coeff_alpha was 1, then switch to coeff_alpha=0 to give more freedom to generation
if solve_result_num > solve_result_num_limit and coeff_alpha >= 0.999 then
for {n in 1 .. 2}
{
printf{LOG_DEBUG} "* change coeff_alpha from %f ",coeff_alpha;
let coeff_alpha := 0.0;
printf{LOG_DEBUG} " to %f\n",coeff_alpha;

# solve acopf and avoid knitro printing if user asks
if (log_level_knitro <= 1) then {
solve problem_acopf_objective > (nullDevice);
} else {
solve problem_acopf_objective;
}
let nb_iter_last := problem_acopf_objective.numiters;
let nb_iter_total := nb_iter_total + nb_iter_last;
if solve_result_num <= solve_result_num_limit then break;
}

printf{LOG_KNITRO} "\n** ACopf solve: end (%s -> %s)\n",tempstr,ctime();
printf{LOG_KNITRO} "######################################################################\n\n";

Expand All @@ -1026,6 +987,9 @@ printf{LOG_KNITRO} "############################################################
# Analysis of solve_result_num
###############################################################################

# <= 103 : feasible
# 200 convergence to unfeasible
# > 200 : failure
param output_results binary default 0;
if solve_result_num == 200
then {
Expand Down

0 comments on commit 2f21380

Please sign in to comment.