Ask Your Question

Power_System_Engineer's profile - activity

2019-09-04 04:05:12 -0500 received badge  Student (source)
2018-08-24 23:19:49 -0500 received badge  Famous Question (source)
2017-12-05 14:04:04 -0500 received badge  Notable Question (source)
2017-11-22 02:35:42 -0500 received badge  Popular Question (source)
2017-11-17 09:36:07 -0500 commented answer Check if case solve or not after using psspy.fdns() routine.

thanks!!!!

2017-11-16 16:10:14 -0500 asked a question Check if case solve or not after using psspy.fdns() routine.

Is there a way to check if the case solve or not and output that status to a text file?

2017-05-25 10:43:37 -0500 received badge  Famous Question (source)
2017-03-01 17:40:08 -0500 received badge  Teacher (source)
2017-02-16 08:14:20 -0500 commented answer How to transform a branch from in-service to out-serive using Python

agreed -the keyword function is just my personal preference - I tend to forget what those values represent after a period of time.

2017-02-15 08:39:06 -0500 answered a question How to transform a branch from in-service to out-serive using Python

If I understands your question correctly, assuming you want to use the PSSE API python method to take a branch out of service in the powerflow model.

Here's the standard python syntax per PSSE_API document - i = frombus, j = tobus, ckt = circuit id, intgar is an array of 6 elements, so using the keyword function, intgar1 is where the branch status can be set from 1 to 0 where 1 = in service.

psspy.branchdata3( i=12345,j=34567,ckt = '1',intgar1 = 0)

2017-02-15 08:27:28 -0500 answered a question Batch Fault Simulation using looping in python

This is how I run my dynamic simulations with multiple fault files and converted models.

Here's a simple way to do it - Others may have better codes than this, but this works well for me. Of course you could add additional details in between as you wish but it should get what you are asking for. workdir and flt are folders but you could specifically assign what workdir path is or completely forget it and have everything input/output from your main folder.

Reading and storing all fault files in flt folder

    mypath_ = work_dir + "/flt"
    flt_file = [a for a in listdir(mypath_) if isfile(join(mypath_, a))]

    #splitting up file extensions
    flt_infile = []
    for r in flt_file:
            flt_infile.append(os.path.splitext(r)[0])

    print 'FAULT_DEF = ' , flt_infile
    print (" \n")

Reading and storing all converted cases convlf folder

    mypath = work_dir + "/convlf"
    clf_file = [g for g in listdir(mypath) if isfile(join(mypath, g))]

    #splitting up the .sav extension
    clf_infile = []
    for t in clf_file:
            clf_infile.append(os.path.splitext(t)[0])

    print 'CONVLF_DEF = ' , clf_infile
    print (" \n")

Looping through all cases and flt files

    flt_flag = 0     #1 = idv files, 0 = python files
    dist_run = 20.0     #20 seconds run

    for x in clf_infile:
        for y in flt_infile:

            psspy.case(work_dir + "/convlf/" + x + ".sav")
            psspy.rstr(work_dir + "/snap/" + snapfile + ".snp")

            psspy.strt(option = 0,
                       outfile = work_dir + "/bin/" + x + "-" + y + ".out"
                       )

            # run disturbance in steady state for 0.1 sec
            psspy.run(option = 0,
                      tpause = flat_start,
                      nprt = 0,
                      nplt = 1,
                      crtplt = 0
                      )

            # run disturbance and clear fault
            if flt_flag == 0:
                    execfile(work_dir + "/flt/" + y + ".py")

            else:
                    psspy.runrspnsfile(work_dir + "/flt/" + y + ".idv")

            # finish 20 second run
            psspy.run(option = 0, 
                      tpause = dist_run,
                      nprt = 0,
                      nplt = 1,
                      crtplt = 0
                      )
2016-12-08 16:38:19 -0500 received badge  Famous Question (source)
2016-11-24 15:10:20 -0500 received badge  Famous Question (source)
2016-11-24 15:10:20 -0500 received badge  Notable Question (source)
2016-11-23 15:23:37 -0500 received badge  Popular Question (source)
2016-11-23 01:08:41 -0500 received badge  Popular Question (source)
2016-11-23 01:08:41 -0500 received badge  Notable Question (source)
2016-11-22 12:29:39 -0500 asked a question Stability Simulation - clearing islands

I'm trying to figure out how I can clear only the island that the tripping element is causing during the tripping of the fault element right after distclearfault().

When I use psspy.tree(1,0) and psspy.tree(2,1), it clears ALL islands within the case which I do not want.

2016-11-22 08:54:47 -0500 commented answer psspy tree PSSE command API

That works great if there are island buses, but it is throwing me an ierr = 1 which indicates that there are no island buses. So how would I check if there are island buses or not and if so then invoke the psspy.island()? Ok nvm I figured it out. Thanks for your help!

2016-11-21 15:54:46 -0500 asked a question psspy tree PSSE command API

What's the best way to check for island buses? I found the psspy.tree(1,0) but unfortunately, if there are no island buses, it throws an error when I change the option to 2 to disconnect all island buses. What I would like to do is check if there are island buses not equal to zero, then execute the psspy.tree(2,1).

2016-11-07 22:30:01 -0500 received badge  Notable Question (source)
2016-11-06 00:04:56 -0500 received badge  Famous Question (source)
2016-11-06 00:04:56 -0500 received badge  Notable Question (source)
2016-11-01 16:29:58 -0500 received badge  Famous Question (source)
2016-11-01 16:29:58 -0500 received badge  Notable Question (source)
2016-10-31 05:51:42 -0500 received badge  Popular Question (source)
2016-10-28 14:00:08 -0500 asked a question PSSE Line Prop

I'm trying to verify the line constants for my short circuit model - I have 8 different substations and each T line has different length - When I model the structures in PSSE Line Prop, do I need to model all structures and set the circuit location in ft based on my reference substation or do I need to build the structure individually and get the R, X values for just that circuit.

The impedance of each circuit is different with all structures modeled vs individually. What's the correct way?

2016-10-27 12:41:23 -0500 received badge  Famous Question (source)
2016-10-20 14:43:44 -0500 commented answer Scan feature in PSSPLT

This code prints out all channels available - where is the actual scan?

2016-10-20 14:27:35 -0500 commented answer Scan feature in PSSPLT

Thank you.

2016-10-20 14:25:40 -0500 received badge  Popular Question (source)
2016-10-19 16:15:42 -0500 asked a question Scan feature in PSSPLT

I need to scan for low voltages and other identifiers - How do I automate this in python to scan the voltages and if the voltages are below say .70 then flag it as unstable?

2016-10-16 21:54:06 -0500 received badge  Famous Question (source)
2016-10-16 21:54:06 -0500 received badge  Popular Question (source)
2016-10-16 21:54:06 -0500 received badge  Notable Question (source)
2016-10-16 21:53:26 -0500 received badge  Famous Question (source)
2016-10-12 15:31:36 -0500 received badge  Notable Question (source)
2016-10-12 15:28:17 -0500 received badge  Notable Question (source)
2016-10-12 14:34:17 -0500 commented answer PSSPLT in python

The stability script does change the work directory under variable work_dir. So whatever the user has for the work_dir variable as is the working directory.

2016-10-12 14:32:52 -0500 commented answer Open .ps plot files using Python

Thank You!!!

2016-10-12 11:46:24 -0500 received badge  Popular Question (source)
2016-10-12 11:27:24 -0500 received badge  Commentator
2016-10-12 11:27:24 -0500 commented answer Open .ps plot files using Python

How would I iterate this code? I have like over 400 stability postscript files in a folder. What I would like to do is tell python to go into that directory and start the conversion for all *.ps files 2 pdf in that directory. Thank you!

2016-10-12 11:24:47 -0500 commented answer PSSPLT in python

The small script above worked great alone but when I embed it within my stability run script at the end, it is complaining that it can't locate the idv file. Any suggestions?