lanl-ansi / PowerModelsRestoration.jl

A PowerModels Extension for Optimization of Power Network Restoration
https://lanl-ansi.github.io/PowerModelsRestoration.jl/stable/
Other
22 stars 9 forks source link

AC ROP fails if there is no ref-bus, but AC OPF works fine. #67

Open noahrhodes opened 11 months ago

noahrhodes commented 11 months ago

When solving AC-ROP if there is no ref-bus (bustype==3) juniper will fail to solve the problem.

using PGLib, PowerModels, PowerModelsRestoration, Juniper, Ipopt
case = pglib("pglib_opf_case3_lmbd")
case["bus"]["1"]["bus_type"] = 2 # no ref bus
case["bus"]["2"]["bus_type"] = 2
case["bus"]["3"]["bus_type"] = 2
case["bus"]["1"]["damaged"] = 0 
case["bus"]["2"]["damaged"] = 1
case["bus"]["3"]["damaged"] = 1

case_mn = replicate_restoration_network(case, count_damaged_components(case))
julia> PowerModelsRestoration.run_rop(case_mn, ACPPowerModel, minlp_solver)
....
106r 7.4549345e+00 2.35e-04 1.72e+02  -7.0 7.34e-01    -  8.01e-01 6.62e-01h  1
 107r 9.7990705e+00 1.01e-04 2.19e+01  -7.0 5.53e-01    -  1.00e+00 9.38e-01h  1
 108r 1.1170669e+01 3.02e-05 2.67e-03  -7.0 3.22e-01    -  1.00e+00 1.00e+00h  1
Restoration phase converged to a feasible point that is
unacceptable to the filter for the original problem.
Restoration phase in the restoration phase failed.

Number of Iterations....: 108

                                   (scaled)                 (unscaled)
Objective...............:  -1.1328883119944665e+01    1.1328883119944665e+01
Dual infeasibility......:   3.9999993103033539e+01    3.9999993103033539e+01
Constraint violation....:   4.5380391761051797e-07    4.5380391761051797e-07
Variable bound violation:   5.6941909194847506e-09    5.6941909194847506e-09
Complementarity.........:   9.1147285638831260e-08    9.1147285638831260e-08
Overall NLP error.......:   3.9999993103033539e+01    3.9999993103033539e+01

Number of objective function evaluations             = 197
Number of objective gradient evaluations             = 92
Number of equality constraint evaluations            = 197
Number of inequality constraint evaluations          = 197
Number of equality constraint Jacobian evaluations   = 127
Number of inequality constraint Jacobian evaluations = 127
Number of Lagrangian Hessian evaluations             = 109
Total seconds in IPOPT                               = 0.339

EXIT: Restoration Failed!
    0       2                 -                          17.0               -     3.4       0         -

#branches: 1
Obj: NaN

This is not an issue for OPF

case = pglib("pglib_opf_case3_lmbd") # fails when there is not ref-bus
case["bus"]["1"]["bus_type"] = 2 # no ref-bus
case["bus"]["2"]["bus_type"] = 2 
case["bus"]["3"]["bus_type"] = 2

julia> run_opf(case, ACPPowerModel, minlp_solver)
...
EXIT: Optimal Solution Found.
Status of relaxation: LOCALLY_SOLVED
Time for relaxation: 0.1510000228881836
Relaxation Obj: 5812.64297227752
Obj: 5812.64297227752

Is there a particular reason for this issue related to NLP vs. MINLP problems?

This comes up as an issue when running cleanup of an rop solution for a followup optimization problem, where the bus_type might be overwritten, causing the subsequent optimization problem to fail.

PowerModelsRestoration.clean_status!(result_rop_ac["solution"]) # can overwrite the ref bus type
PowerModelsRestoration.update_status!(case, result_rop_ac["solution"]) # case now has no ref bus