@@ -80,6 +80,7 @@ struct Branch {
8080 REAL * sens_ratio_l_bound ; /**< @brief Sensitivity of tap ratio lower bound */
8181 REAL * sens_phase_u_bound ; /**< @brief Sensitivity of phase shift upper bound */
8282 REAL * sens_phase_l_bound ; /**< @brief Sensitivity of phase shift lower bound */
83+ REAL * sens_i_mag_u_bound ; /**< @brief Sensitivity of current magnitude upper bound */
8384
8485 // List
8586 Branch * reg_next ; /**< @brief List of branches regulating a bus voltage magnitude */
@@ -110,6 +111,7 @@ void BRANCH_array_del(Branch* br_array, int size) {
110111 free (br -> sens_ratio_l_bound );
111112 free (br -> sens_phase_u_bound );
112113 free (br -> sens_phase_l_bound );
114+ free (br -> sens_i_mag_u_bound );
113115 }
114116 free (br_array );
115117 }
@@ -161,6 +163,7 @@ void BRANCH_clear_sensitivities(Branch* br) {
161163 br -> sens_ratio_l_bound [t ] = 0 ;
162164 br -> sens_phase_u_bound [t ] = 0 ;
163165 br -> sens_phase_l_bound [t ] = 0 ;
166+ br -> sens_i_mag_u_bound [t ] = 0 ;
164167 }
165168 }
166169}
@@ -242,6 +245,7 @@ void BRANCH_copy_from_branch(Branch* br, Branch* other) {
242245 memcpy (br -> sens_ratio_l_bound ,other -> sens_ratio_l_bound ,num_periods * sizeof (REAL ));
243246 memcpy (br -> sens_phase_u_bound ,other -> sens_phase_u_bound ,num_periods * sizeof (REAL ));
244247 memcpy (br -> sens_phase_l_bound ,other -> sens_phase_l_bound ,num_periods * sizeof (REAL ));
248+ memcpy (br -> sens_i_mag_u_bound ,other -> sens_i_mag_u_bound ,num_periods * sizeof (REAL ));
245249
246250 // List
247251 // skip next
@@ -345,6 +349,13 @@ REAL BRANCH_get_sens_phase_l_bound(Branch* br, int t) {
345349 return 0 ;
346350}
347351
352+ REAL BRANCH_get_sens_i_mag_u_bound (Branch * br , int t ) {
353+ if (br && t >= 0 && t < br -> num_periods )
354+ return br -> sens_i_mag_u_bound [t ];
355+ else
356+ return 0 ;
357+ }
358+
348359int BRANCH_get_index (Branch * br ) {
349360 if (br )
350361 return br -> index ;
@@ -1281,6 +1292,7 @@ void BRANCH_init(Branch* br, int num_periods) {
12811292 ARRAY_zalloc (br -> sens_ratio_l_bound ,REAL ,T );
12821293 ARRAY_zalloc (br -> sens_phase_u_bound ,REAL ,T );
12831294 ARRAY_zalloc (br -> sens_phase_l_bound ,REAL ,T );
1295+ ARRAY_zalloc (br -> sens_i_mag_u_bound ,REAL ,T );
12841296
12851297 for (t = 0 ; t < br -> num_periods ; t ++ )
12861298 br -> ratio [t ] = 1. ;
@@ -1436,6 +1448,11 @@ void BRANCH_set_sens_phase_l_bound(Branch* br, REAL value, int t) {
14361448 br -> sens_phase_l_bound [t ] = value ;
14371449}
14381450
1451+ void BRANCH_set_sens_i_mag_u_bound (Branch * br , REAL value , int t ) {
1452+ if (br && t >= 0 && t < br -> num_periods )
1453+ br -> sens_i_mag_u_bound [t ] = value ;
1454+ }
1455+
14391456void BRANCH_set_index (Branch * br , int index ) {
14401457 if (br )
14411458 br -> index = index ;
0 commit comments