Creating a Case in PSSE

3.3k views Asked by At

I have data in an excel file that I would like to use to create a case in PSSE. The data is organized as it would appear in a case in PSSE (ie. for bus Bus number, name, base kV, and so on. Of course the data can be entered manually but I'm working with over 500 buses. I have tried copied and pasting, but that seems to works only sometimes. For machine data, it barely works.

Is there a way to import this data to PSSE from an excel file? I have recently started running PSSE with Python, and maybe there is a way to do this?

-- MK.

2

There are 2 answers

0
bud On

Yes. You can import data from an excel file into PSSE using the python package xlrt, however, I would reccomend instead converting your excel file to csv before you import and use csv as it is much easier. Importing data using the API is not just a copy and paste job, into the nicely tabulated spreadsheet that PSSE has in its case data.

Refer to the API documentation for PSSE, chapter II. Search this function, BUS_DATA_2. You will see that you can create buses with this function.

So your job should be three fold.

  1. Import the csv file data with each line being a list of each data parameter for your bus. Like voltage, name, baseKV, PU etc. Store it to another list.

  2. Iterate through the new list you just created and call:

    ierr = bus_data_2(i, intgar, realar, name)
    

and pass in your data from the csv file. (see PSSE API documentation on how to do this) This will effectively load data from the csv file to your case ( in the form of nodes or buses).

  1. After you are finished, you will need to call a function called psspy.save("Casename.sav") to save your work in a new PSSE case.

Note: there are functions to load in line data, fix shunt data, generator data etc.

Your other option is to call up the PTI folks as they can give you training.

Good luck

0
Deanna1125 On

If you have an Excel data file with exactly the same "format" and same "info" as the regular case file (.sav), try this:

  1. Open any small example .sav file from the example sub-folder PSSE's installation folder

  2. Copy the corresponding spreadsheet to the working case (shown in spreadsheet view) with the same "info" (say, bus, branch,etc.) in PSSE GUI

  3. After finishing copying everything, then save the edited working case in GUI as a new working case.

If this doesn't work, I suggest you to ask this question on forum of "Python for Power Systems": https://psspy.org/psse-help-forum/questions/