com.powsybl.iidm.network.Bus.getVoltageLevel()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中com.powsybl.iidm.network.Bus.getVoltageLevel()方法的一些代码示例,展示了Bus.getVoltageLevel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bus.getVoltageLevel()方法的具体详情如下:
包路径:com.powsybl.iidm.network.Bus
类名称:Bus
方法名:getVoltageLevel

Bus.getVoltageLevel介绍

[英]Get the voltage level to which the bus belongs.
[中]获取总线所属的电压电平。

代码示例

代码示例来源:origin: itesla/ipst

private static void throwsUnexpectedTopology(Bus lvBus, String detailsMessage) {
  Objects.requireNonNull(lvBus);
  String errorMessage = "Unexpected stator substation topology in connected/connectable equipments for voltage level '" + lvBus.getVoltageLevel() + "', bus '" + lvBus + "' when removing existing step-up transformers (expected one TwoWindingTransformer, one or more Generators, zero or more Loads). " + detailsMessage;
  LOGGER.error(errorMessage);
  throw new RuntimeException(errorMessage);
}

代码示例来源:origin: com.powsybl/powsybl-ampl-converter

private Void readBus(String[] tokens) {
  int num = Integer.parseInt(tokens[1]);
  double v = readDouble(tokens[2]);
  double theta = readDouble(tokens[3]);
  String id = mapper.getId(AmplSubset.BUS, num);
  Bus bus = buses.get(id);
  if (bus != null) {
    bus.setV(v * bus.getVoltageLevel().getNominalV());
    bus.setAngle(Math.toDegrees(theta));
  } else {
    throw new AmplException("Invalid bus id '" + id + "'");
  }
  return null;
}

代码示例来源:origin: com.powsybl/powsybl-security-analysis-api

private static VoltageLevel getVoltageLevel(LimitViolation limitViolation, Network network) {
  Objects.requireNonNull(network);
  Objects.requireNonNull(limitViolation);
  Identifiable identifiable = network.getIdentifiable(limitViolation.getSubjectId());
  if (identifiable instanceof Branch) {
    Branch branch = (Branch) identifiable;
    return branch.getTerminal(limitViolation.getSide()).getVoltageLevel();
  } else if (identifiable instanceof Injection) {
    Injection injection = (Injection) identifiable;
    return injection.getTerminal().getVoltageLevel();
  } else if (identifiable instanceof VoltageLevel) {
    return (VoltageLevel) identifiable;
  } else if (identifiable instanceof Bus) {
    Bus bus = (Bus) identifiable;
    return bus.getVoltageLevel();
  } else {
    throw new AssertionError("Unexpected identifiable type: " + identifiable.getClass());
  }
}

代码示例来源:origin: com.powsybl/powsybl-security-analysis-api

@Override
public void checkVoltage(Bus bus, double value, Consumer<LimitViolation> consumer) {
  VoltageLevel vl = bus.getVoltageLevel();
  if (!Double.isNaN(vl.getLowVoltageLimit()) && value <= vl.getLowVoltageLimit()) {
    consumer.accept(new LimitViolation(vl.getId(), vl.getName(), LimitViolationType.LOW_VOLTAGE,
        vl.getLowVoltageLimit(), limitReduction, value));
  }
  if (!Double.isNaN(vl.getHighVoltageLimit()) && value >= vl.getHighVoltageLimit()) {
    consumer.accept(new LimitViolation(vl.getId(), vl.getName(), LimitViolationType.HIGH_VOLTAGE,
        vl.getHighVoltageLimit(), limitReduction, value));
  }
}

代码示例来源:origin: itesla/ipst

continue;
bus.setV(v * bus.getVoltageLevel().getNominalV());
bus.setAngle(voltage.adeg);
voltage.used = true;

代码示例来源:origin: itesla/ipst

bus.getVoltageLevel().getNominalV(),
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

Bus bus = this.genRecord.getGenerator().getTerminal().getBusBreakerView().getBus();
double busVoltage = bus.getV();
double v0 = busVoltage / bus.getVoltageLevel().getNominalV();
parameter = new IIDMParameter(PsseFixedData.V_0, v0);
this.iidmregParameters.add(parameter);

代码示例来源:origin: itesla/ipst

throw new RuntimeException("Slack bus not found");
LOGGER.debug("Slack bus: {} ({})", sb, sb.getVoltageLevel().getId());
for (Bus b : Identifiables.sort(EchUtil.getBuses(network, config))) {
    continue;
  esgNetwork.addNode(createNode(b.getId(), b.getVoltageLevel(), b.getV(), b.getAngle(), sb == b));

代码示例来源: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

busData.setBusIndex(busIndex);
busData.setBusType(MCSNetworkUtils.getBusType(bus));
busData.setNominalVoltage(bus.getVoltageLevel().getNominalV());
busData.setVoltage(bus.getV());
busData.setAngle(bus.getAngle());
busData.setMinVoltage(bus.getVoltageLevel().getLowVoltageLimit());
busData.setMaxVoltage(bus.getVoltageLevel().getHighVoltageLimit());
busData.setActivePower(bus.getP());
busData.setReactivePower(bus.getQ());

代码示例来源:origin: itesla/ipst

continue;
VoltageLevel vl = b.getVoltageLevel();
if (!Double.isNaN(vl.getLowVoltageLimit()) && !Double.isNaN(vl.getHighVoltageLimit())) {
  writer.write(dictionary.getEsgId(b.getId()));

代码示例来源: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

SV svDangling = sv.otherSide(dl);
double busVoltage = svDangling.getU() / knownBus.getVoltageLevel().getNominalV();
double busAngle = svDangling.getA();
String busName = "ext_" + dl.getId();

代码示例来源: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: itesla/ipst

double zBase = Math.pow(b.getVoltageLevel().getNominalV(), 2) / baseMVA;
double baseKV = b.getVoltageLevel().getNominalV();
String nameBus = b.getId();
int numberBus = idBusNumberMap.get(nameBus);
int loadFlowAreaNumber = defaultLoadFlowArea;
int typeBus = 0; // Default -> PQ bus
double minimumVoltage = b.getVoltageLevel().getLowVoltageLimit() / baseKV;
double maximumVoltage = b.getVoltageLevel().getHighVoltageLimit() / baseKV;
if (Double.isNaN(minimumVoltage)) {
  minimumVoltage = defaultMinimumVoltage;
  double zBase = Math.pow(dl.getTerminal().getBusView().getBus().getVoltageLevel().getNominalV(), 2) / baseMVA;
  double baseKV = dl.getTerminal().getBusView().getBus().getVoltageLevel().getNominalV();
  String nameBus = idDL + dl.getId();
  int numberBus = idBusNumberMap.get(nameBus);
  int loadFlowAreaNumber = defaultLoadFlowArea;
  int typeBus = 0; // Default -> PQ bus
  double minimumVoltage = dl.getTerminal().getBusView().getBus().getVoltageLevel().getLowVoltageLimit() / baseKV;
  double maximumVoltage = dl.getTerminal().getBusView().getBus().getVoltageLevel().getHighVoltageLimit() / baseKV;
  if (Double.isNaN(minimumVoltage)) {
    minimumVoltage = defaultMinimumVoltage;
  double ratingA = dl.getCurrentLimits().getPermanentLimit() * dl.getTerminal().getBusView().getBus().getVoltageLevel().getNominalV() / 1e3;
  double ratingB = ratingA;
  double ratingC = ratingA;
if (l.getTerminal1().getBusView().getBus() != null &&
    l.getTerminal2().getBusView().getBus() != null) {
  double zBase = Math.pow(l.getTerminal1().getBusView().getBus().getVoltageLevel().getNominalV(), 2) / baseMVA;

代码示例来源:origin: itesla/ipst

double mvm = connectedBus.getV() / connectedBus.getVoltageLevel().getNominalV(); // Initial AC modulated voltage magnitude [p.u.]
double mva = connectedBus.getAngle(); // Initial AC modulated voltage angle [deg]
double pva = connectedBus.getV(); // AC voltage setpoint [kV]. Only if AC control mode is 'V'

代码示例来源:origin: com.powsybl/powsybl-iidm-test

.add();
((Bus) network.getIdentifiable("NHV1")).setV(380).getVoltageLevel().setLowVoltageLimit(400).setHighVoltageLimit(500);
((Bus) network.getIdentifiable("NHV2")).setV(380).getVoltageLevel().setLowVoltageLimit(300).setHighVoltageLimit(500);

相关文章