First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

HOW TO CALCULATE FVSI FROM DYNAMIC SIMULATION

asked Dec 12 '15

Mus gravatar image

updated Aug 22 '17

jconto gravatar image

Hello Everyone,

i want a code to perform dynamic simulation and calculate FVSI later ... to achieve that i had compile some codes got it from here, but i stuck to complete the code. can you please help me to complete it ..

Much Thanks

*#identify system office and tools function.
import os
import sys
import glob

#To idntifty where is psse file inside the computer files
PSSE_PATH = r'C:\Program Files (x86)\PTI\PSSEUniversity33\PSSBIN'
#Telling python where to find psse 
sys.path.append(PSSE_PATH)
#settle the enviorment file
os.environ['PATH'] += ';' + PSSE_PATH

#PSSE INITIALIZATION
import psspy
import redirect
redirect.psse2py()
psspy.psseinit()

# RUN POWER FLOW CASE 
bussystem= r"""C:\Users\user\Desktop\IT\FYP2\Dynamic\shortcourse5bussytem\TEST1.sav"""
psspy.case(bussystem)
#solve powerflow
psspy.fdns([0,0,0,1,1,0,99,0])

# Convert loads (3 step process):
psspy.conl(-1,1,1)
psspy.conl(-1,1,2,[0,0],[100,0,0,100])
psspy.conl(-1,1,3)

# Convert generators:
psspy.cong()

# Solve for dynamics
psspy.ordr()
psspy.fact()
psspy.tysl()

# Add dynamics data
psspy.dyre_new(dyrefile="C:\Users\user\Desktop\IT\FYP2\Dynamic\shortcourse5bussytem\daynmictest.dyr")

# Add channels by subsystem
#   BUS VOLTAGE
psspy.chsb(sid=0,all=1, status=[-1,-1,-1,1,13,0])
#   BUS ANGLE
psspy.chsb(sid=0,all=1, status=[-1,-1,-1,1,1,0])
#   BUS P&Q
psspy.chsb(sid=0,all=1, status=[-1,-1,-1,1,16,0])

# Save snapshot
psspy.snap(sfile="C:\Users\user\Desktop\IT\FYP2\Dynamic\shortcourse5bussytem\daynmictest.snp")

# Initialize + RUN DYN FOR 1 SND
psspy.strt(outfile="C:\Users\user\Desktop\IT\FYP2\Dynamic\shortcourse5bussytem\daynmictest.out")
psspy.run(tpause=1)


####APPLYING BUS FAULT
####PRE FAULT CONDITION + CUREATING FAULT
###3-phase fault on bus 100 (default bus fault is a 3phase and there is no bus 200)
##psspy.dist_bus_fault(ibus=100)
##
### DURING FAULT CONDITION RUNNING FOR 1.1 SND
##time = 1.1
##psspy.run(tpause=time)
##
### Clear fault (assuming only part of bus faults)
####psspy.dist_clear_fault()
##psspy.dist_branch_trip(ibus=100, jbus=150, id='1')
##
####AFTER FAULT CONDITION
### Run to 15 seconds
##time = 15
##psspy.run(tpause=time)

# ----------------------------------------------------------------------------------------------------
def array2dict(dict_keys, dict_values):
    '''Convert array to dictionary of arrays.
    psspy.halt()s dictionary as {dict_keys:dict_values}
    '''
    tmpdict = {}
    for i in range(len(dict_keys)):
        tmpdict[dict_keys[i].lower()] = dict_values[i]
    return tmpdict

# ----------------------------------------------------------------------------------------------------
def busindexes(busnum, busnumlist):
    '''Find indexes of a bus in list of buses.
    psspy.halt()s list with indexes of 'busnum' in 'busnumlist'.
    '''
    busidxes = []
    startidx = 0
    buscounts = busnumlist.count(busnum)
    if buscounts:
        for i in range(buscounts):
            tmpidx = busnumlist.index(busnum,startidx)
            busidxes.append(tmpidx)
            startidx = tmpidx+1
    return busidxes

# ----------------------------------------------------------------------------------------------------
def splitstring_commaspace(tmpstr):
    '''Split string first at comma and then by space. Example:
    Input  tmpstr = a1       a2,  ,a4 a5 ,,,a8,a9
    Output strlst = ['a1', 'a2', ' ', 'a4', 'a5', ' ', ' ', 'a8', 'a9']
    '''
    strlst = []
    commalst = tmpstr.split(',')
    for each in commalst:
        eachlst = each.split()
        if eachlst:
            strlst.extend(eachlst)
        else:
            strlst.extend(' ')

    return strlst

savfile = 'savnw.sav'
print "steadystate30-6-14: %s\n\n"%savfile
clnttls = "%6s,%18s,%6s,%18s,%3s,%8s,%8s ...
(more)

2 answers

Sort by » oldest newest most voted
0

answered Apr 1 '0

FIRAS gravatar image

Sorry can you please help me with how to calculate the voltage stability indicators in PSSE

link

Comments

Search for the post "whats wrong with this fvsi program?" to get a link to my google site and download the fvsi code.

jconto gravatar imagejconto (Apr 2 '0)
0

answered Dec 13 '15

jconto gravatar image

updated Apr 2 '0

The calculation of FVSI is based on steady state network conditions. The case after a dynamic simulation cannot be used for steady state activities. There is a need to 'de-convert' a dynamic case before using steady state PSSe activities.

For your study, you have to 'de-convert' the case at the end of the dynamic simulation before the FVSI calculation.

To de-converter a dynamic case:

1- From the steady state case used to run the dynamic simulation, take note of the swing bus (type 3)

2- At the end of the dynamic simulation, save the case as RAW file.

3 - Edit the RAW to change the bus type of the swing bus using data in (1)

4- Load the modified RAW file. Solve it. (Save it as *.SAV)

5- Case is ready for steady state activities.

Search for the post "whats wrong with this fvsi program?" to get a link to my google site and download the fvsi code.

link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Dec 12 '15

Seen: 1,493 times

Last updated: Apr 01 '20