# 3 April 2010 # h.pota@adfa.edu.au - Himanshu Pota # Run solution1.py first # psse32 -pyfile solution1.py # then run this run.py # to plot run plot.py # ============================================================================================= psspy.psseinit(0) #initialise PSSE with default bus size basedir = r"""C:\wattle\power\PSSE\Test\\""" #two slashes to quote the second slash #the following two files are created by running solution1.py savfile = basedir + r"""SMIBconv.sav""" snpfile = basedir + r"""SMIB.snp""" psspy.case(savfile) psspy.rstr(snpfile) ts =[2,5,10] #switching times ctr = 0 pssplot.newplotbook() tswitch = ts[0] #for tswitch in ts: ctr=ctr+1 outfile = basedir + r"""GOP""" + str(ctr) + r""".out""" outhandle = r"""GOP""" + str(ctr) psspy.strt(0,outfile) #initialise the simulation with output file outfile defined above psspy.run(0,0.0,15,15,15) #run simulation to zero second psspy.run(0,1.0,15,15,15) #run simulation to one second psspy.dist_branch_trip(1,2,r"""2""") #trip one of the two lines psspy.run(0,tswitch,15,15,15) #run simulation upto tswitch seconds psspy.dist_branch_close(1,2,r"""2""") #close that line again psspy.run(0,20.0,15,15,15) #run simulation till 20 seconds # plot commands pssplot.setselectedpage(0) pssplot.insertplot() #speed plots pssplot.openchandatafile(outfile) pssplot.dragdropplotdata(outhandle,r"""2 - GEN1SPEED""") pssplot.dragdropplotdata(outhandle,r"""4 - GEN2SPEED""") pdf1 = basedir + r"""speed""" + str(tswitch) + r""".pdf""" pssplot.exportplot(pdf1,4) pssplot.insertplot() #angle plots pssplot.dragdropplotdata(outhandle,r"""1 - GEN1DELTA""") pssplot.dragdropplotdata(outhandle,r"""3 - GEN2DELTA""") pdf2 = basedir + r"""angle""" + str(tswitch) + r""".pdf""" pssplot.exportplot(pdf2,4)