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

Ask Your Question
0

Scan feature in PSSPLT

asked Oct 19 '16

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?

2 answers

Sort by » oldest newest most voted
0

answered Oct 20 '16

perolofl gravatar image

updated Nov 19 '1

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

link

Comments

Thank you.

Power_System_Engineer gravatar imagePower_System_Engineer (Oct 20 '16)

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

Power_System_Engineer gravatar imagePower_System_Engineer (Oct 20 '16)

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 (Oct 21 '16)

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 (Nov 19 '1)

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 (Nov 19 '1)
0

answered Nov 19 '1

jconto gravatar image

updated Nov 22 '1

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

link

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

2 followers

Stats

Asked: Oct 19 '16

Seen: 700 times

Last updated: Nov 22 '21