diff --git a/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java b/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java index e49d1d1a48..d20e57b34a 100644 --- a/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java +++ b/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java @@ -79,12 +79,12 @@ private void calculateSensitivityValues(List) factor).getVariableElement().equals(factor.getFunctionElement())) { // add nabla_p eta, fr specific cases // the only case currently: if we are computing the sensitivity of a phasetap change on itself - Variable phi1Var = factor.getFunctionEquationTerm().getVariables() + Variable a1Var = factor.getFunctionEquationTerm().getVariables() .stream() - .filter(var -> var.getElementNum() == factor.getFunctionElement().getNum() && var.getType().equals(AcVariableType.BRANCH_ALPHA1)) + .filter(v -> v.getElementNum() == factor.getFunctionElement().getNum() && v.getType() == AcVariableType.BRANCH_ALPHA1) .findAny() .orElseThrow(() -> new PowsyblException("No alpha_1 variable on the function branch")); - sensi += Math.toRadians(factor.getFunctionEquationTerm().der(phi1Var)); + sensi += Math.toRadians(factor.getFunctionEquationTerm().der(a1Var)); } } if (factor.getFunctionPredefinedResult() != null) {