Ask Your Question

Scan feature in PSSPLT

asked 2016-10-19 16:15:42 -0600

Power_System_Engineer gravatar image

I need to scan for low voltages and other identifiers - How do I automate this in python to scan the voltages and if the voltages are below say .70 then flag it as unstable?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2016-10-20 13:46:31 -0600

perolofl gravatar image

updated 2021-11-19 09:50:25 -0600

PSSPLT does not support Python or Iplan. I would recommend to use module dyntools to open and read an out-file and loop through all channel in order to decide if the performed simulation was unstable or not.

The following script shows a function that returns the lowest value of all voltage channels (VOLT) in an outfile.

import dyntools

def find_lowest_voltage(outfile,channelid='VOLT'):
    """ Returns lowest value of all channels with id channelid in outfile
    chnfobj = dyntools.CHNF(outfile)
    sh_ttl, ch_id, ch_data = chnfobj.get_data()
    chanrange = chnfobj.get_range()
    lowest = 9e21
    idlen = len(channelid)
    for k in range(1,len(ch_id)):
        if ch_id.get(k)[:idlen]==channelid:
            lowest = min(chanrange[k]['min'],lowest)
    return lowest

The returned value can be used to decide on stability or not, i.e. < 0.7 in your case.

EDIT: inserted variable idlen in the script above

edit flag offensive delete link more


Thank you.

Power_System_Engineer gravatar imagePower_System_Engineer ( 2016-10-20 14:27:35 -0600 )edit

This code prints out all channels available - where is the actual scan?

Power_System_Engineer gravatar imagePower_System_Engineer ( 2016-10-20 14:43:44 -0600 )edit

I had forgot to remove the print statements I used for debugging. The code should now print nothing. As I wrote the code returns the lowest channel voltage. Use vmin = find_lowest_voltage('outfile.out') to store the min value in variable vmin.

perolofl gravatar imageperolofl ( 2016-10-20 22:59:56 -0600 )edit

Hello, what channels are the script looking for? Can it be defined to search after a certain time? Where is the minimum value of tension placed? (lowest = 9e21?) What is the meaning of [: 4]?

SAE_2016 gravatar imageSAE_2016 ( 2021-11-19 08:02:27 -0600 )edit

The script will scan all channels with identifiers beginning with string 'VOLT*. ch_id.get(k)[:4] returns the first four characters in channel id. Variable lowest contains the minimum voltage value.

perolofl gravatar imageperolofl ( 2021-11-19 09:45:43 -0600 )edit

answered 2021-11-19 16:06:12 -0600

jconto gravatar image

updated 2021-11-22 08:23:12 -0600

Search for the post "Channels - tool to process outs files" on this forum. Channels (it uses dyntools, tested on v.33+python2.7, v34+python 3.7) will scan many OUTs files to rank channels’ performance based on User’s criteria within a specified time frame.  List channels that failed the criteria, with option to plot. Criteria: scan channels for min, max violation, peak-to-peak, delta violation and UV/OV delay recovery.
Other features include plotting, channel export to xls, damping calculations. There is a readme_doc, a ppt presentation and several demos included in the zip file. For your case, run the demo chan_V_idx.ini

edit flag offensive delete link more

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



Asked: 2016-10-19 16:15:42 -0600

Seen: 363 times

Last updated: Nov 22