Ask Your Question
0

PSSE to Python and run from inside of the PSSE

asked Sep 21 '2

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

2 answers

Sort by » oldest newest most voted
1

answered Sep 21 '2

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()
link
1

answered Sep 21 '2

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()
link

Comments

Thank you so much. It works in my case.

sobhanB gravatar imagesobhanB (Sep 21 '2)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Sep 21 '2

Seen: 765 times

Last updated: Sep 21 '22