Class DcSensitivityAnalysis

java.lang.Object
com.powsybl.openloadflow.sensi.DcSensitivityAnalysis

public class DcSensitivityAnalysis extends Object
Author:
Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>, GaĆ«l Macherel <[email protected]>
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
    • matrixFactory

      protected final com.powsybl.math.matrix.MatrixFactory matrixFactory
    • connectivityFactory

      protected final GraphConnectivityFactory<LfBus,LfBranch> 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

      protected static <V extends Enum<V> & Quantity, E extends Enum<E> & Quantity> void fillRhsSensitivityVariable(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<V,E> factorGroups, com.powsybl.math.matrix.Matrix rhs, Map<LfBus,Double> participationByBus)
    • 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

      protected void checkContingencies(LfNetwork lfNetwork, List<PropagatedContingency> contingencies)
    • 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

      protected static LfElement findBusTargetVoltageVariableElement(com.powsybl.iidm.network.Network network, String variableId, boolean breakers, LfNetwork lfNetwork)
    • hasBusTargetVoltage

      protected org.apache.commons.lang3.tuple.Pair<Boolean,Boolean> hasBusTargetVoltage(com.powsybl.sensitivity.SensitivityFactorReader factorReader, com.powsybl.iidm.network.Network network)
    • isDistributedSlackOnGenerators

      protected static boolean isDistributedSlackOnGenerators(DcLoadFlowParameters lfParameters)
    • isDistributedSlackOnLoads

      protected static boolean isDistributedSlackOnLoads(DcLoadFlowParameters lfParameters)
    • 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)