Ask Your Question
0

I want to apply PSS/E 33 version of Python code to PSS/E 35 version, but I get an error. How do I fix the code?

asked 2024-09-14 03:45:01 -0500

anonymous user

Anonymous

updated 2024-09-15 07:41:34 -0500

jconto gravatar image
path=r'C:\Users\Smartgrid\Desktop\ESP\2_Aggregate_Model\B02_1_Active_Power_Control' 
psspy.case(path+'\B02_CASE01_P100_QZ000_SCR20_XR20.sav') 
psspy.fdns([0,0,0,1,0,0,99,0]) 
psspy.fdns([0,0,0,1,0,0,99,0]) 
psspy.cong(0)                                      
psspy.conl(0,1,1,[0,0],[ 100.0,0.0,0.0, 100.0])
psspy.conl(0,1,2,[0,0],[ 100.0,0.0,0.0, 100.0])
psspy.conl(0,1,3,[0,0],[ 100.0,0.0,0.0, 100.0])
psspy.ordr(0)  
psspy.fact()
psspy.tysl(0)
psspy.dyre_new([1,1,1,1],path+'\Sinan_Haesong_WP_Aggregated_B02_1.dyr',"","","")
psspy.dynamics_solution_param_2(realar3=0.001)  
psspy.strt_2([0,0],path+'\99_Result.out')
psspy.lines_per_page_one_device(1,60)
psspy.progress_output(2,path+'\99_Result.txt',[0,0])
edit retag flag offensive close merge delete

Comments

Where is the error meesage?

perolofl gravatar imageperolofl ( 2024-09-14 04:30:43 -0500 )edit

Messages for api STRT_2 No network data in memory (005354) I get the following error. I think it's because the code is different from version 33 and version 35 of Python code.

team gravatar imageteam ( 2024-09-14 04:36:48 -0500 )edit

Check the error code from psspy.case.

perolofl gravatar imageperolofl ( 2024-09-14 06:27:22 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2024-09-15 08:10:04 -0500

jconto gravatar image

The code works fine (I use the savnw files) in v.35 with python 3.9, v.34 with python v.3.9.

Almost every psspy function can return an error code as explained in the API manual, like:

ier = psspy.case(...)

where ier = 0 means "No error". Did the "case" function return 0 (suggested check by @perolofl)?

A programming trick to stop the run at a point when an error occurs: put all python code of interest within a single for loop, and exit the loop when and error occurs:

for k in range(1):
    ier = psspy.case(path+'\B02_CASE01_P100_QZ000_SCR20_XR20.sav') 
    if ier: break
    ier = psspy.fdns([0,0,0,1,0,0,99,0])
    if ier: break
      ...
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: 2024-09-14 03:45:01 -0500

Seen: 132 times

Last updated: Sep 15