First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Hi I am a beginner to use PSSE API. When I use psspy.case() to load a .sav case, python seems to restart/crash and the power flow result cannot show. I am attaching my code. Thank you in advance!
import sys, os
from contextlib import contextmanager
PSSBIN_PATH = r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN'
PSSPY_PATH = r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY34'
os.environ['PATH'] += ';' + PSSBIN_PATH
import psspy
psspy.throwPsseExceptions = True
import redirect
import dyntools
redirect.psse2py()
import numpy as np
#import win32com.client
psspy.psseinit()
psspy.case(r"C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\savnw.sav")
psspy.fnsl() # run power flow
Output:
SIEMENS POWER TECHNOLOGIES INTERNATIONAL
50 BUS POWER SYSTEM SIMULATOR--PSS(R)E-34.3.2
INITIATED ON WED, JUL 07 2021 11:31
PSS(R)E PROGRAM APPLICATION GUIDE EXAMPLE
BASE CASE INCLUDING SEQUENCE DATA
The Saved Case in file C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\savnw.sav was saved on WED, OCT 25 2017 11:50
The following option settings are changed to the settings contained in the Saved Case File:
** [OPF] APPLY FUEL COST OBJECTIVE option setting set to YES
** [OPF] APPLY ADJUSTABLE BRANCH REACTANCE OBJECTIVE option setting set to YES
** [OPF] CONSTRAIN INTERFACE FLOWS option setting set to YES
** [OPF] AUTOMATIC SCALING option setting set to YES
** [OPF] DUAL VARIABLE CONVERGENCE CRITERIA option setting set to YES
** [OPF] NUMBER OF BAD ITERATIONS WHEN MU>-2 option setting set to 10
** [OPF] NUMBER OF BAD ITERATIONS WHEN MU<=-2 option setting set to 20
** [OPF] PRODUCE AN OPF LOG FILE option setting set to YES
** [OPF] ADD SOLUTION DETAILS TO OPF LOG FILE option setting set to YES
=============================== RESTART: Shell ===============================