diff --git a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java index 877fb4216e..3a0fbb5819 100644 --- a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java +++ b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java @@ -746,8 +746,8 @@ public static AcLoadFlowParameters createAcParameters(LoadFlowParameters paramet public static DcLoadFlowParameters createDcParameters(Network network, LoadFlowParameters parameters, OpenLoadFlowParameters parametersExt, MatrixFactory matrixFactory, GraphConnectivityFactory connectivityFactory, - boolean forcePhaseControlOffAndAddAngle1Var, boolean indexTerms) { - var dcParameters = createDcParameters(parameters, parametersExt, matrixFactory, connectivityFactory, forcePhaseControlOffAndAddAngle1Var, indexTerms); + boolean forcePhaseControlOffAndAddAngle1Var) { + var dcParameters = createDcParameters(parameters, parametersExt, matrixFactory, connectivityFactory, forcePhaseControlOffAndAddAngle1Var); if (parameters.isReadSlackBus()) { dcParameters.getNetworkParameters().setSlackBusSelector(new NetworkSlackBusSelector(network, dcParameters.getNetworkParameters().getSlackBusSelector())); } @@ -756,7 +756,7 @@ public static DcLoadFlowParameters createDcParameters(Network network, LoadFlowP public static DcLoadFlowParameters createDcParameters(LoadFlowParameters parameters, OpenLoadFlowParameters parametersExt, MatrixFactory matrixFactory, GraphConnectivityFactory connectivityFactory, - boolean forcePhaseControlOffAndAddAngle1Var, boolean indexTerms) { + boolean forcePhaseControlOffAndAddAngle1Var) { SlackBusSelector slackBusSelector = SlackBusSelector.fromMode(parametersExt.getSlackBusSelectionMode(), parametersExt.getSlackBusesIds(), parametersExt.getPlausibleActivePowerLimit()); var networkParameters = new LfNetworkParameters() @@ -785,7 +785,6 @@ public static DcLoadFlowParameters createDcParameters(LoadFlowParameters paramet .setSvcVoltageMonitoring(false); var equationSystemCreationParameters = new DcEquationSystemCreationParameters(true, - indexTerms, forcePhaseControlOffAndAddAngle1Var, parameters.isDcUseTransformerRatio()); diff --git a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java index 5730816aa1..eee5d79229 100644 --- a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java +++ b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java @@ -169,7 +169,7 @@ private LoadFlowResult runDc(Network network, LoadFlowParameters parameters, Rep OpenLoadFlowParameters parametersExt = OpenLoadFlowParameters.get(parameters); OpenLoadFlowParameters.logDc(parameters, parametersExt); - var dcParameters = OpenLoadFlowParameters.createDcParameters(network, parameters, parametersExt, matrixFactory, connectivityFactory, forcePhaseControlOffAndAddAngle1Var, false); + var dcParameters = OpenLoadFlowParameters.createDcParameters(network, parameters, parametersExt, matrixFactory, connectivityFactory, forcePhaseControlOffAndAddAngle1Var); List results = DcLoadFlowEngine.run(network, new LfNetworkLoaderImpl(), dcParameters, reporter); diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java b/src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java index de0fc5318b..8db9e7557f 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java @@ -763,7 +763,7 @@ public static EquationSystem create(LfNetwork ne Objects.requireNonNull(network); Objects.requireNonNull(creationParameters); - EquationSystem equationSystem = new EquationSystem<>(true); + EquationSystem equationSystem = new EquationSystem<>(); createBusesEquations(network, equationSystem, creationParameters); createBranchesEquations(network, equationSystem, creationParameters); diff --git a/src/main/java/com/powsybl/openloadflow/dc/DcValueVoltageInitializer.java b/src/main/java/com/powsybl/openloadflow/dc/DcValueVoltageInitializer.java index 660d71f91e..a9d21ae73c 100644 --- a/src/main/java/com/powsybl/openloadflow/dc/DcValueVoltageInitializer.java +++ b/src/main/java/com/powsybl/openloadflow/dc/DcValueVoltageInitializer.java @@ -47,7 +47,7 @@ public void prepare(LfNetwork network) { List busStates = distributedSlack ? ElementState.save(network.getBuses(), BusDcState::save) : null; DcLoadFlowParameters parameters = new DcLoadFlowParameters(networkParameters, - new DcEquationSystemCreationParameters(false, false, false, useTransformerRatio), + new DcEquationSystemCreationParameters(false, false, useTransformerRatio), matrixFactory, distributedSlack, balanceType, diff --git a/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystem.java b/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystem.java index 25a563c045..e3d3214361 100644 --- a/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystem.java +++ b/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystem.java @@ -120,7 +120,7 @@ private static void createBranches(LfNetwork network, EquationSystem create(LfNetwork network, DcEquationSystemCreationParameters creationParameters, boolean withListener) { - EquationSystem equationSystem = new EquationSystem<>(creationParameters.isIndexTerms()); + EquationSystem equationSystem = new EquationSystem<>(); createBuses(network, equationSystem); createBranches(network, equationSystem, creationParameters); diff --git a/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystemCreationParameters.java b/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystemCreationParameters.java index e05444f07b..a6d23f2807 100644 --- a/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystemCreationParameters.java +++ b/src/main/java/com/powsybl/openloadflow/dc/equations/DcEquationSystemCreationParameters.java @@ -13,8 +13,6 @@ public class DcEquationSystemCreationParameters { private final boolean updateFlows; - private final boolean indexTerms; - /** * The purpose of this option is to add a constant a1 var to the equation system, to calculate sensitivity regarding * phase. @@ -23,10 +21,9 @@ public class DcEquationSystemCreationParameters { private final boolean useTransformerRatio; - public DcEquationSystemCreationParameters(boolean updateFlows, boolean indexTerms, boolean forcePhaseControlOffAndAddAngle1Var, + public DcEquationSystemCreationParameters(boolean updateFlows, boolean forcePhaseControlOffAndAddAngle1Var, boolean useTransformerRatio) { this.updateFlows = updateFlows; - this.indexTerms = indexTerms; this.forcePhaseControlOffAndAddAngle1Var = forcePhaseControlOffAndAddAngle1Var; this.useTransformerRatio = useTransformerRatio; } @@ -35,10 +32,6 @@ public boolean isUpdateFlows() { return updateFlows; } - public boolean isIndexTerms() { - return indexTerms; - } - public boolean isForcePhaseControlOffAndAddAngle1Var() { return forcePhaseControlOffAndAddAngle1Var; } @@ -51,7 +44,6 @@ public boolean isUseTransformerRatio() { public String toString() { return "DcEquationSystemCreationParameters(" + "updateFlows=" + updateFlows + - ", indexTerms=" + indexTerms + ", forcePhaseControlOffAndAddAngle1Var=" + forcePhaseControlOffAndAddAngle1Var + ", useTransformerRatio=" + useTransformerRatio + ')'; diff --git a/src/main/java/com/powsybl/openloadflow/equations/AbstractEquationTerm.java b/src/main/java/com/powsybl/openloadflow/equations/AbstractEquationTerm.java index 884d00febe..7c4c149c2d 100644 --- a/src/main/java/com/powsybl/openloadflow/equations/AbstractEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/equations/AbstractEquationTerm.java @@ -8,6 +8,8 @@ import com.powsybl.math.matrix.DenseMatrix; +import java.util.Collections; +import java.util.List; import java.util.Objects; /** @@ -36,6 +38,11 @@ public void setStateVector(StateVector sv) { this.sv = Objects.requireNonNull(sv); } + @Override + public List> getChildren() { + return Collections.emptyList(); + } + @Override public Equation getEquation() { return equation; diff --git a/src/main/java/com/powsybl/openloadflow/equations/EquationSystem.java b/src/main/java/com/powsybl/openloadflow/equations/EquationSystem.java index 6d4c2a3236..0115d1660c 100644 --- a/src/main/java/com/powsybl/openloadflow/equations/EquationSystem.java +++ b/src/main/java/com/powsybl/openloadflow/equations/EquationSystem.java @@ -24,13 +24,11 @@ */ public class EquationSystem & Quantity, E extends Enum & Quantity> { - private final boolean indexTerms; - private final Map, Equation> equations = new HashMap<>(); private final Map, List>> equationsByElement = new HashMap<>(); - private final Map, List>> equationTermsByElement = new HashMap<>(); + private Map, List>> equationTermsByElement; private final List> listeners = new ArrayList<>(); @@ -41,16 +39,11 @@ public class EquationSystem & Quantity, E extends Enum & Qu private final EquationSystemIndex index; public EquationSystem() { - this(false); - } - - public EquationSystem(boolean indexTerms) { - this(new VariableSet<>(), indexTerms); + this(new VariableSet<>()); } - public EquationSystem(VariableSet variableSet, boolean indexTerms) { + public EquationSystem(VariableSet variableSet) { this.variableSet = Objects.requireNonNull(variableSet); - this.indexTerms = indexTerms; index = new EquationSystemIndex<>(this); } @@ -74,21 +67,38 @@ public Collection> getEquations() { return equations.values(); } - void addEquationTerm(EquationTerm equationTerm) { - if (indexTerms) { - Objects.requireNonNull(equationTerm); - Pair element = Pair.of(equationTerm.getElementType(), equationTerm.getElementNum()); - equationTermsByElement.computeIfAbsent(element, k -> new ArrayList<>()) - .add(equationTerm); + private void indexTerm(EquationTerm equationTerm) { + if (equationTermsByElement != null) { + if (equationTerm.getElementType() != null && equationTerm.getElementNum() != -1) { + Pair element = Pair.of(equationTerm.getElementType(), equationTerm.getElementNum()); + equationTermsByElement.computeIfAbsent(element, k -> new ArrayList<>()) + .add(equationTerm); + } + for (EquationTerm child : equationTerm.getChildren()) { + indexTerm(child); + } } + } + + private void indexAllTerms() { + if (equationTermsByElement == null) { + equationTermsByElement = new HashMap<>(); + for (var equation : equations.values()) { + for (var term : equation.getTerms()) { + indexTerm(term); + } + } + } + } + + void addEquationTerm(EquationTerm equationTerm) { + indexTerm(equationTerm); attach(equationTerm); } public List> getEquationTerms(ElementType elementType, int elementNum) { - if (!indexTerms) { - throw new PowsyblException("Equations terms have not been indexed"); - } Objects.requireNonNull(elementType); + indexAllTerms(); Pair element = Pair.of(elementType, elementNum); return equationTermsByElement.getOrDefault(element, Collections.emptyList()); } diff --git a/src/main/java/com/powsybl/openloadflow/equations/EquationTerm.java b/src/main/java/com/powsybl/openloadflow/equations/EquationTerm.java index fc67c0e9ed..615c92556f 100644 --- a/src/main/java/com/powsybl/openloadflow/equations/EquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/equations/EquationTerm.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.io.Writer; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.function.DoubleSupplier; @@ -39,6 +40,11 @@ class MultiplyByScalarEquationTerm & Quantity, E extends Enum< term.setSelf(this); } + @Override + public List> getChildren() { + return Collections.singletonList(term); + } + @Override public Equation getEquation() { return term.getEquation(); @@ -66,12 +72,12 @@ public void setSelf(EquationTerm self) { @Override public ElementType getElementType() { - return term.getElementType(); + return null; } @Override public int getElementNum() { - return term.getElementNum(); + return -1; } @Override @@ -125,53 +131,7 @@ static & Quantity, E extends Enum & Quantity> EquationTerm return new MultiplyByScalarEquationTerm<>(term, scalar); } - class VariableEquationTerm & Quantity, E extends Enum & Quantity> extends AbstractEquationTerm { - - private final List> variables; - - VariableEquationTerm(Variable variable) { - this.variables = List.of(Objects.requireNonNull(variable)); - } - - private Variable getVariable() { - return variables.get(0); - } - - @Override - public ElementType getElementType() { - return getVariable().getType().getElementType(); - } - - @Override - public int getElementNum() { - return getVariable().getElementNum(); - } - - @Override - public List> getVariables() { - return variables; - } - - @Override - public double eval() { - return sv.get(getVariable().getRow()); - } - - @Override - public double der(Variable variable) { - return 1; - } - - @Override - public double calculateSensi(DenseMatrix dx, int column) { - return dx.get(getVariable().getRow(), column); - } - - @Override - public void write(Writer writer) throws IOException { - getVariable().write(writer); - } - } + List> getChildren(); Equation getEquation(); diff --git a/src/main/java/com/powsybl/openloadflow/equations/Variable.java b/src/main/java/com/powsybl/openloadflow/equations/Variable.java index bb5654183d..cb8cb016af 100644 --- a/src/main/java/com/powsybl/openloadflow/equations/Variable.java +++ b/src/main/java/com/powsybl/openloadflow/equations/Variable.java @@ -76,7 +76,7 @@ public void write(Writer writer) throws IOException { } public & Quantity> EquationTerm createTerm() { - return new EquationTerm.VariableEquationTerm<>(this); + return new VariableEquationTerm<>(this); } @Override diff --git a/src/main/java/com/powsybl/openloadflow/equations/VariableEquationTerm.java b/src/main/java/com/powsybl/openloadflow/equations/VariableEquationTerm.java new file mode 100644 index 0000000000..67302a79c0 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/equations/VariableEquationTerm.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2022, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openloadflow.equations; + +import com.powsybl.math.matrix.DenseMatrix; +import com.powsybl.openloadflow.network.ElementType; + +import java.io.IOException; +import java.io.Writer; +import java.util.List; +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian + */ +public class VariableEquationTerm & Quantity, E extends Enum & Quantity> extends AbstractEquationTerm { + + private final List> variables; + + public VariableEquationTerm(Variable variable) { + this.variables = List.of(Objects.requireNonNull(variable)); + } + + private Variable getVariable() { + return variables.get(0); + } + + @Override + public ElementType getElementType() { + return getVariable().getType().getElementType(); + } + + @Override + public int getElementNum() { + return getVariable().getElementNum(); + } + + @Override + public List> getVariables() { + return variables; + } + + @Override + public double eval() { + return sv.get(getVariable().getRow()); + } + + @Override + public double der(Variable variable) { + return 1; + } + + @Override + public double calculateSensi(DenseMatrix dx, int column) { + return dx.get(getVariable().getRow(), column); + } + + @Override + public void write(Writer writer) throws IOException { + getVariable().write(writer); + } +} diff --git a/src/main/java/com/powsybl/openloadflow/sa/DcSecurityAnalysis.java b/src/main/java/com/powsybl/openloadflow/sa/DcSecurityAnalysis.java index bc09e5593c..0d8327a04c 100644 --- a/src/main/java/com/powsybl/openloadflow/sa/DcSecurityAnalysis.java +++ b/src/main/java/com/powsybl/openloadflow/sa/DcSecurityAnalysis.java @@ -228,7 +228,7 @@ private List createOperatorStrategyResults(DcSecurityAna boolean breakers = !(allSwitchesToOpen.isEmpty() && allSwitchesToClose.isEmpty()); var dcParameters = OpenLoadFlowParameters.createDcParameters(network, context.getParameters().getLoadFlowParameters(), - parametersExt, matrixFactory, connectivityFactory, false, true); + parametersExt, matrixFactory, connectivityFactory, false); dcParameters.getNetworkParameters().setBreakers(breakers); try (LfNetworkList lfNetworks = Networks.load(network, dcParameters.getNetworkParameters(), allSwitchesToOpen, allSwitchesToClose, Reporter.NO_OP)) { diff --git a/src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java b/src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java index 5c4edab9ea..f99ac5d3b4 100644 --- a/src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java +++ b/src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java @@ -215,7 +215,6 @@ private JacobianMatrix createJacobianMatrix(LfNe private static DcLoadFlowParameters createDcLoadFlowParameters(LfNetworkParameters networkParameters, MatrixFactory matrixFactory, LoadFlowParameters lfParameters) { var equationSystemCreationParameters = new DcEquationSystemCreationParameters(true, - true, true, lfParameters.isDcUseTransformerRatio()); diff --git a/src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java b/src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java index a25bdcb3b7..da94926ad3 100644 --- a/src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java +++ b/src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java @@ -48,8 +48,8 @@ void test() { @Test void testDcParameters() { Network network = Mockito.mock(Network.class); - DcLoadFlowParameters dcParameters = OpenLoadFlowParameters.createDcParameters(network, new LoadFlowParameters().setReadSlackBus(true), new OpenLoadFlowParameters(), new DenseMatrixFactory(), new EvenShiloachGraphDecrementalConnectivityFactory<>(), true, false); - assertEquals("DcLoadFlowParameters(networkParameters=LfNetworkParameters(slackBusSelector=NetworkSlackBusSelector, connectivityFactory=EvenShiloachGraphDecrementalConnectivityFactory, generatorVoltageRemoteControl=false, minImpedance=false, twtSplitShuntAdmittance=false, breakers=false, plausibleActivePowerLimit=5000.0, computeMainConnectedComponentOnly=true, countriesToBalance=[], distributedOnConformLoad=false, phaseControl=false, transformerVoltageControl=false, voltagePerReactivePowerControl=false, reactivePowerRemoteControl=false, dc=true, reactiveLimits=false, hvdcAcEmulation=false, minPlausibleTargetVoltage=0.8, maxPlausibleTargetVoltage=1.2, loaderPostProcessorSelection=[], reactiveRangeCheckMode=MAX, lowImpedanceThreshold=1.0E-8, svcVoltageMonitoring=false), equationSystemCreationParameters=DcEquationSystemCreationParameters(updateFlows=true, indexTerms=false, forcePhaseControlOffAndAddAngle1Var=true, useTransformerRatio=true), matrixFactory=DenseMatrixFactory, distributedSlack=true, balanceType=PROPORTIONAL_TO_GENERATION_P_MAX, setVToNan=true)", + DcLoadFlowParameters dcParameters = OpenLoadFlowParameters.createDcParameters(network, new LoadFlowParameters().setReadSlackBus(true), new OpenLoadFlowParameters(), new DenseMatrixFactory(), new EvenShiloachGraphDecrementalConnectivityFactory<>(), true); + assertEquals("DcLoadFlowParameters(networkParameters=LfNetworkParameters(slackBusSelector=NetworkSlackBusSelector, connectivityFactory=EvenShiloachGraphDecrementalConnectivityFactory, generatorVoltageRemoteControl=false, minImpedance=false, twtSplitShuntAdmittance=false, breakers=false, plausibleActivePowerLimit=5000.0, computeMainConnectedComponentOnly=true, countriesToBalance=[], distributedOnConformLoad=false, phaseControl=false, transformerVoltageControl=false, voltagePerReactivePowerControl=false, reactivePowerRemoteControl=false, dc=true, reactiveLimits=false, hvdcAcEmulation=false, minPlausibleTargetVoltage=0.8, maxPlausibleTargetVoltage=1.2, loaderPostProcessorSelection=[], reactiveRangeCheckMode=MAX, lowImpedanceThreshold=1.0E-8, svcVoltageMonitoring=false), equationSystemCreationParameters=DcEquationSystemCreationParameters(updateFlows=true, forcePhaseControlOffAndAddAngle1Var=true, useTransformerRatio=true), matrixFactory=DenseMatrixFactory, distributedSlack=true, balanceType=PROPORTIONAL_TO_GENERATION_P_MAX, setVToNan=true)", dcParameters.toString()); } diff --git a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowEngineTest.java b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowEngineTest.java index 773daabe3b..d657c5584d 100644 --- a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowEngineTest.java +++ b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowEngineTest.java @@ -35,7 +35,6 @@ void contextTest() { olfParameters, new DenseMatrixFactory(), new NaiveGraphConnectivityFactory<>(LfElement::getNum), - false, false); LfNetwork lfNetwork = LfNetwork.load(network, new LfNetworkLoaderImpl(), new LfNetworkParameters()).get(0); try (DcLoadFlowContext context = new DcLoadFlowContext(lfNetwork, dcParameters)) { diff --git a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowMatrixTest.java b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowMatrixTest.java index 6527ea2deb..815a72606e 100644 --- a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowMatrixTest.java +++ b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowMatrixTest.java @@ -58,7 +58,7 @@ void buildDcMatrix() { List lfNetworks = Networks.load(network, new FirstSlackBusSelector()); LfNetwork mainNetwork = lfNetworks.get(0); - DcEquationSystemCreationParameters creationParameters = new DcEquationSystemCreationParameters(true, false, false, true); + DcEquationSystemCreationParameters creationParameters = new DcEquationSystemCreationParameters(true, false, true); EquationSystem equationSystem = DcEquationSystem.create(mainNetwork, creationParameters, false); for (LfBus b : mainNetwork.getBuses()) { diff --git a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java index 6f77bb1e3b..f276bb124c 100644 --- a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java +++ b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java @@ -286,7 +286,7 @@ void testDisabledNonImpedantBranch() { .setDc(true) .setBreakers(true); DcLoadFlowParameters dcLoadFlowParameters = new DcLoadFlowParameters(lfNetworkParameters, - new DcEquationSystemCreationParameters(true, true, false, true), + new DcEquationSystemCreationParameters(true, false, true), new DenseMatrixFactory(), true, parameters.getBalanceType(), diff --git a/src/test/java/com/powsybl/openloadflow/equations/EquationSystemTest.java b/src/test/java/com/powsybl/openloadflow/equations/EquationSystemTest.java index 7a307d187a..4463d1719a 100644 --- a/src/test/java/com/powsybl/openloadflow/equations/EquationSystemTest.java +++ b/src/test/java/com/powsybl/openloadflow/equations/EquationSystemTest.java @@ -49,7 +49,7 @@ void test() { LfNetwork network = lfNetworks.get(0); LfBus bus = network.getBus(0); - EquationSystem equationSystem = new EquationSystem<>(true); + EquationSystem equationSystem = new EquationSystem<>(); equationSystem.addListener(new EquationSystemListener<>() { @Override public void onEquationChange(Equation equation, EquationEventType eventType) { @@ -173,7 +173,7 @@ void writeDcSystemTest() { List lfNetworks = Networks.load(EurostagTutorialExample1Factory.create(), new FirstSlackBusSelector()); LfNetwork network = lfNetworks.get(0); - EquationSystem equationSystem = DcEquationSystem.create(network, new DcEquationSystemCreationParameters(true, false, false, true), false); + EquationSystem equationSystem = DcEquationSystem.create(network, new DcEquationSystemCreationParameters(true, false, true), false); String ref = String.join(System.lineSeparator(), "bus_target_φ0 = φ0", "bus_target_p1 = dc_p_2(φ0, φ1) + dc_p_1(φ1, φ2) + dc_p_1(φ1, φ2)",