Ask Your Question
0

how to duplicate a network element

asked 2022-12-09 08:07:31 -0500

anonymous user

Anonymous

What's the best way to duplicate a network element (e.g. add a transformer connection by duplicating an existing transformer connection)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2022-12-12 08:41:33 -0500

perolofl gravatar image

It can be done in the GUI:

  1. Select a transformer in the 2 Winding spreadsheet
  2. Ctrl-c to copy the data to the clipboard
  3. Click the first column on the empty last line
  4. Ctrl-v to paste the data.
  5. Change the id from e.g. 1 to 2
  6. Press enter to exit edit mode

A transformer can be duplicated in python in the following way:

  1. Write raw data for the subsystem consisting of ibus and jbus
  2. Change id of existing transformer
  3. Read raw data files with existing transformer

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')
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2022-12-09 08:07:31 -0500

Seen: 487 times

Last updated: Dec 12 '22