Ask Your Question
0

PSSE to Python and run from inside of the PSSE

asked 2022-09-20 18:00:02 -0500

sobhanB gravatar image

I am trying to run the psse with python. I am using psse35.3 and python 3.9. My problem is that I am able to run my python code from inside of the psse but when I want to run my model from python, I can not get any results!

I really appreciate it if anyone has some idea about that and shares it with me. Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2022-09-21 04:44:07 -0500

perolofl gravatar image

It is normally very easy to start PSSE-35 from python. It is no longer needed to add libraries to the system path. This will start the newest installation of PSSE-35:

import psse35
import psspy
psspy.psseinit()
edit flag offensive delete link more
1

answered 2022-09-20 20:50:58 -0500

Alex_barajas gravatar image

Hey! you'll need to import PSSe to a python script. I'll copy an example below. you'll need to update the paths with the location of your PSSe install on your machine.

import os,sys

# Path stuff
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSLIB")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE")
os.environ['PATH'] = (r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE;" + os.environ['PATH'])

import psse35
psse35.set_minor(3)

import psspy
psspy.psseinit(50)

case_file = '../input_files/case14.raw' # update this with a path to an example case
psspy.read(1, case_file)
psspy.fnsl()
edit flag offensive delete link more

Comments

Thank you so much. It works in my case.

sobhanB gravatar imagesobhanB ( 2022-09-21 12:23:29 -0500 )edit

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: 2022-09-20 18:00:02 -0500

Seen: 711 times

Last updated: Sep 21 '22