Beispiel #1
0
    L1cktID = line1[2].strip("'").strip()


    # Line 2 params
    line2 = line2Elements.split(',')
    L2Bus1 = int(line2[0].strip())
    L2Bus2 = int(line2[1].strip())
    L2cktID = line2[2].strip("'").strip()

    #  # get the raw file name, to be used for getting the corresponding names of the sav and snp files
    # if RawFileIndicator == '100':
    #     rawFileName = 'savnw_conp'
    # else:
    #     rawFileName = 'savnw_conp{}'.format(RawFileIndicator)       

    rawFileName = refRaw.replace('.raw','')

    savFile = rawFileName + '.sav'
    snpFile = rawFileName + '.snp'


    print('Event: {}'.format(event))
    # get the nominal voltages as well as the fault impedance in ohms
    FaultBusNomVolt = float(BusDataDict[str(FaultBus)].NominalVolt)
    Zbase = FaultBusNomVolt**2/Sbase  # float since Sbase is a float
    Rohm = FaultRpu*Zbase # fault impedance in ohms 
             
    # run simulation till just before the fault
    output = StringIO.StringIO()
    with silence(output):
        # load the sav and snp file
Beispiel #2
0
# script to simulate various kinds of scenarios in PSSE and plot them
import sys, os
from getBusDataFn import getBusData

psse_log = 'log.log'
# add psspy to the system path
sys.path.append(r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN")
os.environ['PATH'] = (r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN;" +
                      os.environ['PATH'])

# save the .sav and .snp file
from N_2Inputs import raw as rawFile, dyrFile
#rawFile = 'pf_ornl0823.raw'
#dyrFile = 'pf_ornl_all.dyr'
rawFileName = rawFile.replace('.raw', '')

# Local imports
import redirect
import psspy
import dyntools

##### Get everything set up on the PSSE side
redirect.psse2py()

psspy.psseinit(buses=80000)
_i = psspy.getdefaultint()
_f = psspy.getdefaultreal()
_s = psspy.getdefaultchar()

# Redirect any psse outputs to psse_log
psspy.report_output(2, psse_log, [0, 0])