MATPOWER / matpower

MATPOWER – steady state power flow simulation and optimization for MATLAB and Octave
https://matpower.org
Other
429 stars 152 forks source link

Convergence of AC-OPF for distribution grid cases #208

Closed DoctorDro closed 7 months ago

DoctorDro commented 1 year ago

Dear all,

I have encountered a significant difficulty of OPF obtaining a feasible solution with several Matpower cases of distribution grids no matter how small in size. For example all the following cases: 'case136ma' 'case10ba' 'case118zh' 'case16am' 'case17me' 'case70da' 'case85' 'case94pi' 'case9target'

cannot converge to a feasible solution. All solvers, IPOPT, MIPS, FMINCON, fail. I activated special options to help IPOPT to converge. These are expect_infeasible_problem yes and start_with_resto yes. I also tried several barrier update strategies to no avail. Also tried the option opf.start=1,2,3. The really weird thing is that for opf.start=3, the initial guess is usually feasible if also pf.alg=YSUM or ISUM. But IPOPT or any other optimizer although it starts with a feasible solution, it quickly diverges and cannot get back the feasible region. I understand that power flow using the simple Newton algorithm does not converge. This is clear. Is this also the reason why OPF cannot converge, despite the sophisticated linesearches (filter or Merit-based) and 1-norm feasibility restoration algorithms?

Any idea how to remedy this behavior?

Best regards!

rdzman commented 1 year ago

The first thing I always try with a non-convergent OPF is to turn on soft limits to see whether there are limits that cause the problem to be infeasible. For example ...

>> mpc = loadcase('case10ba');      
>> mpc = toggle_softlims(mpc, 'on');
>> runopf(mpc)                      

MATPOWER Version 8.0b1, 30-May-2023
Optimal Power Flow -- AC-polar-power formulation
MATPOWER Interior Point Solver -- MIPS, Version 1.5, 12-Dec-2022
 (using built-in linear solver)
Converged!
OPF successful

Converged in 0.09 seconds
Objective Function Value = 8486.44 $/hr
================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses             10     Total Gen Capacity      10.0         -10.0 to 10.0
Generators         1     On-line Capacity        10.0         -10.0 to 10.0
Committed Gens     1     Generation (actual)     13.1               5.1
Loads              9     Load                    12.4               4.2
  Fixed            9       Fixed                 12.4               4.2
  Dispatchable     0       Dispatchable          -0.0 of -0.0      -0.0
Shunts             0     Shunt (inj)             -0.0               0.0
Branches           9     Losses (I^2 * Z)         0.69              0.91
Transformers       0     Branch Charging (inj)     -                0.0
Inter-ties         0     Total Inter-tie Flow     0.0               0.0
Areas              1

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   0.900 p.u. @ bus 10         1.052 p.u. @ bus 1   
Voltage Angle      -5.31 deg   @ bus 10         0.00 deg   @ bus 1   
P Losses (I^2*R)             -                  0.17 MW    @ line 5-6
Q Losses (I^2*X)             -                  0.25 MVAr  @ line 3-4
Lambda P         1020.00 $/MWh @ bus 1       4718.22 $/MWh @ bus 10  
Lambda Q            0.00 $/MWh @ bus 1       2288.90 $/MWh @ bus 10  

================================================================================
|     Bus Data                                                                 |
================================================================================
 Bus      Voltage          Generation             Load          Lambda($/MVA-hr)
  #   Mag(pu) Ang(deg)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)     P        Q   
----- ------- --------  --------  --------  --------  --------  -------  -------
    1  1.052    0.000*    13.06      5.10       -         -    1020.000     -
    2  1.045   -0.469       -         -        1.84      0.46  1048.579  76.626
    3  1.040   -1.137       -         -        0.98      0.34  1054.762 186.716
    4  1.017   -2.087       -         -        1.79      0.45  1232.417 419.363
    5  1.003   -2.374       -         -        1.60      1.84  1393.630 542.449
    6  0.974   -3.324       -         -        1.61      0.60  1856.170 871.113
    7  0.965   -3.691       -         -        0.78      0.11  2063.8321016.374
    8  0.948   -4.116       -         -        1.15      0.06  2522.1981232.536
    9  0.920   -4.803       -         -        0.98      0.13  3577.2001736.707
   10  0.900   -5.313       -         -        1.64      0.20  4718.2242288.896
                        --------  --------  --------  --------
               Total:     13.06      5.10     12.37      4.19

