Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Perform scmu sing en masse with output

I am trying to perform a simple 3 phase fault on multiple busses without having to copy the results out of the reports, so I'm learning python. My problem is that it will produce a nice empty text file. The report in PSSE is all results, but the text file is useless. I know the 2 in "[2,0]" towards the end is for appending, which is what I would prefer, but just a bunch of files would do. My instinct is that there is an issue with PSSE more than the python script, but as I'm new, I want to check. Any and all help much appreciated. My code below:

import os,sys

PSSE_LOCATION = r"C:\Program Files (x86)\PTI\PSSE32\PSSBIN"
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] +';' + PSSE_LOCATION

import psspy

CASE = r"C:\Users\user\Desktop\PSSE\Model.sav"

_i=psspy.getdefaultint()
_f=psspy.getdefaultreal()
_s=psspy.getdefaultchar()

if __name__ == '__main__':
    psspy.psseinit(2000)
    psspy.case(CASE)
    psspy.scmu(1,[_i,_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f],_s)
    psspy.scmu(2,[7,100,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f],"")
    psspy.scmu(3,[_i,_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f],_s)
    #psspy.report_output(2,'C:\Users\user\Desktop\PSSE\Fault_Output\Bus_100.txt',[2,0])
    psspy.report(2,'C:\Users\user\Desktop\PSSE\Fault_Output\Bus_100.txt',[2,0])
    psspy.close_report()