PSSE - Getting started

So you want to run PSSE through python? Here is a simple way to begin with. Let's use the following example file in the PSSE example directory - savnw.sav.

Connect the PSSE engine like so:

import os, sys
PSSE_LOCATION = r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION
import psspy
import redirect
redirect.psse2py()

Feed in the case file. Note the location of the file.

import psspy, redirect
SAVFILE_LOCATION = r"C:\Program Files (x86)\PTI\PSSE33\EXAMPLE\\"
CASE = r"savnw.sav"
psspy.case(SAVFILE_LOCATION + CASE)

Run the Full Newton Raphson solution. You should get the full powerflow output in your program console.

psspy.fnsl((1,0,1,0,0,0,99,1))
psspy.inibus(0)
psspy.pout()

The easiest way to run the above code would be to fire up idle (python GUI), which is available from your Windows startup menu in the Python 2.7 folder. Click New Window in the file menu of your idle (python GUI) editor, copy paste the above code in this new window, save it with an appropriate name say - test.py. Run the code by clicking Run Module from the Run menu. If all goes exactly as described, a powerflow output in 132 columns format will be displayed in the idle console.