First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Hi,
I am trying to run a lot of simulations (approximately 7000 cases) using the sanvw model. After going through around 900 simulations, the whole script just stops. Looking into the log, i see this:
Array allocation failed in DYRE
Is there some memory problem because i am running psspy.dyre_new() before every simulation?
Thanks, Bikiran
2 | No.2 Revision |
Hi,
I am trying to run a lot of simulations (approximately 7000 cases) using the sanvw model. After going through around 900 simulations, the whole script just stops. Looking into the log, i see this:
Array allocation failed in DYRE
Is there some memory problem because i am running psspy.dyre_new() before every simulation?
Thanks,
BikiranEDIT:
Just saw the 1st answer and i posted as much code here without making it too long. A lot of definitions are missing in the posted code, but thats all defined properly in the script.
For every event in simList, i am reading the raw file and dyr file (using dyre), converting loads and generators and doing anything else necessary to set up. Is there a way to do the simulations (N-2 line outages with fault) with the same network and dynamics snapshot without having to read in the raw and dyr file. If so, please let me know. Thanks!
# Local imports
import redirect
import psspy
import dyntools
##### Get everything set up on the PSSE side
redirect.psse2py()
psspy.psseinit(buses=80000)
_i=psspy.getdefaultint()
_f=psspy.getdefaultreal()
_s=psspy.getdefaultchar()
for event in simList:
#Parameters.
settings = {
# #####################################
'filename':rawFile,
################################################################################
'dyr_file':dyrFile,
'out_file':'output2.out',
'pf_options':[
0, #disable taps
0, #disable area exchange
0, #disable phase-shift
0, #disable dc-tap
0, #disable switched shunts
0, #do not flat start
0, #apply var limits immediately
0, #disable non-div solution
]
}
ierr = psspy.read(0, settings['filename'])
ierr = psspy.fnsl(settings['pf_options'])
##### Prepare case for dynamic simulation
# Load conversion (multiple-step)
psspy.conl(_i,_i,1,[0,_i],[_f,_f,_f,_f])
psspy.conl(1,1,2,[_i,_i],[100.0, 0.0,0.0, 100.0])
psspy.conl(_i,_i,3,[_i,_i],[_f,_f,_f,_f])
ierr = psspy.cong(0) #converting generators
ierr = psspy.ordr(0) #order the network nodes to maintain sparsity
ierr = psspy.fact() #factorise the network admittance matrix
ierr = psspy.tysl(0) #solving the converted case
ierr = psspy.dynamicsmode(0) #enter dynamics mode
ierr = psspy.dyre_new([1,1,1,1], settings['dyr_file'])
ierr=psspy.docu(0,1,[0,3,1]) #print the starting point of state variables
# select time step ##############################################################
ierr = psspy.dynamics_solution_params([_i,_i,_i,_i,_i,_i,_i,_i], [_f,_f,0.00833333333333333,_f,_f,_f,_f,_f], 'out_file') # the number here is the time step
################################################################################
##### select channels
ierr = psspy.delete_all_plot_channels() # clear channels
BusDataDict = getBusData(rawFile)
# get all the bus voltages, angles and frequencies
for bus in BusDataDict:
bus = int(bus)
ierr = psspy.voltage_and_angle_channel([-1, -1, -1, bus])
ierr = psspy.bus_frequency_channel([-1, bus])
# get the nominal voltages as well as the fault impedance in ohms
FaultBusNomVolt = float(BusDataDict[str(FaultBus)].NominalVolt)
Zbase = FaultBusNomVolt**2/Sbase # float since Sbase is a float
Rohm = FaultRpu*Zbase # fault impedance in ohms
ierr = psspy.strt(0,settings['out_file'])
ierr = psspy.run(0,0.1,1,1,1)
ierr = psspy.dist_branch_trip(L1Bus1, L1Bus2, L1cktID)
ierr = psspy.run(0,0.2,1,1,1) #fault on time
ierr = psspy.dist_bus_fault(int(FaultBus), 3, 0.0, [Rohm, 0.0])
ierr = psspy.run(0,0.3,1,1,1) #fault off time
ierr = psspy.dist_clear_fault(1)
ierr = psspy.run(0,0.31,1,1,1) #fault off time
ierr = psspy.dist_branch_trip(L2Bus1, L2Bus2,L2cktID)
ierr = psspy.run(0,0.35,1,1,1) #fault off time
ierr = psspy.run(0,10.0,1,1,1) #exit time (second argument is the end time)