Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is a script to make calculation for a previously selected subsystem and export peak current with method B (ipb) to excel.

import excelpy
import pssarrays
sid = 0
all = 0
cur = 'ipb'
psspy.short_circuit_coordinates(0)
robj = pssarrays.iecs_currents(sid=sid, all=all, flt3ph=1)
res1 = []
for i,ibus in enumerate(robj['fltbus']):
    res1.append(abs(robj['flt3ph'][i][cur]))

testxls = excelpy.workbook("test1.xls")
testxls.set_cell((1,'a'),'IBUS')
testxls.set_cell((1,'b'),cur)
testxls.set_range(2, 'a', zip(robj['fltbus']))
testxls.set_range(2, 'b', zip(res1))
testxls.save()
testxls.close()

Set all = 1 to calculate for all buses in system.