Professional Documents
Culture Documents
Copia
Copia
def getKey(custom):
return custom.loc_name
Alpha = 10
Beta = 1
factible = True
Lines=app.GetCalcRelevantObjects('*.ElmLne')
PerdidasP = 0
PerdidasQ = 0
PerdidasP+=float(PP)
PerdidasQ+=float(PQ)
if line.GetAttribute('c:loading')>90:
factible = False
buses = app.GetCalcRelevantObjects('N*.ElmTerm')
DistanciaVoltaje = 0
if bus_v>1.05 or bus_v<0.95:
factible = False
Script=app.GetCurrentScript()
Contents=Script.GetContents()
Cubic1=Contents[0]
Cubic1=Contents[1]
bus.AddCopy(Cubic1)
bus.AddCopy(Cubic2)
app.PrintPlain("Perdidas P: "+str(PerdidasP))
app.PrintPlain("Perdidas Q: "+str(PerdidasQ))
app.PrintPlain("Distancia a voltaje ideal: "+str(DistanciaVoltaje))
if not factible:
app.PrintPlain("NO factible")
Script=app.GetCurrentScript()
Contents=Script.GetContents()
Cubic=Contents[0]
#buses[10].AddCopy(Cubic)
cap = app.GetCalcRelevantObjects('*.ElmShnt')
conectar = buses[10].GetContents('Cubicle*')[0][0]
cap[0].bus1 = conectar