SanPen / GridCal

GridCal, a cross-platform power systems software written in Python with user interface, used in academia and industry.
https://www.advancedgridinsights.com/gridcal
Mozilla Public License 2.0
422 stars 95 forks source link

result different from PowerWorld #178

Closed weigao-123 closed 1 year ago

weigao-123 commented 1 year ago

case: https://github.com/SanPen/GridCal/blob/master/src/tests/data/grids/IEEE%2030%20bus.raw

lodf result from GridCal (only one column lodf is attached):

1_GlenLyn_132.0_2_Claytor_132.0_1
4_Hancock_132.0_6_Roanoke_132.0_1 6.077462e-01
6_Roanoke_132.0_7_Blaine_132.0_1 1.997210e-01
4_Hancock_132.0_12_Hancock_33.0_1 4.092236e-02
16_Bus16_33.0_17_Bus17_33.0_1 1.856839e-02
12_Hancock_33.0_16_Bus16_33.0_1 1.856839e-02
12_Hancock_33.0_15_Bus15_33.0_1 1.737964e-02
15_Bus15_33.0_23_Bus23_33.0_1 1.184819e-02
23_Bus23_33.0_24_Bus24_33.0_1 1.184819e-02
19_Bus19_33.0_20_Bus20_33.0_1 1.050578e-02
18_Bus18_33.0_19_Bus19_33.0_1 1.050578e-02
15_Bus15_33.0_18_Bus18_33.0_1 1.050578e-02
24_Bus24_33.0_25_Bus25_33.0_1 7.777503e-03
25_Bus25_33.0_27_Cloverdl_33.0_1 7.777503e-03
12_Hancock_33.0_14_Bus14_33.0_1 4.974331e-03
14_Bus14_33.0_15_Bus15_33.0_1 4.974331e-03
25_Bus25_33.0_26_Bus26_33.0_1 4.011478e-16
12_Hancock_33.0_13_Hancock_11.0_1 0.000000e+00
1_GlenLyn_132.0_3_Kumis_132.0_1 0.000000e+00
27_Cloverdl_33.0_29_Bus29_33.0_1 0.000000e+00
3_Kumis_132.0_4_Hancock_132.0_1 0.000000e+00
27_Cloverdl_33.0_30_Bus30_33.0_1 0.000000e+00
29_Bus29_33.0_30_Bus30_33.0_1 0.000000e+00
9_Roanoke_1.0_11_Roanoke_11.0_1 -4.011478e-16
6_Roanoke_132.0_8_Reusens_132.0_1 -1.543135e-03
8_Reusens_132.0_28_Cloverdl_132.0_1 -1.543135e-03
10_Roanoke_33.0_22_Bus22_33.0_1 -1.614181e-03
10_Roanoke_33.0_21_Bus21_33.0_1 -2.456505e-03
21_Bus21_33.0_22_Bus22_33.0_1 -2.456505e-03
22_Bus22_33.0_24_Bus24_33.0_1 -4.070686e-03
6_Roanoke_132.0_28_Cloverdl_132.0_1 -6.234368e-03
28_Cloverdl_132.0_27_Cloverdl_33.0_1 -7.777503e-03
10_Roanoke_33.0_20_Bus20_33.0_1 -1.050578e-02
6_Roanoke_132.0_10_Roanoke_33.0_1 -1.219026e-02
10_Roanoke_33.0_17_Bus17_33.0_1 -1.856839e-02
9_Roanoke_1.0_10_Roanoke_33.0_1 -2.095460e-02
6_Roanoke_132.0_9_Roanoke_1.0_1 -2.095460e-02
2_Claytor_132.0_5_Fieldale_132.0_1 -1.997210e-01
5_Fieldale_132.0_7_Blaine_132.0_1 -1.997210e-01
2_Claytor_132.0_6_Roanoke_132.0_1 -4.489475e-01
2_Claytor_132.0_4_Hancock_132.0_1 -6.005189e-01
1_GlenLyn_132.0_2_Claytor_132.0_1 -1.000000e+00

lodf result from PowerWorld:

