Ask Your Question
0

psspy.case casues python to crash/restart

asked 2021-07-07 11:07:16 -0500

TH_TAMU gravatar image

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 ===============================
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2021-07-08 13:46:42 -0500

jconto gravatar image

updated 2021-07-08 13:48:21 -0500

dyntools cannot run from the GUI. If you need 'dyntools', take a look at the code 'dyntoolsdemo.py' located at the 'example' folder of your PSSe installation. To test it, double click on the "PSSE 3X Command Prompt" link on your desktop (created during PSSe installation) to open a CMD prompt window (a.k.a. DOS window) at the 'example' folder and run dyntoolsdemo.py by entering the following command:

with full python path for python 2.7 with psse v33:

c:\..>c:\python27\python dyntools_demo.py

or with full python path for python 3.7 with psse v34:

c:\..>c:\python37\python dyntools_demo.py

for psse v35, load the python code in idle (64 bit) and run it by pressing 'F5'

edit flag offensive delete link more
0

answered 2021-07-08 07:53:15 -0500

satyan gravatar image

updated 2021-07-08 07:53:56 -0500

looks like you havent imported psse34

import psse34
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2021-07-07 11:07:16 -0500

Seen: 65 times

Last updated: Jul 08