Sunteți pe pagina 1din 3

SIEMENS

Power Transmission and Distribution

Power Technology

Issue 101

Exporting PSSE Results and Data to Excel Spreadsheets


Krishnat Patil
Staff Software Engineer
krishnat.patil@siemens.com

In PSSE version 31, ACCC, PV and QV analysis results can be exported to excel
spreadsheets using Excel Export GUI, shown in Figure 1. This GUI is launched from
PSSE menu Power Flow>Reports>Export to Excel or
Start>Program>PSSE31>PSSE Utilities>Export to Excel.

Figure 1 - Excel Export GUI


The GUI options as selected in Figure 1, exports ACCC contingency solution results to eight sheets of a
spreadsheet as illustrated in Figure 2.

Power Technology

February 2008

Figure 2 - ACCC Results


Additionally there are two new python modules PSSEXCEL and EXCELPY which provide convenient
python functions to export PSSE results and data to excel spreadsheets from python scripts.
PSSEXCEL module retrieves PSSE activity results using python module PSSARRAYS, and then
creates and populates excel spreadsheets with those results. For example, following command exports
ACCC results from savnw.acc file to pssexcel_accc_savnw.xls spreadsheet, as shown in Figure 2.
pssexcel.accc(' savnw.acc', ['s','e','b','i','v','l','g','p'],
xlsfile=' pssexcel_accc_savnw.xls')
EXCELPY is an auxiliary module that provides python functions to create, populate and format excel
spreadsheets with any data. For example, following python script retrieves bus numbers , name and base
voltage from PSSE case in memory and populates savnw_busdata.xls spreadsheet as shown in Figure
3.
import excelpy
ierr, busnum = psspy.abusint(-1,2,'NUMBER')
ierr, buskv = psspy.abusreal(-1,2,'BASE')
ierr, busnam = psspy.abuschar(-1,2,'NAME')
testwbook = excelpy.workbook('savnw_busdata.xls')
testwbook.show()
testwbook.set_cell((1,1),'SAVNW BUS
DATA',fontStyle='bold',fontName='arial',fontSize=14,fontColor='red')
testwbook.set_range(2,1,['Number','Name','Base kV'],fontStyle='bold',
fontName='courier',fontSize=12,fontColor='blue')
brow, rcln = testwbook.set_range(3,1,busnum[0],transpose=True)
rcln += 1
brow, rcln = testwbook.set_range(3,rcln,busnam[0],transpose=True)
rcln += 1
brow, rcln =
testwbook.set_range(3,rcln,buskv[0],transpose=True,numberFormat='0.0')
testwbook.save ('savnw_busdata.xls')

Page 2

Power Technology

February 2008

Figure 3 - Working Case Bus Data Exported to a Spreadsheet


Refer to help(pssexcel), help(excelpy), API manual and User manual for further details and list of
available functions from these modules.

Page 3

S-ar putea să vă placă și