BusNum BusName BusNum:1 BusName:1 LineCircuit LineMW LineLODFMult
0 12 Hancock 13 Hancock 1 0.000 1.000000e+08
1 9 Roanoke 11 Roanoke 1 0.000 1.000000e+08
2 25 Bus 25 26 Bus 26 1 3.545 1.000000e+08
3 3 Kumis 4 Hancock 1 82.210 1.000000e+02
4 1 Glen Lyn 3 Kumis 1 87.723 1.000000e+02
5 4 Hancock 6 Roanoke 1 72.147 2.949000e+01
6 6 Roanoke 7 Blaine 1 38.120 2.208000e+01
7 4 Hancock 12 Hancock 1 44.205 6.190000e+00
8 12 Hancock 16 Bus 16 1 7.249 2.950000e+00
9 16 Bus 16 17 Bus 17 1 3.696 2.950000e+00
10 15 Bus 15 23 Bus 23 1 5.039 2.310000e+00
11 23 Bus 23 24 Bus 24 1 1.808 2.310000e+00
12 25 Bus 25 27 Cloverdl 1 -4.758 2.240000e+00
13 24 Bus 24 25 Bus 25 1 -1.204 2.240000e+00
14 18 Bus 18 19 Bus 19 1 2.780 2.030000e+00
15 19 Bus 19 20 Bus 20 1 -6.727 2.030000e+00
16 15 Bus 15 18 Bus 18 1 6.020 2.030000e+00
17 12 Hancock 15 Bus 15 1 17.899 1.480000e+00
18 14 Bus 14 15 Bus 15 1 1.586 6.300000e-01
19 12 Hancock 14 Bus 14 1 7.859 6.300000e-01
20 27 Cloverdl 29 Bus 29 1 6.190 0.000000e+00
21 27 Cloverdl 30 Bus 30 1 7.092 0.000000e+00
22 29 Bus 29 30 Bus 30 1 3.703 0.000000e+00
23 10 Roanoke 22 Bus 22 1 7.619 -9.000000e-02
24 8 Reusens 28 Cloverdl 1 -0.542 -1.000000e-01
25 6 Roanoke 8 Reusens 1 29.569 -1.000000e-01
26 21 Bus 21 22 Bus 22 1 -1.821 -1.200000e-01
27 10 Roanoke 21 Bus 21 1 15.786 -1.200000e-01
28 6 Roanoke 28 Cloverdl 1 18.667 -3.700000e-01
29 22 Bus 22 24 Bus 24 1 5.742 -6.400000e-01
30 6 Roanoke 10 Roanoke 1 15.836 -1.980000e+00
31 10 Roanoke 20 Bus 20 1 9.023 -2.030000e+00
32 28 Cloverdl 27 Cloverdl 1 18.064 -2.240000e+00
33 6 Roanoke 9 Roanoke 1 27.718 -2.590000e+00
34 9 Roanoke 10 Roanoke 1 27.717 -2.590000e+00
35 10 Roanoke 17 Bus 17 1 5.331 -2.950000e+00
36 5 Fieldale 7 Blaine 1 -14.769 -2.208000e+01
37 2 Claytor 5 Fieldale 1 82.383 -2.208000e+01
38 2 Claytor 6 Roanoke 1 60.336 -2.939000e+01
39 2 Claytor 4 Hancock 1 43.622 -3.817000e+01
40 1 Glen Lyn 2 Claytor 1 173.228 -1.000000e+02

Both results look resonable, but the values are different, could you please help to investigate it? Please let me know if there is any other info I can provide. Thank you!

weigao-123 commented 1 year ago

@weigao-123 By the way, result from PW is in the unit of percentage and any value grater than 100 should be just 0

SanPen commented 1 year ago

Hi!

My first reaction, would be: Is power world LODF using the "AC" LODF derived using the jacobian, or is the one using the "DC" linear matrices? We use the linear matrices.

A side note is that the branch ordering might not be the same...

We've tested the LODF against PSSe but not Power world. In general LODF's produce mathematical glitches that Power World might correct differently from us.

Regardless, the best possible test is to compute the LODF with power flows and see who is "more correct".

Let me know if you need any assistance.

weigao-123 commented 1 year ago

Thank you!

I also used "Losses DC" method for the LODF calculation. Actually, the branch ordering alignment is done on my own, and so if we look a specific line

GridCal: lodf(1_GlenLyn_132.0_2_Claytor_132.0_1, 4_Hancock_132.0_6_Roanoke_132.0_1) = 0.6077462 PowerWorld: lodf(..., ...) = 0.2949000

Power flow testing for line flow "1_GlenLyn_132.0_2_Claytor_132.0_1" at outage "4_Hancock_132.0_6_Roanoke_132.0_1":

From this, I noticed maybe the row and column of LODF matrix in GridCal is transposed compared with PowerWorld; in PowerWorld, each row reprensents the outaged line, and each column reprensts the monitored line, but in GridCal, each row reprensents the monitored line, and each column reprensts the outaged line, am I correct?

SanPen commented 1 year ago

Yes, you are correct. The rows are the monitored branches and the columns is what changes, for the PTDF the changes are the bus injections and for the LODF the changes are the branch outages. Both have consistent dimentions in that sense.

Looking at it like that, the LODF in GridCal for your combination is 29.2369 MW.

weigao-123 commented 1 year ago

@SanPen Make sense, thank you so much!