|
10 | 10 |
|
11 | 11 | ############################################################################### |
12 | 12 | # Reactive OPF |
13 | | -# Author: Jean Maeght 2022 2023 |
14 | | -# Author: Manuel Ruiz 2023 2024 |
| 13 | +# Author: Jean Maeght 2022 2023 |
| 14 | +# Author: Manuel Ruiz 2023 2024 |
| 15 | +# Author: Oscar Lamolet 2025 |
15 | 16 | ############################################################################### |
16 | 17 |
|
17 | 18 |
|
@@ -44,18 +45,37 @@ let temp1 := min{(t,r) in REGL} regl_ratio_min[1,r]; |
44 | 45 | let temp2 := max{(t,r) in REGL} regl_ratio_max[1,r]; |
45 | 46 | printf{LOG_INFO} "Minimal transformer ratio : %.3f\n",temp1; |
46 | 47 | printf{LOG_INFO} "Maximal transformer ratio : %.3f\n",temp2; |
47 | | -for {(qq,m,n) in BRANCHCC_REGL: qq in PARAM_TRANSFORMERS_RATIO_VARIABLE |
48 | | - and not regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]] < regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]]} |
49 | | -{ |
50 | | - let messageInfo := sprintf ( |
51 | | - "Transformer %Q %Q(%ikV)->%Q(%ikV) cstratio=%.3f ratio_min=%.3f ratio_max=%.3f should have variable ratio but min and max are equal", |
52 | | - branch_id[1,qq,m,n], |
53 | | - substation_id[1,bus_substation[1,m]],substation_Vnomi[1,bus_substation[1,m]], |
54 | | - substation_id[1,bus_substation[1,n]],substation_Vnomi[1,bus_substation[1,n]], |
55 | | - branch_cstratio[1,qq,m,n], |
56 | | - regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]],regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]]); |
57 | | - printf{LOG_WARNING} "%s\n",messageInfo; |
58 | | - let messagesInfo := messagesInfo union {messageInfo}; |
| 48 | +param subex_idx; |
| 49 | +for {(qq,m,n) in BRANCHCC_REGL_FIX: qq in PARAM_TRANSFORMERS_RATIO_VARIABLE} { |
| 50 | + # Determination of substation side 2 (side 2 open case management) |
| 51 | + if n != -1 then { |
| 52 | + let subex_idx := bus_substation[1,n]; |
| 53 | + } else { |
| 54 | + let subex_idx := branch_subex[1,qq,m,n]; |
| 55 | + } |
| 56 | + # Case 1: RTC with side 2 disconnected |
| 57 | + if (qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED then { |
| 58 | + let messageInfo := sprintf( |
| 59 | + "Transformer %Q %Q(%ikV)->%Q(%ikV) has side 2 disconnected, RTC will be fixed in optimization", |
| 60 | + branch_id[1,qq,m,n], |
| 61 | + substation_id[1,bus_substation[1,m]], substation_Vnomi[1,bus_substation[1,m]], |
| 62 | + substation_id[1,subex_idx], substation_Vnomi[1,subex_idx]); |
| 63 | + printf{LOG_WARNING} "%s\n", messageInfo; |
| 64 | + let messagesInfo := messagesInfo union {messageInfo}; |
| 65 | + } |
| 66 | + # Case 2: RTC with min=max |
| 67 | + else if not (regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]] < regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]]) then { |
| 68 | + let messageInfo := sprintf( |
| 69 | + "Transformer %Q %Q(%ikV)->%Q(%ikV) cstratio=%.3f ratio_min=%.3f ratio_max=%.3f should have variable ratio but min and max are equal", |
| 70 | + branch_id[1,qq,m,n], |
| 71 | + substation_id[1,bus_substation[1,m]], substation_Vnomi[1,bus_substation[1,m]], |
| 72 | + substation_id[1,subex_idx], substation_Vnomi[1,subex_idx], |
| 73 | + branch_cstratio[1,qq,m,n], |
| 74 | + regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]], |
| 75 | + regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]]); |
| 76 | + printf{LOG_WARNING} "%s\n", messageInfo; |
| 77 | + let messagesInfo := messagesInfo union {messageInfo}; |
| 78 | + } |
59 | 79 | } |
60 | 80 | for {(qq,m,n) in BRANCHCC_REGL: regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]] <= temp1 * 1.01 |
61 | 81 | or regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]] >= temp2 * 0.99 } |
|
0 commit comments