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()
Hi are you using PSSE 33? I haven't got that "report" function in PSSE 32. Anyway, try putting the report function _before_ the scmu functions. Does that work?
I'm still back on version 32.0.5, it's what the client uses, so it's what we use. Your suggestion has worked. Thank you for your help. Now I just need to dig around and learn about python arrays and for loops. Cheers.