Ask Your Question
0

Arrary allocation failed in DYRE

asked 2018-10-23 15:58:17 -0500

bikiran1991 gravatar image

updated 2018-10-23 23:42:12 -0500

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?

EDIT:

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 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-10-23 23:21:23 -0500

perolofl gravatar image

updated 2018-10-25 10:55:54 -0500

Dyre_new replaces old dynamic models with the new models defined in the dyre-file. PSSE will then allocate the new model parameters at the end of the CON, VAR, STATE and ICON vectors. After doing that 900 times you reached the maximum possible index for the a vector.

Open the snapshot again before doing dyre_new.

EDIT: In my answer above I mixed up dyrenew with dyreadd. My discussion above is valid for dyreadd but you are using dyrenew so there should not be any problems with the vectors.

Why are you reading in models with dyre_new before every simulation? What parameters are you changing in your simulations? You are not following the normal procedure for dynamic simulations.

EDIT 2: I would recommend you to move all code from line:

#Parameters

to line:

ierr = psspy.bus_frequency_channel([-1, bus])

before the loop, since the same raw-file and dyr-file is used in all simulations. Then save the converted saved case and the prepared snapshot (including all dynamic data and channels).

psspy.save(xxx)
psspy.snap(yyy)

Inside the loop:

Read the converted case and restore the snaphot at the beginning, so you will start each simulation with same data (case and snapshot).

psspy.case(xxx)
psspy.rstr(yyy)

In this way dyre_new will only be executed once!!!

edit flag offensive delete link more

Comments

Thanks! This works!

bikiran1991 gravatar imagebikiran1991 ( 2018-10-27 10:47:01 -0500 )edit

@perolofl could too many channels cause this issue? I am encountering it when loading a single snp (with many channels).

likethevegetable gravatar imagelikethevegetable ( 2019-12-10 11:31:23 -0500 )edit

How many channels do you have?

perolofl gravatar imageperolofl ( 2019-12-11 01:29:11 -0500 )edit

Close to 2000 - which I understand is the maximum(?). Interestingly, it's only occurring depending on the fault I run. In other words, I'll load the same sav, snp, gnet the same units, load the same channels, etc. and will only get the array allocation failed error on a particular fault.

likethevegetable gravatar imagelikethevegetable ( 2019-12-11 07:05:30 -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: 2018-10-23 15:58:17 -0500

Seen: 1,336 times

Last updated: Oct 25 '18