Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The sensitivity_flows report is automatically output if the run is free of error.

The code below can be run within the PSSe GUI or in a CMD window (DOS window). In the working folder a SAV case and its corresponding DFAX file must exist. The 'labels' var uses names defined in the subsystem file used to create the dfax file. Tested wih PSSe v35.6 + python 3.9

psseversion = 35     #default
try:
    psspy
except:
    exec('import psse%s'%psseversion)
    import psspy
    psspy.psseinit(15000)
#_________________________________________________________
savmem,snpmem = psspy.sfiles()
if not savmem:
   print('loading case')
   psspy.case(r"""savnw.sav""")
#_________________________________________________________
# vars for sensitivity_flows function
flwopt      = [0,0]
options     = [0,1,0,0,0,0,0,0,0]
values      = [0.0,0.03]
labels      = ['CENTRAL','','CENTRAL']
dfxfile     = 'savnw.dfx'
print('\nsensitivity_flows') 
ierr = psspy.sensitivity_flows(flwopt,options,values,labels,dfxfile)   
print(ierr,'= error code')

The sensitivity_flows report is automatically output if the run is free of error.

The code below can be run within the PSSe GUI or in a CMD window (DOS window). In the working folder a SAV case and its corresponding DFAX file must exist. The 'labels' var uses names defined in the subsystem file used to create the dfax file. Added explicitly the path to psspy. Tested wih PSSe v35.6 + python 3.9

import os, sys
psspypath = r'C:\Program Files\PTI\PSSE35\35.6\PSSPY39'
sys.path.append(psspypath)

psseversion = 35     #default
 try:
    psspy
except:
    exec('import psse%s'%psseversion)
    import psspy
    psspy.psseinit(15000)
#_________________________________________________________
savmem,snpmem = psspy.sfiles()
if not savmem:
   print('loading case')
   psspy.case(r"""savnw.sav""")
#_________________________________________________________
# vars for sensitivity_flows function
flwopt      = [0,0]
options     = [0,1,0,0,0,0,0,0,0]
values      = [0.0,0.03]
labels      = ['CENTRAL','','CENTRAL']
dfxfile     = 'savnw.dfx'
print('\nsensitivity_flows') 
ierr = psspy.sensitivity_flows(flwopt,options,values,labels,dfxfile)   
print(ierr,'= error code')