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?

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])
anonymous user
asked 2024-09-14 03:45:01 -0500
jconto's avatar
2.9k
jconto
updated 2024-09-15 07:41:34 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Where is the error meesage?

perolofl's avatar perolofl (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's avatar team (2024-09-14 04:36:48 -0500) edit

Check the error code from psspy.case.

perolofl's avatar perolofl (2024-09-14 06:27:22 -0500) edit
add a comment see more comments

1 Answer

0

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
      ...
jconto's avatar
2.9k
jconto
answered 2024-09-15 08:10:04 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer