MATPOWER / matpower

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

Warning: Matrix is singular to working precision in MATPOWER #242

Open maxcted opened 1 month ago

maxcted commented 1 month ago

When I run an OPF, I get the following error.

MATPOWER Version 7.1, 08-Oct-2020 -- AC Optimal Power Flow AC OPF formulation: polar voltages, power balance eqns MATPOWER Interior Point Solver -- MIPS, Version 1.4, 08-Oct-2020 (using built-in linear solver) it objective step size feascond gradcond compcond costcond


0 1.7763568e-15 0.000428304 0.00496027 2186.56 0 1 1.7763568e-15 7.4045 0.00524663 68.9048 25.4479 0 2 1.7763568e-15 0.69573 0.00814967 37.2488 3.12069 0 3 1.7763568e-15 5.2207 0.00859758 85.0696 3.05602 0 4 1.7763568e-15 37.487 0.0109647 10.0493 3.11493 0 5 1.7763568e-15 348.97 1.534 12038.3 4.64429 0 6 1.7763568e-15 4163.1 1.53401 10.0813 129.055 0 7 1.7763568e-15 8.8852 0.0035359 216.279 12874.6 0 8 1.7763568e-15 9.2325 0.0041706 96.9162 2438.46 0 9 1.7763568e-15 1.8843 0.00731271 167.104 723.057 0 10 1.7763568e-15 10.85 0.00731032 1.14973 1843.38 0Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.683846e-20.

11 1.7763568e-15 28.908 0.00105491 49.2398 1666.51 0Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.606259e-20.

Numerically Failed

Did not converge in 12 iterations.

If i calculate the same MPC with a pf it runs normally and the result is the following:

MATPOWER Version 7.1, 08-Oct-2020 -- AC Power Flow (Newton)

Newton's method power flow (power balance, polar) converged in 4 iterations.

Converged in 0.00 seconds

| System Summary |

How many? How much? P (MW) Q (MVAr)


Buses 29 Total Gen Capacity 249.9 -300.0 to 300.0 Generators 57 On-line Capacity 249.9 -300.0 to 300.0 Committed Gens 57 Generation (actual) 7.6 0.4 Loads 28 Load 7.3 0.0 Fixed 28 Fixed 7.3 0.0 Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0 Shunts 0 Shunt (inj) -0.0 0.0 Branches 31 Losses (I^2 * Z) 0.30 0.68 Transformers 0 Branch Charging (inj) - 0.3 Inter-ties 0 Total Inter-tie Flow 0.0 0.0 Areas 1

                      Minimum                      Maximum
             -------------------------  --------------------------------

Voltage Magnitude 0.937 p.u. @ bus 26 1.000 p.u. @ bus 1
Voltage Angle -7.77 deg @ bus 26 0.00 deg @ bus 1
P Losses (I^2R) - 0.14 MW @ line 3-4 Q Losses (I^2X) - 0.20 MVAr @ line 3-4

================================================================================ | Bus Data |

Bus Voltage Generation Load

Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr)


1  1.000    0.000*     7.68      0.42       -         -   
2  0.998   -1.676       -         -        0.27      0.00 
3  0.978   -3.275       -         -        0.27      0.00 
4  0.950   -5.631       -         -        0.27      0.00 
5  0.948   -5.742       -         -        0.27      0.00 
6  0.948   -5.811       -         -        0.27      0.00 
7  0.947   -5.904       -         -        0.27      0.00 
8  0.944   -6.129       -         -        0.27      0.00 
9  0.945   -6.027       -         -        0.27      0.00 

10 0.944 -6.085 - - 0.27 0.00 11 0.943 -6.179 - - 0.27 0.00 12 0.943 -6.199 - - 0.27 0.00 13 1.000 -0.438 - - 0.27 0.00 14 0.993 -0.709 - - 0.27 0.00 15 0.991 -0.792 - - 0.27 0.00 16 0.993 -3.074 -0.01 0.00 0.25 0.00 17 0.972 -4.732 -0.01 0.00 0.25 0.00 18 0.944 -7.176 -0.01 0.00 0.25 0.00 19 0.943 -7.292 -0.01 0.00 0.25 0.00 20 0.942 -7.363 -0.01 0.00 0.25 0.00 21 0.941 -7.460 -0.01 0.00 0.25 0.00 22 0.938 -7.693 -0.01 0.00 0.25 0.00 23 0.939 -7.587 -0.01 0.00 0.25 0.00 24 0.939 -7.648 -0.01 0.00 0.25 0.00 25 0.938 -7.745 -0.01 0.00 0.25 0.00 26 0.937 -7.766 -0.01 0.00 0.25 0.00 27 0.995 -1.832 -0.01 0.00 0.25 0.00 28 0.988 -2.121 -0.01 0.00 0.25 0.00 29 0.986 -2.210 -0.01 0.00 0.25 0.00


           Total:      7.60      0.42      7.30      0.00

================================================================================ | 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 2 3 5.56 0.20 -5.45 -0.10 0.110 0.16 2 3 4 4.92 0.09 -4.78 0.03 0.140 0.20 3 4 5 1.59 -0.02 -1.59 0.01 0.002 0.00 4 5 6 1.06 -0.02 -1.06 0.01 0.001 0.00 5 6 7 0.53 -0.02 -0.53 -0.01 0.001 0.00 6 8 9 -0.53 -0.01 0.53 -0.02 0.001 0.00 7 9 10 1.59 0.00 -1.59 -0.00 0.001 0.00 8 10 11 1.06 -0.00 -1.06 -0.01 0.001 0.00 9 11 12 0.53 0.00 -0.53 -0.01 0.000 0.00 10 4 9 2.66 -0.02 -2.65 0.01 0.013 0.02 11 13 14 1.07 0.01 -1.06 -0.01 0.007 0.01 12 14 15 0.53 0.00 -0.53 -0.01 0.001 0.00 13 7 8 0.00 0.00 0.00 0.00 0.000 0.00 14 5 12 0.00 0.00 0.00 0.00 0.000 0.00 15 9 15 0.00 0.00 0.00 0.00 0.000 0.00 16 1 2 6.09 0.39 -6.08 -0.21 0.002 0.18 17 1 13 1.59 0.03 -1.59 -0.02 0.000 0.01 18 2 16 0.26 0.01 -0.26 -0.00 0.001 0.01 19 3 17 0.26 0.01 -0.26 0.00 0.001 0.01 20 4 18 0.26 0.01 -0.26 0.00 0.001 0.01 21 5 19 0.26 0.01 -0.26 0.00 0.001 0.01 22 6 20 0.26 0.01 -0.26 0.00 0.001 0.01 23 7 21 0.26 0.01 -0.26 -0.00 0.001 0.01 24 8 22 0.26 0.01 -0.26 0.00 0.001 0.01 25 9 23 0.26 0.01 -0.26 0.00 0.001 0.01 26 10 24 0.26 0.01 -0.26 0.00 0.001 0.01 27 11 25 0.26 0.01 -0.26 -0.00 0.001 0.01 28 12 26 0.26 0.01 -0.26 0.00 0.001 0.01 29 13 27 0.26 0.01 -0.26 0.00 0.001 0.01 30 14 28 0.26 0.01 -0.26 0.00 0.001 0.01 31 15 29 0.26 0.01 -0.26 0.00 0.001 0.01


                                                Total:     0.300      0.68
rdzman commented 1 month ago

It's possible the failure is due to the OPF being infeasible. I suggest trying it with OPF soft limits turned on. See Section 7.6.4 in the MATPOWER User's Manual.

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