Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This will do what you're looking for. Refer to chapter 8 Subsystem Data Retrieval, specifically the bit on Branch Flow data, for more info. Keep in mind the "-1" subsystem is the entire case.

ierr, loss = psspy.aflowreal(-1, 2, 1, 1, 'PLOSS')
ierr, toBus = psspy.aflowint(-1, 2, 1, 1, 'TONUMBER')
ierr, fromBus = psspy.aflowint(-1, 2, 1, 1, 'FROMNUMBER')
ierr, brnID = psspy.aflowchar(-1, 2, 1, 1, 'ID')

csv = 'ToBus, FromBus, ID, PLOSS\n'
for fields in zip(toBus[0], fromBus[0], brnID[0],loss[0]):
    fields = [str(a) for a in fields]
    csv += ','.join(fields) + '\n'
print csv

This will do what you're looking for. Refer to chapter 8 Subsystem Data Retrieval, specifically the bit on Branch Flow data, for more info. Keep in mind the "-1" subsystem is the entire case.

ierr, loss = psspy.aflowreal(-1, 2, 1, 1, 'PLOSS')
ierr, toBus = psspy.aflowint(-1, 2, 1, 1, 'TONUMBER')
ierr, fromBus = psspy.aflowint(-1, 2, 1, 1, 'FROMNUMBER')
ierr, brnID = psspy.aflowchar(-1, 2, 1, 1, 'ID')

csv = 'ToBus, FromBus, ID, PLOSS\n'
for fields in zip(toBus[0], fromBus[0], brnID[0],loss[0]):
    fields = [str(a) for a in fields]
    csv += ','.join(fields) ','.join(map(str,fields)) + '\n'
print csv

This will do what you're looking for. Refer to chapter 8 Subsystem Data Retrieval, specifically the bit on Branch Flow data, for more info. Keep in mind the "-1" subsystem is the entire case.

ierr, loss = psspy.aflowreal(-1, 2, 1, 1, 'PLOSS')
ierr, toBus = psspy.aflowint(-1, 2, 1, 1, 'TONUMBER')
ierr, fromBus = psspy.aflowint(-1, 2, 1, 1, 'FROMNUMBER')
ierr, brnID = psspy.aflowchar(-1, 2, 1, 1, 'ID')

csv = 'ToBus, FromBus, ID, PLOSS\n'
for fields in zip(toBus[0], fromBus[0], brnID[0],loss[0]):
    csv += ','.join(map(str,fields)) + '\n'
print csv
with f as open('output.csv'):
     f.write(csv)

This will do what you're looking for. Refer to chapter 8 Subsystem Data Retrieval, specifically the bit on Branch Flow data, for more info. Keep in mind the "-1" subsystem is the entire case.

ierr, loss = psspy.aflowreal(-1, 2, 1, 1, 'PLOSS')
ierr, toBus = psspy.aflowint(-1, 2, 1, 1, 'TONUMBER')
ierr, fromBus = psspy.aflowint(-1, 2, 1, 1, 'FROMNUMBER')
ierr, brnID = psspy.aflowchar(-1, 2, 1, 1, 'ID')

csv = 'ToBus, FromBus, ID, PLOSS\n'
for fields in zip(toBus[0], fromBus[0], brnID[0],loss[0]):
    csv += ','.join(map(str,fields)) + '\n'
print csv
with f open('output.csv') as open('output.csv'):
f:
     f.write(csv)

This will do what you're looking for. Refer to chapter 8 Subsystem Data Retrieval, specifically the bit on Branch Flow data, for more info. Keep in mind the "-1" subsystem is the entire case.

ierr, loss = psspy.aflowreal(-1, 2, 1, 1, 'PLOSS')
ierr, toBus = psspy.aflowint(-1, 2, 1, 1, 'TONUMBER')
ierr, fromBus = psspy.aflowint(-1, 2, 1, 1, 'FROMNUMBER')
ierr, brnID = psspy.aflowchar(-1, 2, 1, 1, 'ID')

csv = 'ToBus, FromBus, ID, PLOSS\n'
for fields in zip(toBus[0], fromBus[0], brnID[0],loss[0]):
    csv += ','.join(map(str,fields)) + '\n'
print csv
with open('output.csv') as f:
     f.write(csv)

This will do what you're looking for. Refer to chapter 8 Subsystem Data Retrieval, specifically the bit on Branch Flow data, for more info. Keep in mind the "-1" subsystem is the entire case.

ierr, loss = psspy.aflowreal(-1, 2, 1, 1, 'PLOSS')
ierr, toBus = psspy.aflowint(-1, 2, 1, 1, 'TONUMBER')
ierr, fromBus = psspy.aflowint(-1, 2, 1, 1, 'FROMNUMBER')
ierr, brnID = psspy.aflowchar(-1, 2, 1, 1, 'ID')

csv = 'ToBus, FromBus, ID, PLOSS\n'
for fields in zip(toBus[0], fromBus[0], brnID[0],loss[0]):
    csv += ','.join(map(str,fields)) + '\n'
print csv
with open('output.csv') open('output.csv','w') as f:
    f.write(csv)