0

PSSE to Python and run from inside of the PSSE

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

sobhanB's avatar
1
sobhanB
asked 2022-09-20 18:00:02 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

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()
perolofl's avatar
3.8k
perolofl
answered 2022-09-21 04:44:07 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
1

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()
Alex_barajas's avatar
11
Alex_barajas
answered 2022-09-20 20:50:58 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you so much. It works in my case.

sobhanB's avatar sobhanB (2022-09-21 12:23:29 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer