Ask Your Question
0

Read dynamic simulation result (time-series) in python

asked 2018-02-26 15:53:47 -0500

Beck gravatar image

updated 2018-02-26 17:00:53 -0500

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-02-27 08:52:06 -0500

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"

edit flag offensive delete link more

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 ( 2018-02-28 10:48:51 -0500 )edit

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 ( 2018-03-01 17:15:55 -0500 )edit

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 ( 2018-03-01 20:31:43 -0500 )edit

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 ( 2018-03-02 00:50:31 -0500 )edit

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 ( 2018-03-10 11:56:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Stats

Asked: 2018-02-26 15:53:47 -0500

Seen: 997 times

Last updated: Feb 27 '18