@@ -211,16 +211,16 @@ template <symmetry_tag sym_type> class IterativeLinearSESolver {
211
211
}
212
212
// branch
213
213
else {
214
- auto const add_branch_measurement =
215
- [&block, ¶m, obj, type](IntS measured_side, RealValue<sym> const & current_variance) {
216
- // branch from- and to-side index at 0, and 1 position
217
- IntS const b0 = static_cast <IntS>(type) / 2 ;
218
- IntS const b1 = static_cast <IntS>(type) % 2 ;
219
- block. g () +=
220
- dot (hermitian_transpose (param.branch_param [obj].value [measured_side * 2 + b0]),
221
- diagonal_inverse (current_variance ),
222
- param.branch_param [obj].value [measured_side * 2 + b1]);
223
- };
214
+ auto const add_branch_measurement = [&block, ¶m, obj,
215
+ type](IntS measured_side,
216
+ RealValue<sym> const & branch_current_variance) {
217
+ // branch from- and to-side index at 0, and 1 position
218
+ IntS const b0 = static_cast <IntS>(type) / 2 ;
219
+ IntS const b1 = static_cast <IntS>(type) % 2 ;
220
+ block. g () += dot (hermitian_transpose (param.branch_param [obj].value [measured_side * 2 + b0]),
221
+ diagonal_inverse (branch_current_variance ),
222
+ param.branch_param [obj].value [measured_side * 2 + b1]);
223
+ };
224
224
// measured at from-side: 0, to-side: 1
225
225
for (IntS const measured_side : std::array<IntS, 2 >{0 , 1 }) {
226
226
// has measurement
@@ -329,7 +329,7 @@ template <symmetry_tag sym_type> class IterativeLinearSESolver {
329
329
// measured at from-side: 0, to-side: 1
330
330
for (IntS const measured_side : std::array<IntS, 2 >{0 , 1 }) {
331
331
// the current needs to be calculated with the voltage of the measured bus side
332
- // NOTE: not the current bus!
332
+ // NOTE: not the bus that is currently being processed !
333
333
Idx const measured_bus = branch_bus_idx[obj][measured_side];
334
334
335
335
// has measurement
@@ -345,12 +345,12 @@ template <symmetry_tag sym_type> class IterativeLinearSESolver {
345
345
CurrentSensorCalcParam<sym> const m =
346
346
std::invoke (branch_current_[measured_side], measured_value, obj);
347
347
// for local angle current sensors, the current needs to be offset with the phase offset
348
- // of the measured bus side. NOTE: not the current bus!
349
- auto global_current = static_cast <IndependentComplexRandVar<sym>>(m.measurement );
348
+ // of the measured bus side. NOTE: not the bus that is currently being processed !
349
+ auto measured_current = static_cast <IndependentComplexRandVar<sym>>(m.measurement );
350
350
if (m.angle_measurement_type == AngleMeasurementType::local_angle) {
351
- global_current .value *= phase_shift (u[measured_bus]); // offset with the phase shift
351
+ measured_current .value *= phase_shift (u[measured_bus]); // offset with the phase shift
352
352
}
353
- add_branch_measurement (measured_side, global_current );
353
+ add_branch_measurement (measured_side, measured_current );
354
354
}
355
355
}
356
356
}
0 commit comments