Ask Your Question
1

Channels - tool to process outs files

asked 2017-06-10 10:12:42 -0500

jconto gravatar image

updated 2024-03-15 22:03:41 -0500

Channels is a python code that uses dyntools to process out files from a PSSe dynamic simulation. It runs in PSSe v33, v34 & v35. The tool allows to export any type of channels the user select to an excel file; request information about channels names & numbers; plot selected channels, plotting same channels from multiple outs files (=compare channels performance); and rank channel performance based on user criteria with option to plot (which voltage channels goes below a certain threshold...).

You can download the channels tool with a demo set from [copy the link into your browser if it does not connect when clicking on it]:JConto_google drive

Once you select “channelsxxxxx.zip”, an icon on the top-center screen will perform the download.

Once downloaded & unzipped, rename *.tab to *.bat, open a DOS window on the channels' folder and run the following [it will export volt channels to a excel file]: c:..>channels chan_V_exp

Follow the instruction in the read.me file to run the other demos included.

edit retag flag offensive close merge delete

Comments

Jconto, excellent example and effort! Thanks. I have also done some data mining using the channels out module.

SC gravatar imageSC ( 2017-07-27 13:52:26 -0500 )edit

jconto. Excellent utility! Where can I find the PDF file you refer to "CHANNELS_tool_PSEE_UGM_2017_v2.pdf"? Thank you. Matt

MattGood gravatar imageMattGood ( 2017-08-18 16:28:37 -0500 )edit

I added to the channels's zip file, and I did re-posted it. Also I put a copy on the folder "Papers & Presentations" within my google_drive folder.

jconto gravatar imagejconto ( 2017-08-18 17:45:31 -0500 )edit

Thanks so much.

MattGood gravatar imageMattGood ( 2017-08-18 23:54:59 -0500 )edit

Are numpy and matplotlib a requirement for Channels to work?

Type1_bus gravatar imageType1_bus ( 2020-09-17 23:21:35 -0500 )edit

Yeah, both numpy and matplotlib are required. Use pip to install them: In a CMD windows type:pip install numpy.

jconto gravatar imagejconto ( 2020-09-18 07:41:27 -0500 )edit

Thanks jconto!

Type1_bus gravatar imageType1_bus ( 2020-09-22 00:17:13 -0500 )edit

Hi jconto, this is a very minor thing, but I can't seem to get dashed/dotted lines in the plot activity (changed text in .ini). Is there any way to fix this?

Type1_bus gravatar imageType1_bus ( 2020-10-21 10:36:33 -0500 )edit

Thanks for using Channels. I would consider the line style as a user option (INI input) on the next release. But then, all curves would be of the same line style! Channels purpose is to plot 'large' amount of plots with same settings, so it cannot have customization per plot.

jconto gravatar imagejconto ( 2020-10-22 09:30:49 -0500 )edit

Thanks jconto! There's an option for linestyle in the .INI. Is that for the flatline or xy profile lines? I was hoping to only make the flatline or xy profile line dashed

Type1_bus gravatar imageType1_bus ( 2020-10-22 09:47:37 -0500 )edit

Jconto, I have tried your channels program and the plotting function works right out of the box. I can not seem to get the damping example to work. I don't receive any errors but I don't see any results. Any suggestions? I am using the example outfiles on your drive..

dquick gravatar imagedquick ( 2021-07-07 15:33:49 -0500 )edit

The damping calculation depends on pandas. Use pip to install it, in a CMD windows type: pip install pandas

jconto gravatar imagejconto ( 2021-07-08 13:06:47 -0500 )edit

I confirmed my install of pandas but I still don't get results. The end of my log looks like this Activity Damping Modal MPAA run 2, Pe_2

dquick gravatar imagedquick ( 2021-07-08 13:53:45 -0500 )edit

It was scipy that I was missing. It seems to be working now. I do have to make sure my plots are not showing, otherwise it crashes. Thank you!

dquick gravatar imagedquick ( 2021-07-09 10:48:29 -0500 )edit

Thanks for testing it. I have make small changes to eliminate such error. Please download the latest posting: "channels_JConto_20210704.zip" Now the modal process will run sequentially.

jconto gravatar imagejconto ( 2021-07-09 17:24:24 -0500 )edit

Hi jconto, when I use chan_A_cmp, it doesn't seem to merge the PDF's into one file. Instead, I get only 1 PDF in the final file. Is there something I'm doing wrong?

Type1_bus gravatar imageType1_bus ( 2021-07-27 13:37:03 -0500 )edit

The python module PYPDF2 is needed to merge created pdfs. On its absence, the pdfs created per channel selected are kept. To assign unique pdf names linked to its channel, on the INI file, update the next var as follows: plotsubfile = studyname_studytype_chani.pdf

jconto gravatar imagejconto ( 2021-07-27 14:34:01 -0500 )edit

Thanks jconto!

Type1_bus gravatar imageType1_bus ( 2021-07-27 15:25:15 -0500 )edit

Hi jconto, is there a way to make Channels work with Python 3?

Type1_bus gravatar imageType1_bus ( 2021-11-01 21:39:09 -0500 )edit

Hi jconto, when I try to plot multiple angles using chan_a_plt, I notice that the page titles in the pdf are not unique to the out files. It seems like only one out file is being chosen for the page title even though the var page title = studyname outlsti . Any possible fix for this?

