Skip to content

Commit

Permalink
New test
Browse files Browse the repository at this point in the history
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
  • Loading branch information
Hadrien-Godard committed May 25, 2022
1 parent 8a34d3c commit b9e84c5
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2058,4 +2058,25 @@ void testContingencyOnHvdcInAcEmulation() {
assertEquals(result2.getBranchFlow1FunctionReferenceValue(null, "l25"), result.getBranchFlow1FunctionReferenceValue("hvdc34", "l25"), LoadFlowAssert.DELTA_POWER);
assertEquals(result2.getBranchFlow1FunctionReferenceValue(null, "l56"), result.getBranchFlow1FunctionReferenceValue("hvdc34", "l56"), LoadFlowAssert.DELTA_POWER);
}

@Test
void testLosingALineButBothEndsInMainComponent() {
Network network = ConnectedComponentNetworkFactory.createTwoComponentWithGeneratorOnOneSide();
runDcLf(network);

SensitivityAnalysisParameters sensiParameters = createParameters(true, "b3_vl_0", false);

List<Contingency> contingencies = List.of(new Contingency("l34+l12", new BranchContingency("l34"), new BranchContingency("l12")));

List<SensitivityFactor> factors = createFactorMatrix(List.of(network.getGenerator("g3")),
List.of(network.getLine("l12")),
"l34+l12");

SensitivityAnalysisResult result = sensiRunner.run(network, factors, contingencies, Collections.emptyList(), sensiParameters);

assertEquals(1, result.getValues("l34+l12").size());

assertEquals(0.0, result.getBranchFlow1SensitivityValue("l34+l12", "g3", "l12"), LoadFlowAssert.DELTA_POWER);
assertEquals(Double.NaN, result.getBranchFlow1FunctionReferenceValue("l34+l12", "l12"), LoadFlowAssert.DELTA_POWER);
}
}

0 comments on commit b9e84c5

Please sign in to comment.