Class AcSensitivityAnalysis

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

public class AcSensitivityAnalysis extends Object
Author:
Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>, Gael Macherel <gael.macherel at artelys.com>
  • 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

    • AcSensitivityAnalysis

      public AcSensitivityAnalysis(com.powsybl.math.matrix.MatrixFactory matrixFactory, GraphConnectivityFactory<LfBus,LfBranch> connectivityFactory, com.powsybl.sensitivity.SensitivityAnalysisParameters parameters)
  • Method Details

    • 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)
      https://people.montefiore.uliege.be/vct/elec0029/lf.pdf / Equation 32 is transposed
    • createFactorGroups

      protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<AcVariableType,AcEquationType> createFactorGroups(List<com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<AcVariableType,AcEquationType>> 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<AcVariableType,AcEquationType>> lfFactors, DisabledNetwork disabledNetwork, PropagatedContingency propagatedContingency)
    • getPredefinedResults

      protected org.apache.commons.lang3.tuple.Pair<Optional<Double>,Optional<Double>> getPredefinedResults(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.LfSensitivityFactor<AcVariableType,AcEquationType> factor, DisabledNetwork disabledNetwork, PropagatedContingency propagatedContingency)
    • rescaleGlsk

      protected boolean rescaleGlsk(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorGroupList<AcVariableType,AcEquationType> factorGroups, Set<LfBus> nonConnectedBuses)
    • writeInvalidFactors

      protected com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<AcVariableType,AcEquationType> writeInvalidFactors(com.powsybl.openloadflow.sensi.AbstractSensitivityAnalysis.SensitivityFactorHolder<AcVariableType,AcEquationType> 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<AcVariableType,AcEquationType> 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)