本文整理了Java中com.powsybl.iidm.network.Terminal.getVoltageLevel()
方法的一些代码示例,展示了Terminal.getVoltageLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Terminal.getVoltageLevel()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Terminal
类名称:Terminal
方法名:getVoltageLevel
[英]Get the substation to which the terminal belongs.
[中]找到终端所属的变电站。
代码示例来源:origin: itesla/ipst
public String getEsgIdAndIncCounter(Terminal t) {
return getEsgIdAndIncCounter(t.getVoltageLevel());
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
/**
* Return true if the given {@link Branch} should be kept in the network, false otherwise
*/
private boolean test(Branch branch) {
Objects.requireNonNull(branch);
VoltageLevel vl1 = branch.getTerminal1().getVoltageLevel();
VoltageLevel vl2 = branch.getTerminal2().getVoltageLevel();
return test(vl1) && test(vl2);
}
代码示例来源:origin: itesla/ipst
/**
* Compute a reasonable maximum nominal power ('rate') for a TwoWindingsTransformer
* with a very high short-circuit power of 40%
*
* @param twt two winding transformer
* @return maximum nominal power
*/
private static double computeMaxRate(TwoWindingsTransformer twt) {
Objects.requireNonNull(twt);
VoltageLevel u2 = twt.getTerminal2().getVoltageLevel();
double z = SV.getX(twt);
return 0.4 * Math.pow(u2.getNominalV(), 2) / z;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-impl
private static void checkRemovability(Substation substation, Branch branch) {
Substation s1 = branch.getTerminal1().getVoltageLevel().getSubstation();
Substation s2 = branch.getTerminal2().getVoltageLevel().getSubstation();
if ((s1 != substation) || (s2 != substation)) {
throw createIsolationException(substation);
}
}
代码示例来源:origin: itesla/ipst
private static void addBranchSideData(LinkedHashMap<String, Double> branchesData, String branchId, Terminal terminal, double currentLimit) {
branchesData.put(getAttributeKey(branchId, terminal.getVoltageLevel().getId(), HistoDbAttr.I.name()), terminal.getI());
branchesData.put(getAttributeKey(branchId, terminal.getVoltageLevel().getId(), HistoDbAttr.P.name()), terminal.getP());
branchesData.put(getAttributeKey(branchId, terminal.getVoltageLevel().getId(), "IMAX"), currentLimit);
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
/**
* Return true if the given {@link HvdcLine} should be kept in the network, false otherwise
*/
protected boolean test(HvdcLine hvdcLine) {
Objects.requireNonNull(hvdcLine);
VoltageLevel vl1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel();
VoltageLevel vl2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel();
return test(vl1) && test(vl2);
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
/**
* Return true if the given {@link ThreeWindingsTransformer} should be kept in the network, false otherwise
*/
protected boolean test(ThreeWindingsTransformer transformer) {
Objects.requireNonNull(transformer);
VoltageLevel vl1 = transformer.getLeg1().getTerminal().getVoltageLevel();
VoltageLevel vl2 = transformer.getLeg2().getTerminal().getVoltageLevel();
VoltageLevel vl3 = transformer.getLeg3().getTerminal().getVoltageLevel();
return test(vl1) && test(vl2) && test(vl3);
}
代码示例来源:origin: com.powsybl/powsybl-iidm-impl
private static void checkRemovability(Substation substation, ThreeWindingsTransformer twt) {
Substation s1 = twt.getLeg1().getTerminal().getVoltageLevel().getSubstation();
Substation s2 = twt.getLeg2().getTerminal().getVoltageLevel().getSubstation();
Substation s3 = twt.getLeg3().getTerminal().getVoltageLevel().getSubstation();
if ((s1 != substation) || (s2 != substation) || (s3 != substation)) {
throw createIsolationException(substation);
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
@Override
protected void reduce(HvdcLine hvdcLine) {
VoltageLevel vl1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel();
VoltageLevel vl2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel();
if (getPredicate().test(vl1) || getPredicate().test(vl2)) {
throw new UnsupportedOperationException("Reduction of HVDC lines is not supported");
} else {
hvdcLine.remove();
}
observers.forEach(o -> o.hvdcLineRemoved(hvdcLine));
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
@Override
protected void reduce(ThreeWindingsTransformer transformer) {
VoltageLevel vl1 = transformer.getLeg1().getTerminal().getVoltageLevel();
VoltageLevel vl2 = transformer.getLeg2().getTerminal().getVoltageLevel();
VoltageLevel vl3 = transformer.getLeg3().getTerminal().getVoltageLevel();
if (getPredicate().test(vl1) || getPredicate().test(vl2) || getPredicate().test(vl3)) {
throw new UnsupportedOperationException("Reduction of three-windings transformers is not supported");
} else {
transformer.remove();
}
observers.forEach(o -> o.transformerRemoved(transformer));
}
代码示例来源:origin: itesla/ipst
private static void dumpLimits(EurostagDictionary dictionary, BufferedWriter writer, Branch branch) throws IOException {
dumpLimits(dictionary, writer, branch.getId(),
branch.getCurrentLimits1(),
branch.getCurrentLimits2(),
branch.getTerminal1().getVoltageLevel().getNominalV(),
branch.getTerminal2().getVoltageLevel().getNominalV());
}
代码示例来源:origin: com.powsybl/powsybl-iidm-impl
private static void checkRemovability(Substation substation, HvdcConverterStation station) {
HvdcLine hvdcLine = substation.getNetwork().getHvdcLine(station);
if (hvdcLine != null) {
Substation s1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel().getSubstation();
Substation s2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel().getSubstation();
if ((s1 != substation) || (s2 != substation)) {
throw createIsolationException(substation);
}
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
@Override
protected void reduce(Line line) {
Terminal terminal1 = line.getTerminal1();
Terminal terminal2 = line.getTerminal2();
VoltageLevel vl1 = terminal1.getVoltageLevel();
VoltageLevel vl2 = terminal2.getVoltageLevel();
if (getPredicate().test(vl1)) {
reduce(line, vl1, terminal1);
} else if (getPredicate().test(vl2)) {
reduce(line, vl2, terminal2);
} else {
line.remove();
}
observers.forEach(o -> o.lineRemoved(line));
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
@Override
protected void reduce(TwoWindingsTransformer transformer) {
Terminal terminal1 = transformer.getTerminal1();
Terminal terminal2 = transformer.getTerminal2();
VoltageLevel vl1 = terminal1.getVoltageLevel();
VoltageLevel vl2 = terminal2.getVoltageLevel();
if (getPredicate().test(vl1)) {
replaceTransformerByLoad(transformer, vl1, terminal1);
} else if (getPredicate().test(vl2)) {
replaceTransformerByLoad(transformer, vl2, terminal2);
} else {
transformer.remove();
}
observers.forEach(o -> o.transformerRemoved(transformer));
}
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
public AmplNetworkReader readGenerators() throws IOException {
// Bug fix, to avoid generators out of main cc to have a different target voltage while connected to same bus (Eurostag check)
// In that case it will not be part of result file, so not overwritten. So first reset all target voltages to nominal voltage
for (Generator g : network.getGenerators()) {
g.setTargetV(g.getTerminal().getVoltageLevel().getNominalV());
}
read("_generators", 9, this::readGenerator);
return this;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
private static double checkP(Terminal terminal) {
if (!terminal.isConnected()) {
return 0.0;
}
if (Double.isNaN(terminal.getP())) {
String connectableId = terminal.getConnectable().getId();
String voltageLevelId = terminal.getVoltageLevel().getId();
throw new PowsyblException("The active power of '" + connectableId + "' (" + voltageLevelId + ") is not set. Do you forget to compute the flows?");
}
return terminal.getP();
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
private static double checkQ(Terminal terminal) {
if (!terminal.isConnected()) {
return 0.0;
}
if (Double.isNaN(terminal.getQ())) {
String connectableId = terminal.getConnectable().getId();
String voltageLevelId = terminal.getVoltageLevel().getId();
throw new PowsyblException("The reactive power of '" + connectableId + "' (" + voltageLevelId + ") is not set. Do you forget to compute the flows?");
}
return terminal.getQ();
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-api
private static void addShuntCompensators(Network network, ConnectedPower balanceMainCC, ConnectedPower balanceOtherCC) {
for (ShuntCompensator sc : network.getShuntCompensators()) {
Terminal.BusBreakerView view = sc.getTerminal().getBusBreakerView();
double q = sc.getCurrentB() * Math.pow(sc.getTerminal().getVoltageLevel().getNominalV(), 2);
if (view.getBus() != null) {
addConnectedShunt(view, q, sc.getId(), balanceMainCC, balanceOtherCC);
} else {
addDisonnectedShunt(view, q, sc.getId(), balanceMainCC, balanceOtherCC);
}
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-reducer
private static void fillNodeOrBus(InjectionAdder adder, Terminal terminal) {
if (terminal.getVoltageLevel().getTopologyKind() == TopologyKind.NODE_BREAKER) {
adder.setNode(terminal.getNodeBreakerView().getNode());
} else {
if (terminal.isConnected()) {
adder.setBus(terminal.getBusBreakerView().getBus().getId());
}
adder.setConnectableBus(terminal.getBusBreakerView().getConnectableBus().getId());
}
}
代码示例来源:origin: itesla/ipst
private static void extractLoadsData(Network network, NetworkData networkData) {
for (Load load : network.getLoads()) {
networkData.addLoadData(new LoadData(load.getId(),
(load.getTerminal().getBusBreakerView().getBus() != null)
? load.getTerminal().getBusBreakerView().getBus().getId()
: load.getTerminal().getBusBreakerView().getConnectableBus().getId(),
load.getTerminal().getBusBreakerView().getBus() != null,
load.getTerminal().getVoltageLevel().getNominalV(),
load.getTerminal().getP(),
load.getTerminal().getQ())
);
}
}
内容来源于网络,如有侵权,请联系作者删除!