First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
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')