本文整理了Java中com.powsybl.iidm.network.Bus.getAngle()
方法的一些代码示例,展示了Bus.getAngle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bus.getAngle()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Bus
类名称:Bus
方法名:getAngle
[英]Get the voltage angle of the bus in degree.
[中]以度为单位获取母线的电压角。
代码示例来源:origin: com.powsybl/powsybl-iidm-impl
@Override
public double getAngle() {
checkValidity();
for (Bus b : buses) {
if (!Double.isNaN(b.getAngle())) {
return b.getAngle();
}
}
return Double.NaN;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-api
private static double getTheta(LegBase<?> leg) {
return leg.getTerminal().isConnected() ? Math.toRadians(leg.getTerminal().getBusView().getBus().getAngle())
: Double.NaN;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-xml-converter
@Override
protected void writeRootElementAttributes(Bus b, VoltageLevel vl, NetworkXmlWriterContext context) throws XMLStreamException {
XmlUtil.writeDouble("v", b.getV(), context.getWriter());
XmlUtil.writeDouble("angle", b.getAngle(), context.getWriter());
}
代码示例来源:origin: itesla/ipst
private static void fillGeneratorState(Generator g, StateVariable sv) {
Terminal t = g.getTerminal();
Bus b = t.getBusBreakerView().getBus();
if (Double.isNaN(t.getP())) {
sv.p = 0;
} else {
sv.p = t.getP();
}
if (Double.isNaN(t.getQ())) {
sv.q = 0;
} else {
sv.q = t.getQ();
}
if (b != null && !Double.isNaN(b.getV()) && !Double.isNaN(b.getAngle())) { // generator is connected
sv.u = b.getV();
sv.theta = b.getAngle();
} else {
sv.u = t.getVoltageLevel().getNominalV();
sv.theta = 0;
}
if (!sv.isValid()) {
throw new RuntimeException("Invalid sv " + g.getId() + ": " + sv);
}
}
代码示例来源:origin: itesla/ipst
LOGGER.info("#------------ --------------- --------------- ");
for (Bus bus : network.getBusBreakerView().getBuses()) {
LOGGER.info(String.format("%s %15.8f %15.8f", bus.getId(), bus.getV(), bus.getAngle()));
代码示例来源:origin: itesla/ipst
/**
* Constructor to buses that come from the IIDM network.
* @param bus
*/
public BusRecord(Bus bus) {
this.bus = bus;
this.busId = bus.getId();
if (!Double.isNaN(this.bus.getV())) {
this.busVoltage = bus.getV() / bus.getVoltageLevel().getNominalV();
this.busAngle = this.bus.getAngle();
addParameter(StaticData.V_0, this.busVoltage);
addParameter(StaticData.ANGLE_0, this.busAngle);
} else {
this.busVoltage = Float.NaN;
}
}
代码示例来源:origin: itesla/ipst
private boolean compareSwitchToRemove(VoltageLevel vl, Bus bus, Switch s1, Switch s2) {
if (s1.isFictitious()) {
return true;
}
if (s2.isFictitious()) {
return false;
}
if (s1.getKind() != s2.getKind()) {
return s1.getKind() == SwitchKind.BREAKER;
}
Bus b1 = vl.getBusBreakerView().getBus1(s1.getId()).equals(bus)
? vl.getBusBreakerView().getBus2(s1.getId())
: vl.getBusBreakerView().getBus1(s1.getId());
Bus b2 = vl.getBusBreakerView().getBus1(s2.getId()).equals(bus)
? vl.getBusBreakerView().getBus2(s2.getId())
: vl.getBusBreakerView().getBus1(s2.getId());
if (b1.getAngle() != b2.getAngle()) {
return b1.getAngle() < b2.getAngle();
}
return s1.getId().compareTo(s2.getId()) < 0;
}
代码示例来源:origin: com.powsybl/powsybl-iidm-api
public TwtTestData() {
Bus leg1Bus = Mockito.mock(Bus.class);
Mockito.when(leg1Bus.getV()).thenReturn(U1);
Mockito.when(leg1Bus.getAngle()).thenReturn(ANGLE1);
Mockito.when(leg1Bus.isInMainConnectedComponent()).thenReturn(MAIN_COMPONENT1);
Mockito.when(leg2Bus.getAngle()).thenReturn(ANGLE2);
Mockito.when(leg2Bus.isInMainConnectedComponent()).thenReturn(MAIN_COMPONENT2);
Mockito.when(leg3Bus.getAngle()).thenReturn(ANGLE3);
Mockito.when(leg3Bus.isInMainConnectedComponent()).thenReturn(MAIN_COMPONENT3);
代码示例来源:origin: itesla/ipst
/**
* Create a Dummy Bus (corresponding to a dangling line)
* @param writerMo
* @param modContext
* @param modelicaModelsList
* @param modelicaSim
* @throws IOException
*/
private void exportDanglingBuses(Writer writerMo, ModExportContext modContext, List<String> modelicaModelsList, SimulatorInst modelicaSim) throws IOException {
if ((dangLinesList.size() != 0) && (!dangLinesList.isEmpty())) {
for (DanglingLine dl : dangLinesList) {
Bus knownBus = dl.getTerminal().getBusBreakerView().getBus();
SV sv = new SV(0, 0, knownBus.getV(), knownBus.getAngle());
SV svDangling = sv.otherSide(dl);
double voltage = svDangling.getU() / knownBus.getVoltageLevel().getNominalV();
double angle = svDangling.getA();
String name = "ext_" + dl.getId();
BusRecord busRecord = ModelConverter.getModelicaRecord(name, voltage, angle, modContext, _ddbManager, modelicaSim);
this.danglingBuses.add(busRecord);
this.addRecord(busRecord, writerMo, modContext, _ddbManager, modelicaSim);
}
}
}
代码示例来源:origin: itesla/ipst
continue;
esgNetwork.addNode(createNode(b.getId(), b.getVoltageLevel(), b.getV(), b.getAngle(), sb == b));
代码示例来源:origin: itesla/ipst
/**
* Create a Dummy Load (corresponding to a dangling line)
* @param writerMo
* @param modContext
* @param modelicaModelsList
* @param modelicaSim
* @throws IOException
*/
private void exportDanglingLoads(Writer writerMo, ModExportContext modContext, List<String> modelicaModelsList, SimulatorInst modelicaSim) throws IOException {
if ((dangLinesList.size() != 0) && (!dangLinesList.isEmpty())) {
for (DanglingLine dl : dangLinesList) {
Bus knownBus = dl.getTerminal().getBusBreakerView().getBus();
SV sv = new SV(0, 0, knownBus.getV(), knownBus.getAngle());
SV svDangling = sv.otherSide(dl);
double busVoltage = svDangling.getU() / knownBus.getVoltageLevel().getNominalV();
double busAngle = svDangling.getA();
double p0 = dl.getP0();
double q0 = dl.getQ0();
String loadId = "ext_" + dl.getId();
LoadRecord loadRecord = ModelConverter.getModelicaRecord(loadId, p0, q0, busVoltage, busAngle, modContext, _ddbManager, modelicaSim, SNREF, this._sourceEngine);
this.danglingLoads.add(loadRecord);
this.addRecord(loadRecord, writerMo, modContext, _ddbManager, modelicaSim);
}
}
}
代码示例来源: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: itesla/ipst
} else {
Bus knownBus = dl.getTerminal().getBusBreakerView().getBus();
SV sv = new SV(0, 0, knownBus.getV(), knownBus.getAngle());
SV svDangling = sv.otherSide(dl);
代码示例来源:origin: com.powsybl/powsybl-iidm-api
u1 = bus1 != null ? bus1.getV() : Double.NaN;
u2 = bus2 != null ? bus2.getV() : Double.NaN;
theta1 = bus1 != null ? Math.toRadians(bus1.getAngle()) : Double.NaN;
theta2 = bus2 != null ? Math.toRadians(bus2.getAngle()) : Double.NaN;
alpha1 = 0f;
alpha2 = 0f;
代码示例来源:origin: com.powsybl/powsybl-iidm-api
u1 = bus1 != null ? bus1.getV() : Double.NaN;
u2 = bus2 != null ? bus2.getV() : Double.NaN;
theta1 = bus1 != null ? Math.toRadians(bus1.getAngle()) : Double.NaN;
theta2 = bus2 != null ? Math.toRadians(bus2.getAngle()) : Double.NaN;
alpha1 = twt.getPhaseTapChanger() != null ? Math.toRadians(twt.getPhaseTapChanger().getCurrentStep().getAlpha()) : 0f;
alpha2 = 0f;
代码示例来源:origin: itesla/ipst
busData.setNominalVoltage(bus.getVoltageLevel().getNominalV());
busData.setVoltage(bus.getV());
busData.setAngle(bus.getAngle());
busData.setMinVoltage(bus.getVoltageLevel().getLowVoltageLimit());
busData.setMaxVoltage(bus.getVoltageLevel().getHighVoltageLimit());
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeBuses(AmplExportContext context, TableFormatter formatter) throws IOException {
for (Bus b : AmplUtil.getBuses(network)) {
int ccNum = ConnectedComponents.getCcNum(b);
if (connectedComponentToExport(ccNum)) {
String id = b.getId();
VoltageLevel vl = b.getVoltageLevel();
context.busIdsToExport.add(id);
int num = mapper.getInt(AmplSubset.BUS, id);
int vlNum = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, vl.getId());
double nomV = vl.getNominalV();
double v = b.getV() / nomV;
double theta = Math.toRadians(b.getAngle());
formatter.writeCell(variantIndex)
.writeCell(num)
.writeCell(vlNum)
.writeCell(ccNum)
.writeCell(v)
.writeCell(theta)
.writeCell(b.getP())
.writeCell(b.getQ())
.writeCell(faultNum)
.writeCell(actionNum)
.writeCell(id);
addExtensions(num, b);
}
}
}
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeDanglingLineMiddleBuses(AmplExportContext context, TableFormatter formatter) throws IOException {
for (DanglingLine dl : network.getDanglingLines()) {
Terminal t = dl.getTerminal();
Bus b = AmplUtil.getBus(dl.getTerminal());
int middleCcNum = getDanglingLineMiddleBusComponentNum(context, dl);
if (connectedComponentToExport(middleCcNum)) {
String middleBusId = getDanglingLineMiddleBusId(dl);
String middleVlId = getDanglingLineMiddleVoltageLevelId(dl);
context.busIdsToExport.add(middleBusId);
int middleBusNum = mapper.getInt(AmplSubset.BUS, middleBusId);
int middleVlNum = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, middleVlId);
SV sv = new SV(t.getP(), t.getQ(), b != null ? b.getV() : Double.NaN, b != null ? b.getAngle() : Double.NaN).otherSide(dl);
double nomV = t.getVoltageLevel().getNominalV();
double v = sv.getU() / nomV;
double theta = Math.toRadians(sv.getA());
formatter.writeCell(variantIndex)
.writeCell(middleBusNum)
.writeCell(middleVlNum)
.writeCell(middleCcNum)
.writeCell(v)
.writeCell(theta)
.writeCell(0.0) // 0 MW injected at dangling line internal bus
.writeCell(0.0) // 0 MVar injected at dangling line internal bus
.writeCell(faultNum)
.writeCell(actionNum)
.writeCell(middleBusId);
}
}
}
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
double p1 = t.getP();
double q1 = t.getQ();
SV sv = new SV(p1, q1, bus1 != null ? bus1.getV() : Double.NaN, bus1 != null ? bus1.getAngle() : Double.NaN).otherSide(dl);
double p2 = sv.getP();
double q2 = sv.getQ();
代码示例来源:origin: com.powsybl/powsybl-cgmes-conversion
for (Bus b : n.getBusBreakerView().getBuses()) {
PropertyBag p = new PropertyBag(SV_VOLTAGE_PROPERTIES);
p.put("angle", fs(b.getAngle()));
p.put("v", fs(b.getV()));
p.put("TopologicalNode", topologicalNodeFromBusId(b.getId()));
内容来源于网络,如有侵权,请联系作者删除!