Ask Your Question
0

Apply a disturbance in IEEE39

asked 2021-05-02 15:40:23 -0500

Sadcow gravatar image

updated 2021-05-02 19:49:20 -0500

Hello everyone,

I want to put a composite load at one bus, for example, bus 20, and apply a 3-phase fault at bus 6 of the IEEE39 system.

I am new to python and PSSE. I have tried to find the data and the model. I have found this file on this website. Since I can not share link, this is the question which I have found the IEEE39 data: "IEEE 39 BUS DYNAMIC SIMULATION IN PSSE" from Jconto's google drive.

I have tried to use the mentioned code and model. However, I have some problems regarding that. 1- I have to change the time of the simulation run, but for all the run time, the outputs channels have a length of 85.

2- I don't have any clue how to add a load to one specific bus (for example a composite load to bus 20).

3- In the code, there is a fault for one line. But how to apply a 3-phase fault?

I have provided the code as follow:

import os, sys
import numpy as np
import csv
import matplotlib.pyplot as plt
sys_path_PSSE = 'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'  # or where else you find the psspy.pyc
sys.path.append(sys_path_PSSE)
os_path_PSSE = 'C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN'  # or where else you find the psse.exe
os.environ['PATH'] = ';' + os_path_PSSE
import psspy
import dyntools
import redirect
import os, sys
def runscript(myscript):
    import psspy
    if os.path.isfile(myscript):
       root,ext = os.path.splitext(myscript)
   #print root,ext
       if   ext.upper()=='.PY':
            execfile(myscript)
       elif ext.upper()=='.IDV':
            psspy.runrspnsfile(myscript)
       elif ext.upper()=='.IRF':
            psspy.runiplanfile(myscript)
try:
  psspy
  GUI = True
  if sys.argv[-1]=='' or len(sys.argv[-1].strip())<1:
     sys.argv.pop()
except:
  GUI = False
  import psspy
  psspy.psseinit(150000)
_i = psspy.getdefaultint()
_f = psspy.getdefaultreal()
_s = psspy.getdefaultchar()
import redirect
try:
  redirect.psse2py()
except:
  pass
keyword = 'IEEE39'
savkey  = 'IEEE39_v33'
dyrfile = 'IEEE39.dyr'
study   = 'IEEE39_flat'
conl    = 'Conl.idv'
cnvfile = '%s_cnv.sav'%study
channels= 'channels.idv'
snpfile = '%s'%keyword
outfile = '%s.out'%study
logfile = '%s.log'%study
sys.stdout = open(logfile,'w') # redirect all prints to this log file
psspy.case(savkey)
runscript(conl)
psspy.fnsl((_i,0,_i,_i,_i,_i,_i,0))
psspy.cong(0)
psspy.ordr(0)
psspy.fact()
psspy.tysl(0)
psspy.tysl(0)
psspy.save(cnvfile)
psspy.dyre_new([1,1,1,1],dyrfile,"","","")
psspy.snap([-1,-1,-1,-1,-1],snpfile)
sid    = 2       # -1 = All buses, or enter 0-9 for a subsystem:
region = [1]
ierr = psspy.zsys(sid, len(region), region)
print 'psspy.asys - ',ierr
psspy.chsb(2,0,[-1,-1,-1,5,0,0])   # system totals by zone subsystem
psspy.dynamics_solution_param_2([_i, _i, _i, _i, _i, _i, _i, _i], [_f, _f, 0.00001, _f, _f, _f, _f, _f])
psspy.set_relang(1,38,r"""1""")

psspy.strt_2([0,1],outfile)



psspy.run(0,53,990,9,0)
sys.stdout.close()                # ordinary file object
sys.stdout = sys.__stdout__

ch = dyntools.CHNF(outfile)
short_title, chanid_dict, chandata_dict = ch ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2021-05-03 16:47:42 -0500

jconto gravatar image

Check the post "CMLDxxU2 + CMLDelta modeling" and then download the demo data set to model a CMLD load and to test it with a 3-phase fault.

edit flag offensive delete link more

Comments

Thank you @jconto. I tried to follow your instructions. However, when I want to add the load to the ieee39 dynamic data, it is not working. I have added the load as following to bus 13: 13 'USRLOD','*','CMLDZNU2', 12, 3, 2, 133, 27, 146, 48, 0, 0 -1 0 0.0001 ../ and then generator and ...

Sadcow gravatar imageSadcow ( 2021-05-03 23:35:01 -0500 )edit

(due to the space limitations, I have to add this comment) Does anything I should add to that? thank you so much.

Sadcow gravatar imageSadcow ( 2021-05-03 23:36:33 -0500 )edit

For a bus load use 'CMLDBLU2', the zonal version is applied to a zone number, not a bus. The demo set contains a zonal cmld dyr, savnw_cmld_zones.dyr. Read the manual 'MODELS' for models usage.

jconto gravatar imagejconto ( 2021-05-04 17:29:25 -0500 )edit

Thanks a lot.

Sadcow gravatar imageSadcow ( 2021-05-04 18:05:21 -0500 )edit

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: 2021-05-02 15:40:23 -0500

Seen: 56 times

Last updated: May 03