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

Ask Your Question
0

Read dynamic simulation result (time-series) in python

asked Feb 26 '18

Beck gravatar image

updated Feb 26 '18

Hi experts,

I'm new in dynamic analysis by using PSS/E through python. When i use Python command (dyntools.CHNF) to get the channel results after running dynamic simulation, commands are as following:

dyntools.CHNF('C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\AA.outx')

But i got following wrong messages, does anyone know how to solve these problem?. Thank you for any valuable information.

Traceback (most recent call last): File "\Mac\Home\Desktop\Dynamicsimulation.py", line 314, in <module> dyntools.CHNF('C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\AA.outx') File ".\dyntools.py", line 1023, in init File ".\dyntools.py", line 351, in _outextractdata File ".\dyntools.py", line 326, in outextractid File ".\comonpy.py", line 176, in byte2unicode File "C:\Python27\lib\encodings\utf8.py", line 16, in decode return codecs.utf8decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 2: invalid continuation byte

David

1 answer

Sort by » oldest newest most voted
0

answered Feb 27 '18

jconto gravatar image

There are two issues,

First, the 'encoding' issue:

Traceback (most recent call last): 
File "\Mac\Home\Desktop\Dynamicsimulation.py", line 314, 
in <module> dyntools.CHNF('C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\AA.outx') 
File ".\dyntools.py", line 1023, 
in init File ".\dyntools.py", line 351, 
in _outextractdata File ".\dyntools.py", line 326, 
in outextractid File ".\comonpy.py", line 176, 
in byte2unicode File "C:\Python27\lib\encodings\utf8.py", line 16, 
in decode return codecs.utf8decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 2: invalid continuation byte

It could be that your py code has an unrecognized character. Add as the first line in your code,something like:

# -*- coding: utf-8 -*-

There are different 'coding' options, check the net for others.

The second issue is the *.outx format of the simulation output file output, which is not compatible with the dyntools (at least in v.33). Check the post "PSS/e 34 dyntools module"

link

Comments

Hi jconto, Thank you for your reply. After your reminding, i use following code " help(dyntools) " and i found "chnfobj.get_data(1,'C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\AA.out')" command, but i got: Traceback (most recent call last): <.......> NameError: name 'chnfobj' is not define

Beck gravatar imageBeck (Feb 28 '18)

Review the dyntools_demo.py code in the 'EXAMPLE' folder and mimic the use of the dyntools functions. Also search for 'dyntools' in this forum.

jconto gravatar imagejconto (Mar 1 '18)

Hi jconto, I'm really new. Thank you for your valuable information. Hope i can finish my work as soon as possible.

Beck gravatar imageBeck (Mar 2 '18)

Other issue can be that you have non-ascii characters in your channel names and you're running one of the latest versions of PSSE. In that case you should contact their support for updated pythonfiles as at least 33.11 broke the support for them.

SqFKYo gravatar imageSqFKYo (Mar 2 '18)

Hi SqFKYo, Thank you for your valuable suggestions and that have provided me another way to check it. Unfortunately, I use the free download PSSE software from PTI website, i'm not sure they are willing provide me the update python files.

Beck gravatar imageBeck (Mar 10 '18)

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: Feb 26 '18

Seen: 1,069 times

Last updated: Feb 27 '18