Type1_bus gravatar imageType1_bus ( 2021-11-02 22:54:32 -0500 )edit

Channels creates a pdf file per each outfile. Set var 'pagetitle' = studyname outlsti, comment var title as "//title=...", set var 'legend' = chani Run demos and check other *.ini files to mimic use of titles (or other vars).

jconto gravatar imagejconto ( 2021-11-03 08:42:03 -0500 )edit

Thanks jconto!

Type1_bus gravatar imageType1_bus ( 2021-11-03 10:23:27 -0500 )edit

Hi jconto, for damping analysis using Channels, I notice that I only get the results for 10 generators as opposed to all the units in my system. Is there a way to fix this?

Type1_bus gravatar imageType1_bus ( 2022-04-13 20:12:19 -0500 )edit

The tool does not have a count limit on generators. It analyzes all signals with the "matrix pencil" algorithm based on the setting in the INI file, section "[damping]". Try increasing the value for "dampingpct" or change "Time_lastpct" for a different data window, or increase "num_iter", etc.

jconto gravatar imagejconto ( 2022-04-15 10:56:42 -0500 )edit

Thanks jconto, out of 81 signals in my case, I'm able to see modes only for the value set for num_iter. For example, if I set num_iter to 10, I see 10 units in my final results pdf file. If I set num_iter to 15 then I see 15 units in the pdf file. Could you please help me understand num_iter better?

Type1_bus gravatar imageType1_bus ( 2022-04-15 11:11:44 -0500 )edit

Search the internet for 'Iterative Matrix Pencil' or 'HICSS_2019_Overbye.pdf'. Slide 11 touch on the 'num_iter' variable. Worse damping signal are added iteratively to a matrix to 'help' recalculate previous results. When set to 10, I expect to get less than 10 signals with worse damping.

jconto gravatar imagejconto ( 2022-04-18 09:10:04 -0500 )edit

Hi, can anyone help me with this issue. I use python2.7 for psse 33 but I cannot install numpy, even by using the command 'pip install numpy' error is there saying that this is possible for python39. I also tried to add numpy through interpreter settings, no positive result. I cannot use python39.

brownkid gravatar imagebrownkid ( 2022-05-10 20:47:47 -0500 )edit

2 answers

Sort by » oldest newest most voted
0

answered 2017-06-23 07:19:40 -0500

AmirN gravatar image

updated 2017-07-12 06:35:17 -0500

Copying of all channels into matlab workspace (as possibility for matlab users)

Download matlab function and example of using:

https://drive.google.com/drive/folder...

function [numberchannels,nameschannels,tomatlab]=pssout2matlab(inputfile)

nameschannels=[];

channelsdata=[];

numberchannels=[];

tekst=[];

if nargin==0

[filename]=uigetfile('*.out','PSSE .out files'); % select file from disk (without inputfile in function call)

fid=fopen(filename);

else

fid=fopen(inputfile');

end

setstr(fread(fid,4,'char')');

setstr(fread(fid,4,'char')');

setstr(fread(fid,4,'char')');

numberchannels=fread(fid,1,'float32');

fread(fid,1,'float32');

nameschannels=setstr(fread(fid,[32, numberchannels] ,'char'))';

nameschannels=strvcat(strcat('Time',blanks(28)),nameschannels);

tekst=setstr(fread(fid,[60, 2] ,'char'))';

channelsdata=fread(fid,Inf,'float32');

kolona=(size(channelsdata,1)-2)/(numberchannels+2);

rezultat=reshape(channelsdata(1:kolona*(numberchannels+2)),numberchannels+2,kolona)';

tomatlab=rezultat(:,2:size(rezultat,2));

fclose(fid);

numberchannels=numberchannels+1;

nameschannels=strcat(num2str([1:numberchannels]','%06.f'),'-',nameschannels);

end

edit flag offensive delete link more

Comments

@AmirN when use pssout2matlab for psse33.10 and psse34 (.out) there is the error: rezultat=reshape(channelsdata(1:kolona*(numberchannels+2)),numberchannels+2,kolona)'; how can I do ? Thank you.

Gloria.Z gravatar imageGloria.Z ( 2018-10-16 04:05:23 -0500 )edit
0

answered 2023-12-11 12:12:51 -0500

Thank you for your wonderful tool jconto! After adding the necessary libraries, all of the example functions in "testall.bat" were able to run except the damping ratio example "chanPe_dmp.ini". I found that the reason for this was the version of the Pandas library. I had installed Pandas using "pip install pandas", which installed the most recent version (v2.1.4). However, the Channels tool relies on the pandas "append" attribute which is depreciated in Pandas 2.x, which uses the attribute "concat" instead of "append" (https://stackoverflow.com/questions/7...). I uninstalled Pandas, then reinstalled using "pip install pandas==1.5.3" and then the damping ratio example worked. Posting here so that others can resolve the issue more quickly than I did.

Thanks again for sharing your hard work!

Jeff Eggebraaten

edit flag offensive delete link more

Comments

1

Jeff, thanks for sharing your experience with Channels. I will look into the pandas version issue and update the tools as needed.

jconto gravatar imagejconto ( 2023-12-11 18:09:10 -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

6 followers

Stats

Asked: 2017-06-10 10:12:42 -0500

Seen: 2,702 times

Last updated: Mar 15