how to duplicate a network element
asked 2022-12-09 08:07:31 -0500
Anonymous
What's the best way to duplicate a network element (e.g. add a transformer connection by duplicating an existing transformer connection)
add a comment
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
asked 2022-12-09 08:07:31 -0500
Anonymous
What's the best way to duplicate a network element (e.g. add a transformer connection by duplicating an existing transformer connection)
It can be done in the GUI:
A transformer can be duplicated in python in the following way:
The python code:
import os
def duplicate_transformer(ibus,jbus,ickt='1',ickt2='2'):
""" Duplicates 2W transformer ickt between ibus and jbus
"""
rdcfile = 'copy_transformer_dummy_file'
# Write data for existing transformer to raw data files
psspy.bsys(11,0,[0.0,0.0],0,[],2,[ibus,jbus],0,[],0,[])
psspy.rawd_2(11,0,[1,1,1,0,0,0,2],0,rdcfile+'.rac')
psspy.rwsq_2(11,0,[1,1,1,1,1],0,rdcfile+'.seq')
# Change id of existing transformer
psspy.mbidbrn(ibus,jbus,ickt,ickt2)
# Read raw data files with existing transformer
psspy.rdch(0,rdcfile+'.rac')
psspy.resq(rdcfile+'.seq')
# Delete raw data files
os.remove(rdcfile+'.rac')
os.remove(rdcfile+'.seq')
# Duplicate transformer in savnw network
duplicate_transformer(152,153,'1','2')
Asked: 2022-12-09 08:07:31 -0500
Seen: 487 times
Last updated: Dec 12 '22