0

Close PSS/E after finishing dynamic simulation

I attempt to run the dynamic simulation cyclically, which tripping the online generators one by one, and convert the result values of output file to csv files. Then, the aim is to find the frequency nadir in each simulation case, so I would read the csv files and record the nadir value. In the testing system file, there are only 10 generators in the system. However, in the formal case, the study power grid contains hundreds of generators.

In order not to let a large number of files occupy the disk space, I would like to remove the output files and csv files after recording the nadir values. But the code I finish programming current could only remove the csv files, the output files are still in the folder. I would like to ask that do anyone have any suggestion to deal with this problem "Removing the output files"?

I use python 2.7 and PSS/E v34.4.0, and implement the code in VSCode. Also since I could not paste the entire code on the forum, if anyone want to take a look, please feel free to contact me.

YKC Email: ken890309@gmail.com / yukaichung@itri.org.tw

YKC's avatar
50
YKC
asked 2024-04-29 20:10:49 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

3 Answers

0

I was expecting psspy.pssehalt2() to work. However, you can also try psspy.stop2().

WN's avatar
21
WN
answered 2024-05-08 21:04:37 -0500, updated 2024-05-08 21:12:40 -0500
edit flag offensive 0 remove flag delete link

Comments

psspy.stop_2() not psspy.stop().

WN's avatar WN (2024-05-08 21:13:51 -0500) edit
add a comment see more comments
0

You can use os.remove(filepath) where filepath is the path of the output file you wish to remove.

sgmiller's avatar
1
sgmiller
answered 2024-04-30 19:31:26 -0500
edit flag offensive 0 remove flag delete link

Comments

Well, I did try it, but the warning popped up and told me that I still used PSS/E so "os.remove..." could not be used. Thus, I would like to ask to close PSS/E first, and I could use "os.remove..." to remove the output files.

YKC's avatar YKC (2024-05-06 03:05:24 -0500) edit
add a comment see more comments
0

Have you tried psspy.pssehalt_2()? The documentation says : "Use this API to end the operation of PSSE, closes all associated files"
Do that in your python loop after making your output file.
Here is some pseudocode:

loop:
psspy.init()
do stuff
make csv files
psspy.halt
os.remove(csv files)
Tassie Dave's avatar
111
Tassie Dave
answered 2024-05-08 19:50:50 -0500, updated 2024-05-08 19:57:30 -0500
edit flag offensive 0 remove flag delete link

Comments

Yes, I do try that, and actually I think that function is what I need. However, after I added this API in my code, it always popped up warning "the files are still be used by other program", so I think the reason is that PSS/E does not close correctly.

YKC's avatar YKC (2024-05-08 20:22:57 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer