Scan feature in PSSPLT
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?
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
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?
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
Thank you.
This code prints out all channels available - where is the actual scan?
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.
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]?
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.
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
Asked: Oct 19 '16
Seen: 700 times
Last updated: Nov 22 '21