First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
The following code run OK within PSSe v.33, update paths and var values for your run:
#import os
#import sys
#import pdb #<- what is this?
#PSSE_PATH = raw"""C:/Program Files/PTI/PSSE33/PSSBIN"""
#sys.path.append(PSSE_PATH)
#os.environ['PATH'] += PSSE_PATH + ';'
#sys.path.append(File_Path)
#os.environ['PATH'] += File_Path + ';'
#import psspy
#import pssarrays
#import redirect
#psspy.psseinit(10000)
#_i=psspy.getdefaultint()
#_f=psspy.getdefaultreal()
#_s=psspy.getdefaultchar()
#redirect.psse2py()
flatstart = 1
File_Path = "C:/Program Files/PTI/PSSE33/EXAMPLE"
workingfile = File_Path +'/'+"savnw.sav"
print workingfile
psspy.case(workingfile)
busnum = 153
Pload = 190 # from 10 to 100
Qload = 90 # from -40 to 60
psspy.load_chng_4(busnum,r"""1""",[_i,_i,_i,_i,_i,_i],[ Pload,_f,_f,_f,_f,_f])
psspy.load_chng_4(busnum,r"""1""",[_i,_i,_i,_i,_i,_i],[_f, Qload,_f,_f,_f,_f])
psspy.fnsl([1,0,0,1,1,flatstart,99,0])
#psspy.save(workingfile)
voltages = psspy.abusreal(sid=-1, string="PU")
buses = psspy.abusint(sid=-1, string="NUMBER")
print voltages
print buses