First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

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 Sep 14 '4

anonymous user

Anonymous

updated Sep 15 '4

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])

Comments

Where is the error meesage?

perolofl gravatar imageperolofl (Sep 14 '4)

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 (Sep 14 '4)

Check the error code from psspy.case.

perolofl gravatar imageperolofl (Sep 14 '4)

1 answer

Sort by » oldest newest most voted
0

answered Sep 15 '4

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
      ...
link

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 14 '4

Seen: 224 times

Last updated: Sep 15 '24