public SV otherSide(DanglingLine dl) { return otherSide(dl.getR(), dl.getX(), dl.getG(), dl.getB(), 1); }
public SV otherSide(TwoWindingsTransformer twt) { return otherSide(getR(twt), getX(twt), getG(twt), getB(twt), getRatio(twt)); }
public SV otherSide(Line l) { return otherSide(l.getR(), l.getX(), l.getG1() + l.getG2(), l.getB1() + l.getB2(), 1); }
public SV otherSideY1Y2(Line l) { return otherSide(l.getR(), l.getX(), l.getG1(), l.getB1(), l.getG2(), l.getB2(), 1); }
/** * 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); } } }
/** * 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); } } }
Bus knownBus = dl.getTerminal().getBusBreakerView().getBus(); SV sv = new SV(0, 0, knownBus.getV(), knownBus.getAngle()); SV svDangling = sv.otherSide(dl);
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); } } }
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();
SV svmodel = svboundary.otherSide(dl.getR(), dl.getX(), g, b, g, b, 1); dl.getTerminal().setP(svmodel.getP()); dl.getTerminal().setQ(svmodel.getQ());