本文整理了Java中com.powsybl.iidm.network.Generator.getMaxP()
方法的一些代码示例,展示了Generator.getMaxP()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Generator.getMaxP()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Generator
类名称:Generator
方法名:getMaxP
[英]Get the maximal active power in MW.
[中]获得最大有功功率,单位为MW。
代码示例来源:origin: itesla/ipst
private static boolean hasInconsistenceActiveLimits(Generator g) {
return g.getMaxP() > 2000;
}
代码示例来源:origin: itesla/ipst
public static double getRedispatchPMax(Generator generator, float redispatchLimitsPercentage) {
double redispatchPMax = generator.getMaxP();
if (generator.getTargetP() < generator.getMinP()) {
redispatchPMax = generator.getMinP() + redispatchLimitsPercentage * 0.01 * generator.getMaxP();
} else {
redispatchPMax = generator.getTargetP() + redispatchLimitsPercentage * 0.01 * generator.getMaxP();
}
return generator.getMaxP() > redispatchPMax ? redispatchPMax : generator.getMaxP();
}
代码示例来源:origin: com.powsybl/powsybl-action-util
@Override
public double maximumValue(Network n) {
Objects.requireNonNull(n);
Generator g = n.getGenerator(id);
return g != null ? g.getMaxP() : 0;
}
代码示例来源:origin: itesla/ipst
public static double getRedispatchPMin(Generator generator, float redispatchLimitsPercentage) {
double redispatchPMin = generator.getMinP();
if (generator.getTargetP() > generator.getMaxP()) {
redispatchPMin = generator.getMaxP() - redispatchLimitsPercentage * 0.01 * generator.getMaxP();
} else {
redispatchPMin = generator.getTargetP() - redispatchLimitsPercentage * 0.01 * generator.getMaxP();
}
return generator.getMinP() < redispatchPMin ? redispatchPMin : generator.getMinP();
}
代码示例来源:origin: itesla/ipst
public static Map<String, Double> getParticipationFactor(Network network) {
Map<String, Double> partecipationFactor = new HashMap<String, Double>();
for (Generator generator : network.getGenerators()) {
partecipationFactor.put(generator.getId(), generator.getMaxP());
}
return partecipationFactor;
}
代码示例来源:origin: itesla/ipst
public static double getNominalPower(Generator generator) {
Objects.requireNonNull(generator, "generator is null");
double nominalPower = Double.NaN;
double pMax = generator.getMaxP();
double qMax = generator.getReactiveLimits().getMaxQ(generator.getTargetP());
nominalPower = Math.sqrt(Math.pow(pMax, 2) + Math.pow(qMax, 2));
return nominalPower;
}
代码示例来源:origin: itesla/ipst
@Override
public void visitGenerator(Generator generator) {
if (generator.isVoltageRegulatorOn()) {
decoratedBus.regulatingGenerator++;
decoratedBus.maxP += generator.getMaxP();
decoratedBus.minP += generator.getMinP();
decoratedBus.targetP += generator.getTargetP();
}
}
});
代码示例来源:origin: com.powsybl/powsybl-action-util
@Override
public double scale(Network n, double asked) {
Objects.requireNonNull(n);
Generator g = n.getGenerator(id);
double done = 0;
if (g != null) {
Terminal t = g.getTerminal();
if (!t.isConnected()) {
connectGenerator(g);
}
done = Math.min(asked, g.getMaxP() - g.getTargetP());
double oldTargetP = g.getTargetP();
g.setTargetP(g.getTargetP() + done);
LOGGER.info("Change active power setpoint of {} from {} to {} (pmax={})",
g.getId(), oldTargetP, g.getTargetP(), g.getMaxP());
} else {
LOGGER.warn("Generator {} not found", id);
}
return done;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-api
private static void addGenerators(Network network, ConnectedPower balanceMainCC, ConnectedPower balanceOtherCC) {
for (Generator g : network.getGenerators()) {
Terminal.BusBreakerView view = g.getTerminal().getBusBreakerView();
if (view.getBus() != null) {
if (view.getBus().isInMainConnectedComponent()) {
balanceMainCC.connectedMaxGeneration += g.getMaxP();
balanceMainCC.connectedGeneration += g.getTargetP();
balanceMainCC.connectedGenerators.add(g.getId());
} else {
balanceOtherCC.connectedMaxGeneration += g.getMaxP();
balanceOtherCC.connectedGeneration += g.getTargetP();
balanceOtherCC.connectedGenerators.add(g.getId());
}
} else {
if (view.getConnectableBus().isInMainConnectedComponent()) {
balanceMainCC.disconnectedMaxGeneration += g.getMaxP();
balanceMainCC.disconnectedGeneration += g.getTargetP();
balanceMainCC.disconnectedGenerators.add(g.getId());
} else {
balanceOtherCC.disconnectedMaxGeneration += g.getMaxP();
balanceOtherCC.disconnectedGeneration += g.getTargetP();
balanceOtherCC.disconnectedGenerators.add(g.getId());
}
}
}
}
代码示例来源:origin: itesla/ipst
private boolean filteredGenerator(Generator g, boolean isFiltered) {
if (isFiltered) {
if (!Double.isNaN(g.getTerminal().getP()) && ((-g.getTerminal().getP() > g.getMaxP()) || (-g.getTerminal().getP() < g.getMinP()))) {
return true;
}
}
return false;
}
代码示例来源:origin: itesla/ipst
private boolean filteredGenerator(Generator g) {
if (configExport.getGensPQfilter()) {
if (!Double.isNaN(g.getTerminal().getP()) && ((-g.getTerminal().getP() > g.getMaxP()) || (-g.getTerminal().getP() < g.getMinP()))) {
return true;
}
}
return false;
}
代码示例来源:origin: itesla/ipst
public static void fixGeneratorActiveLimits(Network network, HistoDbClient histoDbClient, Interval interval) throws IOException, InterruptedException {
// replace strange pmin, pmax by historical limits
Set<HistoDbAttributeId> attributeIds = new LinkedHashSet<>();
for (Generator g : network.getGenerators()) {
if (hasInconsistenceActiveLimits(g)) {
attributeIds.add(new HistoDbNetworkAttributeId(g.getId(), HistoDbAttr.P));
}
}
if (attributeIds.size() > 0) {
HistoDbStats stats = histoDbClient.queryStats(attributeIds, interval, HistoDbHorizon.SN, true);
for (Generator g : network.getGenerators()) {
if (hasInconsistenceActiveLimits(g)) {
HistoDbNetworkAttributeId attributeId = new HistoDbNetworkAttributeId(g.getId(), HistoDbAttr.P);
double newMinP = -stats.getValue(HistoDbStatsType.MAX, attributeId, Float.NaN);
double newMaxP = -stats.getValue(HistoDbStatsType.MIN, attributeId, Float.NaN);
if (!Double.isNaN(newMinP) && !Double.isNaN(newMaxP)) {
LOGGER.debug("Fix active power limits of generator {}: [{}, {}] -> [{}, {}]",
g.getId(), g.getMinP(), g.getMaxP(), newMinP, newMaxP);
g.setMinP(newMinP);
g.setMaxP(newMaxP);
}
}
}
}
}
}
代码示例来源:origin: itesla/ipst
VoltageStats vstats = new VoltageStats(Range.closed(min, max), count, vl.getNominalV());
for (Generator g : vl.getGenerators()) {
vstats.pmax += g.getMaxP();
代码示例来源:origin: itesla/ipst
double redispatchPMax = redispatchLimits.containsKey(generator.getId()) ? redispatchLimits.get(generator.getId()).getPMax() : generator.getMaxP();
generator.getMinP(), generator.getMaxP(), redispatchPMin, redispatchPMax);
redispactchedP += -newP + generator.getTerminal().getP();
generator.getTerminal().setP(newP);
代码示例来源:origin: com.powsybl/powsybl-iidm-xml-converter
@Override
protected void writeRootElementAttributes(Generator g, VoltageLevel vl, NetworkXmlWriterContext context) throws XMLStreamException {
context.getWriter().writeAttribute("energySource", g.getEnergySource().name());
XmlUtil.writeDouble("minP", g.getMinP(), context.getWriter());
XmlUtil.writeDouble("maxP", g.getMaxP(), context.getWriter());
XmlUtil.writeDouble("ratedS", g.getRatedS(), context.getWriter());
context.getWriter().writeAttribute("voltageRegulatorOn", Boolean.toString(g.isVoltageRegulatorOn()));
XmlUtil.writeDouble("targetP", g.getTargetP(), context.getWriter());
XmlUtil.writeDouble("targetV", g.getTargetV(), context.getWriter());
XmlUtil.writeDouble("targetQ", g.getTargetQ(), context.getWriter());
writeNodeOrBus(null, g.getTerminal(), context);
writePQ(null, g.getTerminal(), context.getWriter());
}
代码示例来源:origin: itesla/ipst
LOGGER.debug("Network {} state {}: generator {} - P:{} -> P:{} - limits[{},{}]",
network.getId(), network.getStateManager().getWorkingStateId(), generatorId, oldActivePower, newActivePower,
network.getGenerator(generatorId).getMinP(), network.getGenerator(generatorId).getMaxP());
if (network.getGenerator(generatorId).getMaxP() < -newActivePower) {
LOGGER.warn("Network {} state {}: generator {} - new P ({}) > max P ({})",
network.getId(), network.getStateManager().getWorkingStateId(), generatorId, -newActivePower, network.getGenerator(generatorId).getMaxP());
代码示例来源:origin: itesla/ipst
double newMaxP = -fct.apply(new StateVariable(-srcGen.getMaxP(), srcSv.q, srcSv.u, srcSv.theta)).p;
srcGen.getId(), srcGen.getMinP(), srcGen.getMaxP(), newMinP, newMaxP);
代码示例来源:origin: itesla/ipst
generatorData.setMaxActivePower(generator.getMaxP());
generatorData.setMinReactivePower(generator.getReactiveLimits().getMinQ(generator.getTargetP()));
generatorData.setMaxReactivePower(generator.getReactiveLimits().getMaxQ(generator.getTargetP()));
代码示例来源:origin: itesla/ipst
double qgen = g.getTargetQ();
double pgmin = g.getMinP();
double pgmax = g.getMaxP();
boolean isQminQmaxInverted = g.getReactiveLimits().getMinQ(pgen) > g.getReactiveLimits().getMaxQ(pgen);
if (isQminQmaxInverted) {
代码示例来源:origin: itesla/ipst
dumpDataGeneratorAutomaton(g, eurostagSim, "A11", dtaOutStream, iidm2eurostagId);
} else {
log.warn("Dump automaton A11: skipping generator {} P outside limits MinP:{} P:{} MaxP:{}, ", g.getId(), g.getMinP(), -g.getTerminal().getP(), g.getMaxP());
dumpDataGeneratorAutomaton(g, eurostagSim, "A12", dtaOutStream, iidm2eurostagId);
} else {
log.warn("Dump automaton A12: skipping generator {} P outside limits MinP:{} P:{} MaxP:{}, ", g.getId(), g.getMinP(), -g.getTerminal().getP(), g.getMaxP());
内容来源于网络,如有侵权,请联系作者删除!