================================================================================
|     Branch Data                                                              |
================================================================================
Brnch   From   To    From Bus Injection   To Bus Injection     Loss (I^2 * Z)  
  #     Bus    Bus    P (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
-----  -----  -----  --------  --------  --------  --------  --------  --------
   1      1      2     13.06      5.10    -13.01     -4.96     0.041      0.14
   2      2      3     11.17      4.50    -11.17     -4.35     0.004      0.15
   3      3      4     10.19      4.01    -10.03     -3.76     0.156      0.25
   4      4      5      8.24      3.31     -8.14     -3.22     0.101      0.09
   5      5      6      6.55      1.38     -6.38     -1.24     0.167      0.15
   6      6      7      4.77      0.64     -4.73     -0.60     0.042      0.04
   7      7      8      3.95      0.49     -3.88     -0.45     0.066      0.04
   8      8      9      2.73      0.39     -2.65     -0.35     0.077      0.04
   9      9     10      1.67      0.22     -1.64     -0.20     0.034      0.02
                                                             --------  --------
                                                    Total:     0.687      0.91

================================================================================
|     Voltage Constraints                                                      |
================================================================================
Bus #  Vmin mu    Vmin    |V|   Vmax    Vmax mu
-----  --------   -----  -----  -----   --------
    1      -      1.000  1.052  1.000 99999.999
   10 82415.957   0.900  0.900  1.100      -    

================================================================================
|     Generation Constraints                                                   |
================================================================================
 Gen   Bus                  Active Power Limits
  #     #     Pmin mu     Pmin       Pg       Pmax    Pmax mu
----  -----   -------   --------  --------  --------  -------
   1     1       -         0.00     13.06     10.00  1000.000

================================================================================
|     Soft Voltage Upper Bounds                                                |
================================================================================
Bus    Voltage   Limit   Overload    mu
  #    Mag(pu)   (pu)     (pu)     ($/pu)
-----  -------  -------  -------  ---------
    1   1.052    1.000    0.052  99999.999
                        --------
               Total:      0.05

================================================================================
|     Soft Voltage Lower Bounds                                                |
================================================================================
----------------------------------------
 Bus   Voltage   Limit   Overload    mu
  #    Mag(pu)   (pu)     (pu)     ($/pu)
-----  -------  -------  -------  ---------
   10   0.900    0.900    0.000  82415.957
                        --------
               Total:      0.00

================================================================================
|     Soft Generator Active Power Upper Bounds                                 |
================================================================================
Gen     Bus  Generation  Limit   Overload    mu
  #      #     P (MW)    (MW)     (MW)     ($/MW)
-----  -----  --------  -------  -------  ---------
    1      1    13.06    10.00     3.06   1000.000
                                --------
                       Total:      3.06

================================================================================
|     Soft Generator Active Power Lower Bounds                                 |
================================================================================
No violations.

================================================================================
|     Soft Generator Reactive Power Upper Bounds                               |
================================================================================
No violations.

================================================================================
|     Soft Generator Reactive Power Lower Bounds                               |
================================================================================
No violations.

You can also use the checklimits() function in the extras directory to check for constraint violations in a power flow solution.

>> r = runpf('case10ba', mpoption('out.all', 0));

MATPOWER Version 8.0b1, 30-May-2023
Power Flow -- AC-polar-power formulation

Newton's method converged in 4 iterations.
PF successful
>> checklimits(r);                               

No Branch Flow Emergency Rating Violations
No Branch Flow Short Term Rating Violations
No Branch Flow Normal Rating Violations

Generator Active Limit Violations
No Pmin Violations
Pmax Violations
  gen       bus        Pmin         Pg         Pmax     violation  % violation
--------  --------  ----------  ----------  ----------  ----------  ----------
      1         1         0.0        13.2        10.0        3.15        31.5

Generator Reactive Limit Violations
No Qmin Violations
No Qmax Violations

Bus Voltage Limit Violations
Vmin Violations
   bus        Vmin         Vm         Vmax     violation  % violation
 --------  ----------  ----------  ----------  ----------  ----------
      10        0.90        0.84        1.10        0.06        5.68
       9        0.90        0.86        1.10        0.04        3.76
       8        0.90        0.89        1.10        0.01        1.00
No Vmax Violations