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

Ask Your Question
0

Dynamic Simulation data as variable in Python

asked Apr 8 '16

hj gravatar image

Hello.

I want to use PSS/e dynamic simulation result as variables in Python. I can store the dynamic sim. result in .out file but I don't know how to use the result in Python directly.

Please let me know how to do.

1 answer

Sort by » oldest newest most voted
0

answered Oct 6 '16

perolofl gravatar image

Use module dyntools to get the channel values from a .out file.

import dyntools

outfile = 'TripGen102.out'
chnfobj = dyntools.CHNF('TripGen102.out')
sh_ttl, ch_id, ch_data = chnfobj.get_data()

# extract list with time
t = ch_data.get('time')  

# extract list with values for channel ch
v = ch_data.get(ch)

chid is a dictionary with channel id's and chdata is a dictionary with time and all channel values

link

Comments

Hi. I am able to extract the time using this code but I don't quite understand how to extract a specific channel. is ch the name of a specific channel in ch_id? please bear with me...i am new to python. So I tried this but it didnt work: print ch_id #to know the channel ids v=ch_id.get('chan id')

Karma1 gravatar imageKarma1 (Jan 17 '17)

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

Stats

Asked: Apr 8 '16

Seen: 47,025 times

Last updated: Oct 06 '16