Package com.powsybl.openloadflow.sensi
Class DcSensitivityAnalysis
java.lang.Object
com.powsybl.openloadflow.sensi.DcSensitivityAnalysis
- Author:
- Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>, Gaƫl Macherel <[email protected]>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GraphConnectivityFactory<LfBus,
LfBranch> protected static final org.slf4j.Logger
protected final com.powsybl.math.matrix.MatrixFactory
protected com.powsybl.sensitivity.SensitivityAnalysisParameters
-
Constructor Summary
ConstructorsConstructorDescriptionDcSensitivityAnalysis
(com.powsybl.math.matrix.MatrixFactory matrixFactory, GraphConnectivityFactory<LfBus, LfBranch> connectivityFactory, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
analyse
(com.powsybl.iidm.network.Network network, List<PropagatedContingency> contingencies, List<com.powsybl.sensitivity.SensitivityVariableSet> variableSets, com.powsybl.sensitivity.SensitivityFactorReader factorReader, com.powsybl.sensitivity.SensitivityResultWriter resultWriter, com.powsybl.commons.reporter.Reporter reporter, LfTopoConfig topoConfig) protected void
checkContingencies
(LfNetwork lfNetwork, List<PropagatedContingency> contingencies) protected void
checkLoadFlowParameters
(com.powsybl.loadflow.LoadFlowParameters lfParameters) protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<DcVariableType,
DcEquationType> createFactorGroups
(List<com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<DcVariableType, DcEquationType>> factors) fillRhsSensitivityVariable
(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<V, E> factorGroups, com.powsybl.math.matrix.Matrix rhs, Map<LfBus, Double> participationByBus) protected static boolean
filterBusTargetVoltageVariable
(double value, com.powsybl.sensitivity.SensitivityFunctionType function, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters) protected static boolean
filterSensitivityValue
(double value, com.powsybl.sensitivity.SensitivityVariableType variable, com.powsybl.sensitivity.SensitivityFunctionType function, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters) protected static LfElement
findBusTargetVoltageVariableElement
(com.powsybl.iidm.network.Network network, String variableId, boolean breakers, LfNetwork lfNetwork) protected static int
getLegNumber
(com.powsybl.sensitivity.SensitivityFunctionType type) protected static int
getLegNumber
(com.powsybl.sensitivity.SensitivityVariableType type) protected List<ParticipatingElement>
getParticipatingElements
(Collection<LfBus> buses, com.powsybl.loadflow.LoadFlowParameters.BalanceType balanceType, OpenLoadFlowParameters openLoadFlowParameters) getPredefinedResults
(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<DcVariableType, DcEquationType> factor, DisabledNetwork disabledNetwork, PropagatedContingency propagatedContingency) hasBusTargetVoltage
(com.powsybl.sensitivity.SensitivityFactorReader factorReader, com.powsybl.iidm.network.Network network) protected static boolean
isDistributedSlackOnGenerators
(DcLoadFlowParameters lfParameters) protected static boolean
isDistributedSlackOnLoads
(DcLoadFlowParameters lfParameters) protected static boolean
isFlowFunction
(com.powsybl.sensitivity.SensitivityFunctionType function) protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<DcVariableType,
DcEquationType> readAndCheckFactors
(com.powsybl.iidm.network.Network network, Map<String, com.powsybl.sensitivity.SensitivityVariableSet> variableSetsById, com.powsybl.sensitivity.SensitivityFactorReader factorReader, LfNetwork lfNetwork, boolean breakers) protected boolean
rescaleGlsk
(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<DcVariableType, DcEquationType> factorGroups, Set<LfBus> nonConnectedBuses) double[]
runDcLoadFlow
(DcLoadFlowContext loadFlowContext, DisabledNetwork disabledNetwork, com.powsybl.commons.reporter.Reporter reporter) A simplified version of DcLoadFlowEngine that supports on the fly bus and branch disabling and that do not update the state vector and the network at the end (because we don't need it to just evaluate a few equations)protected void
setPredefinedResults
(Collection<com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<DcVariableType, DcEquationType>> lfFactors, DisabledNetwork disabledNetwork, PropagatedContingency propagatedContingency) unscaleFunction
(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<V, E> factor, double value) Unscales function value from per-unit, according to its type.unscaleSensitivity
(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<V, E> factor, double sensitivity) Unscales sensitivity value from per-unit, according to its type.protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<DcVariableType,
DcEquationType> writeInvalidFactors
(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<DcVariableType, DcEquationType> factorHolder, com.powsybl.sensitivity.SensitivityResultWriter resultWriter, List<PropagatedContingency> contingencies) Write zero or skip factors to output and send a new factor holder containing only other valid ones.
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
matrixFactory
protected final com.powsybl.math.matrix.MatrixFactory matrixFactory -
connectivityFactory
-
parameters
protected com.powsybl.sensitivity.SensitivityAnalysisParameters parameters
-
-
Constructor Details
-
DcSensitivityAnalysis
public DcSensitivityAnalysis(com.powsybl.math.matrix.MatrixFactory matrixFactory, GraphConnectivityFactory<LfBus, LfBranch> connectivityFactory, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters)
-
-
Method Details
-
runDcLoadFlow
public double[] runDcLoadFlow(DcLoadFlowContext loadFlowContext, DisabledNetwork disabledNetwork, com.powsybl.commons.reporter.Reporter reporter) A simplified version of DcLoadFlowEngine that supports on the fly bus and branch disabling and that do not update the state vector and the network at the end (because we don't need it to just evaluate a few equations) -
analyse
public void analyse(com.powsybl.iidm.network.Network network, List<PropagatedContingency> contingencies, List<com.powsybl.sensitivity.SensitivityVariableSet> variableSets, com.powsybl.sensitivity.SensitivityFactorReader factorReader, com.powsybl.sensitivity.SensitivityResultWriter resultWriter, com.powsybl.commons.reporter.Reporter reporter, LfTopoConfig topoConfig) -
createFactorGroups
protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<DcVariableType,DcEquationType> createFactorGroups(List<com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<DcVariableType, DcEquationType>> factors) -
getParticipatingElements
protected List<ParticipatingElement> getParticipatingElements(Collection<LfBus> buses, com.powsybl.loadflow.LoadFlowParameters.BalanceType balanceType, OpenLoadFlowParameters openLoadFlowParameters) -
fillRhsSensitivityVariable
-
setPredefinedResults
protected void setPredefinedResults(Collection<com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<DcVariableType, DcEquationType>> lfFactors, DisabledNetwork disabledNetwork, PropagatedContingency propagatedContingency) -
getPredefinedResults
protected org.apache.commons.lang3.tuple.Pair<Optional<Double>,Optional<Double>> getPredefinedResults(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<DcVariableType, DcEquationType> factor, DisabledNetwork disabledNetwork, PropagatedContingency propagatedContingency) -
rescaleGlsk
protected boolean rescaleGlsk(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<DcVariableType, DcEquationType> factorGroups, Set<LfBus> nonConnectedBuses) -
writeInvalidFactors
protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<DcVariableType,DcEquationType> writeInvalidFactors(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<DcVariableType, DcEquationType> factorHolder, com.powsybl.sensitivity.SensitivityResultWriter resultWriter, List<PropagatedContingency> contingencies) Write zero or skip factors to output and send a new factor holder containing only other valid ones. IMPORTANT: this is only a base case test (factor status only deal with base case). We do not output anything on post contingency if factor is already invalid (skip o zero) on base case. Except for factors with specific contingency context, we output the invalid status found during base case analysis. -
checkContingencies
-
checkLoadFlowParameters
protected void checkLoadFlowParameters(com.powsybl.loadflow.LoadFlowParameters lfParameters) -
readAndCheckFactors
protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<DcVariableType,DcEquationType> readAndCheckFactors(com.powsybl.iidm.network.Network network, Map<String, com.powsybl.sensitivity.SensitivityVariableSet> variableSetsById, com.powsybl.sensitivity.SensitivityFactorReader factorReader, LfNetwork lfNetwork, boolean breakers) -
findBusTargetVoltageVariableElement
-
hasBusTargetVoltage
-
isDistributedSlackOnGenerators
-
isDistributedSlackOnLoads
-
unscaleSensitivity
protected static <V extends Enum<V> & Quantity,E extends Enum<E> & Quantity> double unscaleSensitivity(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<V, E> factor, double sensitivity) Unscales sensitivity value from per-unit, according to its type. -
unscaleFunction
protected static <V extends Enum<V> & Quantity,E extends Enum<E> & Quantity> double unscaleFunction(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<V, E> factor, double value) Unscales function value from per-unit, according to its type. -
getLegNumber
protected static int getLegNumber(com.powsybl.sensitivity.SensitivityFunctionType type) -
getLegNumber
protected static int getLegNumber(com.powsybl.sensitivity.SensitivityVariableType type) -
filterSensitivityValue
protected static boolean filterSensitivityValue(double value, com.powsybl.sensitivity.SensitivityVariableType variable, com.powsybl.sensitivity.SensitivityFunctionType function, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters) -
filterBusTargetVoltageVariable
protected static boolean filterBusTargetVoltageVariable(double value, com.powsybl.sensitivity.SensitivityFunctionType function, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters) -
isFlowFunction
protected static boolean isFlowFunction(com.powsybl.sensitivity.SensitivityFunctionType function)
-