Skip to content

Commit

Permalink
Fix variable name (#713)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
  • Loading branch information
geofjamg committed Jan 31, 2023
1 parent dde2151 commit 9876378
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ private void calculateSensitivityValues(List<LfSensitivityFactor<AcVariableType,
((SingleVariableLfSensitivityFactor<AcVariableType, AcEquationType>) 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<AcVariableType> phi1Var = factor.getFunctionEquationTerm().getVariables()
Variable<AcVariableType> 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) {
Expand Down

0 comments on commit 9876378

Please sign in to comment.