本文整理了Java中com.powsybl.iidm.network.Load
类的一些代码示例,展示了Load
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Load
类的具体详情如下:
包路径:com.powsybl.iidm.network.Load
类名称:Load
[英]A constant power load (fixed p0 and q0).
p0 and q0 are given at the nominal voltage of the voltage level to which the load is connected (l.getTerminal().getVoltageLevel().getNominalV()).
To create a load, see LoadAdder
[中]恒定功率负载(固定p0和q0)。
p0和q0在负载所连接的电压电平的标称电压下给出(l.getTerminal()。getVoltageLevel()。getNominalV()。
要创建加载,请参见加载加法器
代码示例来源:origin: itesla/ipst
public LoadRecord(Load load, ConnectBusInfo busInfo, double snref, SourceEngine sourceEngine) {
this.load = load;
this.busInfo = busInfo;
this.loadId = load.getId();
this.busConnected = busInfo.isConnected();
this.p0 = this.load.getP0();
this.q0 = this.load.getQ0();
this.busVoltage = Double.NaN;
this.busAngle = Double.NaN;
this.sourceEngine = sourceEngine;
if (this.busConnected) {
if (load.getTerminal().getBusView().getBus() != null) {
if (!Double.isNaN(load.getTerminal().getBusView().getBus().getV())) {
busVoltage = load.getTerminal().getBusView().getBus().getV() / load.getTerminal().getVoltageLevel().getNominalV();
}
if (!Double.isNaN(load.getTerminal().getBusView().getBus().getAngle())) {
busAngle = load.getTerminal().getBusView().getBus().getAngle();
}
}
addLfParameters();
} else {
LOGGER.warn("Load " + this.getModelicaName() + " disconnected.");
this.addValue(StaticData.COMMENT + " Load " + this.getModelicaName() + " disconnected.");
}
if (this.busVoltage == 0) {
LOGGER.info("Voltage 0");
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-xml-converter
@Override
protected void writeRootElementAttributes(Load l, VoltageLevel vl, NetworkXmlWriterContext context) throws XMLStreamException {
context.getWriter().writeAttribute("loadType", l.getLoadType().name());
XmlUtil.writeDouble("p0", l.getP0(), context.getWriter());
XmlUtil.writeDouble("q0", l.getQ0(), context.getWriter());
writeNodeOrBus(null, l.getTerminal(), context);
writePQ(null, l.getTerminal(), context.getWriter());
}
代码示例来源:origin: itesla/ipst
public static ArrayList<String> getLoadsIds(Network network) {
Objects.requireNonNull(network, "network is null");
ArrayList<String> loadsIds = new ArrayList<String>();
for (Load load : network.getLoads()) {
if (load.getLoadType() != LoadType.FICTITIOUS) {
loadsIds.add(load.getId());
}
}
Collections.sort(loadsIds);
return loadsIds;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-api
private static void addLoads(Network network, ConnectedPower balanceMainCC, ConnectedPower balanceOtherCC) {
for (Load l : network.getLoads()) {
Terminal.BusBreakerView view = l.getTerminal().getBusBreakerView();
if (view.getBus() != null) {
if (view.getBus().isInMainConnectedComponent()) {
balanceMainCC.connectedLoads.add(l.getId());
balanceMainCC.connectedLoadVolume += l.getP0();
} else {
balanceOtherCC.connectedLoads.add(l.getId());
balanceOtherCC.connectedLoadVolume += l.getP0();
}
} else {
if (view.getConnectableBus().isInMainConnectedComponent()) {
balanceMainCC.disconnectedLoads.add(l.getId());
balanceMainCC.disconnectedLoadVolume += l.getP0();
} else {
balanceOtherCC.disconnectedLoads.add(l.getId());
balanceOtherCC.disconnectedLoadVolume += l.getP0();
}
}
}
}
代码示例来源:origin: itesla/ipst
@Override
public void visitLoad(Load load) {
terminals.add(load.getTerminal());
}
代码示例来源: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())
);
}
}
代码示例来源:origin: itesla/ipst
LOGGER.warn("stator voltage level: {}, bus: {}; no connected two-winding-transformer found, no step up transformer removed for load: {}", lvVlId, lvBus.getId(), aux.getId());
StateVariable hlSvAux = fct.apply(new StateVariable(-aux.getP0(), -aux.getQ0(), v, a));
boolean connected = aux.getTerminal().getBusBreakerView().getBus() != null;
aux.getId(), aux.getP0(), newP0, aux.getQ0(), newQ0);
LoadType loadType = aux.getLoadType();
if (loadType != LoadType.FICTITIOUS) {
loadType = LoadType.AUXILIARY;
aux.remove();
.setId(aux.getId())
.setName(aux.getName())
.setLoadType(loadType)
.setBus(connected ? hvBus.getId() : null)
代码示例来源:origin: itesla/ipst
throw new RuntimeException("Load '" + ls.id + "' not found");
double oldP0 = l.getP0();
double oldQ0 = l.getQ0();
LOGGER.trace(" load {} - P:{}, Q:{} -> P:{}, Q:{} ", l.getId(), oldP0, oldQ0, ls.p, ls.q);
l.setP0(ls.p).setQ0(ls.q);
l.getTerminal().setP(ls.p).setQ(ls.q);
代码示例来源:origin: itesla/ipst
if (hvAux != null && hvAux.getTerminal().getBusBreakerView().getConnectableBus() == hvGenConnectableBus) {
if (hvAux.getTerminal().getBusView().getBus() != null) {
if (!Double.isNaN(hvAux.getTerminal().getP())) {
hvAuxPf.p = hvAux.getTerminal().getP();
if (!Double.isNaN(hvAux.getTerminal().getQ())) {
hvAuxPf.q = hvAux.getTerminal().getQ();
hvAux.remove();
LOGGER.trace("Removing HV axiliary '{}' (p={}, q={})",
hvAux.getId(), hvAux.getTerminal().getP(), hvAux.getTerminal().getQ());
break;
if (l.getLoadType() != LoadType.FICTITIOUS) {
LOGGER.warn("Load {} connected to high voltage bus, maybe this is an auxiliary and should be move to low level?",
l.getId());
.setQ0((float) lvAuxPf.q)
.add();
lvAux.getTerminal()
.setP((float) lvAuxPf.p)
.setQ((float) lvAuxPf.q);
lvAux.getId(), lvAuxPf.p, lvAuxPf.q);
代码示例来源:origin: itesla/ipst
if (l.getTerminal().getVoltageLevel().getNominalV() <= 100 && l.getTerminal().isConnected()) { // connected HV load
if (l.getLoadType() != LoadType.AUXILIARY) {
dumpDataLoadAutomaton(l, eurostagSim, "A14_MT", dtaOutStream, iidm2eurostagId);
} else {
if (log.isDebugEnabled()) {
log.trace(l.getId() + " is considered as a generator auxiliary alimentation");
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private Void readLoad(String[] tokens) {
int num = Integer.parseInt(tokens[1]);
int busNum = Integer.parseInt(tokens[2]);
double p = readDouble(tokens[3]);
double q = readDouble(tokens[4]);
double p0 = readDouble(tokens[5]);
double q0 = readDouble(tokens[6]);
String id = mapper.getId(AmplSubset.LOAD, num);
Load l = network.getLoad(id);
if (l != null) {
l.setP0(p0).setQ0(q0);
l.getTerminal().setP(p).setQ(q);
busConnection(l.getTerminal(), busNum);
} else {
DanglingLine dl = network.getDanglingLine(id);
if (dl != null) {
dl.setP0(p0).setQ0(q0);
dl.getTerminal().setP(p).setQ(q);
busConnection(dl.getTerminal(), busNum);
} else {
throw new AmplException("Invalid load id '" + id + "'");
}
}
return null;
}
代码示例来源:origin: itesla/ipst
@Override
public String getId() {
return load.getId();
}
代码示例来源:origin: itesla/ipst
while (itrL.hasNext()) {
Load load = itrL.next();
System.out.println(" Load id: " + load.getId());
loadMW += load.getP0();
loadMVAR += load.getQ0();
if (uncertainties != null) {
int idMW = indexArray(uncertainties.getInjectionsIds(), load.getId() + "_P");
int idMVAR = indexArray(uncertainties.getInjectionsIds(), load.getId() + "_Q");
System.out.println(" " + load.getId() + "_P: " + idMW + ", " + load.getId() + "_Q: " + idMVAR);
if (idMW != -1 && idMVAR != -1) {
loadMW += uncertainties.getMeans()[idMW];
代码示例来源:origin: itesla/ipst
public static void applyInjections(Network network, String stateId, Map<String, Float> injections) {
Objects.requireNonNull(network);
Objects.requireNonNull(stateId);
Objects.requireNonNull(injections);
String originalStateId = network.getStateManager().getWorkingStateId();
network.getStateManager().setWorkingState(stateId);
injections.keySet().forEach(injection -> {
Load load = network.getLoad(injection);
if (load != null) {
double oldP = load.getTerminal().getP();
LOGGER.debug("Network {}, state {}: incrementing P of load {} from {} to {}",
network.getId(), network.getStateManager().getWorkingStateId(), injection, oldP, oldP + injections.get(injection));
load.getTerminal().setP(oldP + injections.get(injection));
load.setP0(oldP + injections.get(injection));
} else {
Generator generator = network.getGenerator(injection);
if (generator != null) {
double oldP = generator.getTerminal().getP();
LOGGER.debug("Network {}, state {}: incrementing P of generator {} from {} to {}",
network.getId(), network.getStateManager().getWorkingStateId(), injection, oldP, oldP + injections.get(injection));
generator.getTerminal().setP(oldP + injections.get(injection));
generator.setTargetP(-oldP - injections.get(injection));
} else {
LOGGER.error("No load or generator with id {} in network {}: cannot apply the injection", injection, network.getId());
}
}
});
network.getStateManager().setWorkingState(originalStateId);
}
代码示例来源:origin: itesla/ipst
if (l.getLoadType() == LoadType.FICTITIOUS) { // skip fictitious loads
continue;
Terminal t = l.getTerminal();
Bus bus = t.getBusView().getBus();
int ccNum = ConnectedComponents.getCcNum(bus);
代码示例来源:origin: itesla/ipst
double boundariesQ = 0.0;
for (Load l : network.getLoads()) {
if (l.getP0() > 0) {
loadPositiveP += l.getP0();
} else {
loadNegativeP += l.getP0();
if (l.getQ0() > 0) {
loadPositiveQ += l.getQ0();
} else {
loadNegativeQ += l.getQ0();
代码示例来源:origin: itesla/ipst
elements.append(StaticData.NEW_LINE);
for (Load load : Identifiables.sort(_network.getLoads())) {
elements.append(load.getId() + ";" + load.getName());
elements.append(StaticData.NEW_LINE);
count++;
代码示例来源:origin: itesla/ipst
@Override
public double getP() {
return load.getP0();
}
代码示例来源:origin: itesla/ipst
public Double getQ(String equipment) {
logger.debug(" network " + network.getName() + " equipment: " + equipment);
Double returnValue = null;
EquipmentTypes eqType = equipmentType(equipment);
if (eqType != null) {
switch (eqType) {
case GEN:
logger.debug(" equipment == generator");
returnValue = network.getGenerator(equipment).getTerminal().getQ();
break;
case LOAD:
logger.debug(" equipment == load");
returnValue = network.getLoad(equipment).getQ0();
break;
case LINE:
logger.debug(" equipment == line");
if (network.getLine(equipment).getTerminal1() != null) {
returnValue = network.getLine(equipment).getTerminal1().getQ();
}
if (network.getLine(equipment).getTerminal2() != null) {
returnValue = network.getLine(equipment).getTerminal2().getQ();
}
break;
}
}
if (returnValue != null) {
logger.debug(" RETURN Q: " + returnValue + " for Network: " + network.getName() + " Equipment: " + equipment);
}
return returnValue;
}
代码示例来源:origin: itesla/ipst
@Override
public void visitLoad(Load l) {
if (l.getLoadType() != LoadType.FICTITIOUS) {
visitInjection(l);
}
}
内容来源于网络,如有侵权,请联系作者删除!