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
This code prints out all channels available - where is the actual scan?
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: 2016-10-19 16:15:42 -0500
Seen: 668 times
Last updated: Nov 22 '21