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

Ask Your Question
0

exporting dynamic simulation results to excel using python

asked Nov 18 '13

PieterJ gravatar image

Hello all!

Does anybody know how to export the contents of the CHANNELs after a dynamic simulation to excel, using python commands?

thanks; and best regards!

Pieter

2 answers

Sort by » oldest newest most voted
1

answered Nov 18 '13

yfwing gravatar image

You can try use 'dyntools' module. the function CHNF will read the dynamic simulation result files. then you can use 'xlsout' function to export to excel.

import os import sys sys.path.append('C:/Program Files (x86)/PTI/PSSEUniversity33/pssbin') sys.path.append('C:/Program Files (x86)/PTI/PSSEUniversity33/psslib')

import dyntools

achnf = dyntools.CHNF(outfile1); achnf.xlsout(self, channels='', show=True, xlsfile='', outfile='', sheet='', overwritesheet=True);

link

Comments

Hey,my bro.I want to know the dyntools in detail.I have PSSE V34.But I do not find dyntools.I find dyntools_demos.Are dyntools and dyntools_demo the same files?And dyntools_demo in PSSE V34 do not have attribute 'CHNF'.What should I do?

David gravatar imageDavid (Jul 13 '1)
0

answered Nov 19 '13

PieterJ gravatar image

Thank you sir! It worked great! Dyntools is indeed the way to export channel data. For xlsout, pywin32 module must be installed. This didn't work for me, but i found another command to export the channel data to a txt file: chnfobj.txtout(channels=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22], txtfile='outfile.txt')

link

Comments

@PieterJ Use the function CHNF to output channel into excel and txt, but how do we know the channels =[1,2,3,4,5....] represent which channel. In other words, channel 1 represents what? Thanks!

Bob gravatar imageBob (Nov 20 '13)

In my case, i first did a dynamic simulation (before exporting the channel data to txt file), and before starting the dyn simulation, assigned the generator speed deviations, SPEED, to chans 1 till 22. I had 22 generators. Chan 1 corresponded to SPEED of generator 1013, chan 2 to gen 2035 annd so on

PieterJ gravatar imagePieterJ (Nov 20 '13)

You can refer to the PDF file named API.This file you can find it in DOCS folder.

David gravatar imageDavid (Jul 13 '1)

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: Nov 18 '13

Seen: 3,118 times

Last updated: Nov 19 '13