Ask Your Question

acd1's profile - activity

2023-01-31 11:39:32 -0500 answered a question (API)Power Flow Operation - DIFF

I believe you need to first initialize the area subsystem 0 with psspy.asysinit(0)

2023-01-31 10:14:45 -0500 answered a question ACCC not working with substation links case

I've not had that issue before, but I guess I would attempt running the non-parallel ACCC routine: accc_with_dsp_3()

2023-01-26 11:06:41 -0500 commented answer OLTC Modeling

You are correct - my calculation (and I believe the poster's data) misrepresent the situation. The number of tap positions is different from the number of steps (= taps - 1). 33 tap positions, or 32 steps of 0.625%, are very typical of LTCs.

2023-01-24 14:38:46 -0500 answered a question OLTC Modeling

The tap size is actually controlled via the "Tap Positions" field. So with a tap range of 0.9 ~ 1.1, you have a range of 0.2. With each tap step of 0.00606, the number of tap positions is 0.2 / 0.00606 which is 33.

The current tap setting will either be "Winding 1 Ratio (pu)" or "Winding 2 Ratio (pu)" depending on your control settings. You can also use the "xfrdat" routine from the psspy API to programatically retrieve the tap ratio for two winding transformers.

Here is a series of batch commands to add a 2-winding zero-impedance transformer between a hypothetical bus 1 and bus 2, as generated by PSSE. The winding 2 ratio is one tap off the nominal ratio, at 1.00606.

BAT_TWO_WINDING_DATA_6,1,2,'1',1,1,1,0,0,0,33,0,1,0,0,1,0,1,1,1,0.0, 0.0001, 100.0, 1.0,0.0,0.0, 1.0,0.0, 1.0, 1.0, 1.0, 1.0,0.0,0.0, 1.1, 0.9, 1.1, 0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," ",

BAT_TWO_WINDING_CHNG_6,1,2,'1',,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;

BAT_TWO_WINDING_CHNG_6,1,2,'1',,,,,,,,,,2,,,,,,,,,,,,, 1.00606,,,,,,,,,, 1.03, 0.97,,,,,,,,,,,,,,,,,,;
2022-06-21 15:54:32 -0500 received badge  Taxonomist
2022-05-31 09:10:16 -0500 received badge  Famous Question (source)
2022-05-26 18:53:29 -0500 received badge  Notable Question (source)
2022-05-26 16:45:40 -0500 commented answer wxPython & PSSE threading

Thanks for the comment. I have been using the threading module, but it looks like the multiprocessing module may do the trick. I'll dig into that some more. The long_running_psse_process() code both opens and closes PSSE and all log files.

2022-05-26 09:46:11 -0500 answered a question How to skip a branch in automatic contingency specification in PSS/E 35?

I don't know if it's the same as PSSE 34, but per the PSSE 34 manual, skipping must be done in a block structure like so:

SKIP
100 TO 200 CKT 1
END

Note that there is no "from bus" or "to bus" in the syntax.

2022-05-26 08:22:40 -0500 received badge  Popular Question (source)
2022-05-25 12:05:17 -0500 asked a question wxPython & PSSE threading

I have been trying to develop a GUI using wxPython for a long-running PSSE process which remains responsive while PSSE is doing its work. I'm not at all experienced with multithreading in any programming language, so I've generally just been following the structure from the first script shown here: https://wiki.wxpython.org/LongRunning...

It has become clear to me that invoking PSSE through the psspy API is not the same as running standalone python code when it comes to multithreading.

Here is my general code structure and an example GUI. There are two buttons in this sample GUI as well as two text fields. The "Add" button just increments the first text field by 1 and only exists as a check to see if the GUI is responsive. The "Run" button calls a long running PSSE process in a separate worker thread (or so I hoped) and then updates the second text field to '999' when it's finished. The script runs outside PSSE, and only instantiates PSSE when it's called on by the user.

Here's the kicker: if I replace long_running_psse_process() with a simple time.sleep(10), then the GUI is responsive as I would have expected. However, as soon as PSSE enters the picture, the GUI hangs whenever PSSE is working on something.


I would like to know if this sort of multi-threading is possible, or if something about the psspy API precludes this approach. Does anyone have any experience in getting something like this working well?

I am using PSSE 34.9.3 and Python 2.7.18 if that matters.

import wx
import os
import sys
import threading
import time

syspath = r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27"
ospath = r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN"
sys.path.append(syspath)
os.environ['PATH'] += ';' + ospath
os.environ['PATH'] += ';' + syspath

import psspy
import redirect

EVT_RESULT_ID = wx.NewId()

def main():
    app = wx.App(None)
    frame = main_frame(None, title='Test Multithreading')
    frame.SetSize(300, 100)
    frame.Show()
    app.MainLoop()

def EVT_RESULT(win, func):
    win.Connect(-1, -1, EVT_RESULT_ID, func)

class ResultEvent(wx.PyEvent):
    def __init__(self, data):
        wx.PyEvent.__init__(self)
        self.SetEventType(EVT_RESULT_ID)
        self.data = data

class WorkerThread(threading.Thread):
    def __init__(self, notify_window):
        threading.Thread.__init__(self)
        self._notify_window = notify_window

    def run(self):
        long_running_psse_process()
        wx.PostEvent(self._notify_window, ResultEvent(999))

class main_frame(wx.Frame):
    def __init__(self, parent, title):
        super(main_frame, self).__init__(parent, title=title,
                                         style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
        self.CenterOnScreen(direction=wx.HORIZONTAL)
        self.x = 0
        self.worker = None

        EVT_RESULT(self, self.on_finish)

        pnl = wx.Panel(self)
        sizer = wx.GridBagSizer(2, 2)

        button_add = wx.Button(pnl, label='Add', size=(90, 28))
        button_add.Bind(wx.EVT_BUTTON, self.on_add)
        sizer.Add(button_add, pos=(0, 0), border=10)

        self.x_text = wx.StaticText(pnl, label='0')
        sizer.Add(self.x_text, pos=(0, 1), border=10)

        button_run = wx.Button(pnl, label='Run', size=(90, 28))
        button_run.Bind(wx.EVT_BUTTON, self.on_run)
        sizer.Add(button_run, pos=(1, 0), border=10)

        self.y_text = wx.StaticText ...
(more)
2021-10-08 09:43:44 -0500 answered a question Can psse diagram display the values in two decimal places?

Yes, under the Diagram dropdown menu, select "Properties". Then under the "Diagram Annotation" tab, there will be a section where you can adjust the decimal precision settings.

2020-01-08 16:37:45 -0500 commented answer Fuzzy font in PSSE v34 slider diagrams

My driver is Intel UHD Graphics 620 version 24.20.100.6286. I'm on Windows 10 Pro 1903 build 18362.535. The slider font is fuzzy with this config, but otherwise it runs fine. It looks like Siemens doesn't recommend Intel drivers beyond 26.20.100.6709. This is shown in the PSSE v35.0.0 release notes

2019-12-06 13:45:33 -0500 received badge  Citizen Patrol (source)
2019-11-26 13:42:09 -0500 answered a question How to add models VTGTPAT and FRQTPAT using psspy?

I used the record function and entered in some random parameters for a VTGDCAT model. Here is the code generated by PSSE:

psspy.add_cctmsco_model(r"""VTGDCAT""",_i,3,[0,0,0],["","",""],4,[0.0,0.0,0.0,0.0])
psspy.change_cctmscomod_con(r"""VTGDCAT""",_i,1, 0.8)
psspy.change_cctmscomod_con(r"""VTGDCAT""",_i,2, 1.2)
psspy.change_cctmscomod_con(r"""VTGDCAT""",_i,3, 1.0)
psspy.change_cctmscomod_con(r"""VTGDCAT""",_i,4, 0.0833)
psspy.change_cctmscomod_icon(r"""VTGDCAT""",_i,2,123456)
psspy.change_cctmscomod_icon(r"""VTGDCAT""",_i,3,1)

I assume you could forgo the "change" APIs if you included the parameters in the "add" arguments.

2019-11-21 13:44:27 -0500 answered a question Where can I download PSSE version 34 for students?

"PSSE Xplore" was a version of PSSE limited to 50 buses, generally intended for students I would think.

I googled PSSE Xplore, and the pages that come up do not link to the software; instead, they lead to an unrelated page on the Siemens web site. I wonder if Siemens discontinued Xplore for some reason, or maybe they took it down temporarily to prepare a new PSSE v35 Xplore.

You could try contacting Siemens at the support email listed on this page: https://new.siemens.com/global/en/pro...

2019-11-18 16:10:16 -0500 received badge  Critic (source)
2019-11-12 15:15:15 -0500 answered a question How to create POLY results file (.pol file)

To run the POLY activity from the GUI:

Power Flow > Linear Network > Interchange Limits with Two Opposing Systems (POLY)

You will need a DFAX file with at least three distinct subsystems to run this analysis. The output of this activity is the .pol file.

2019-10-31 12:59:08 -0500 answered a question Confusion around base kV and PU voltage

A couple comments that probably don't help you at all:

  • It's not good modeling practice to connect buses of different nominal voltages without a transformer
  • As a couple of others have said, this is the nature of the pu system. All calculations are done based on the per unit values, which will all be 1 pu in your case as expected. What you are seeing is expected behavior, and you will need to add a couple 2:1 transformers if you want to see 0.5 pu voltage on your 2 kV bus.

RAW data with transformers to create the 0.5 pu value:

0,   100.00, 33, 0, 1, 60.00     / PSS(R)E-33.11   THU, OCT 31 2019  13:06


     1,'            ',   1.0000,3,   1,   1,   1,1.00000,   0.0000,1.10000,0.90000,1.10000,0.90000
     2,'            ',   2.0000,1,   1,   1,   1,0.50000,  -0.0001,1.10000,0.90000,1.10000,0.90000
     3,'            ',   1.0000,1,   1,   1,   1,1.00000,  -0.0001,1.10000,0.90000,1.10000,0.90000
0 / END OF BUS DATA, BEGIN LOAD DATA
     3,'1 ',1,   1,   1,     1.000,     0.000,     0.000,     0.000,     0.000,     0.000,   1,1,0
0 / END OF LOAD DATA, BEGIN FIXED SHUNT DATA
0 / END OF FIXED SHUNT DATA, BEGIN GENERATOR DATA
     1,'1 ',     1.000,     0.000,  9999.000, -9999.000,1.00000,     0,   100.000, 0.00000E+0, 1.00000E+0, 0.00000E+0, 0.00000E+0,1.00000,1,  100.0,  9999.000, -9999.000,   1,1.0000
0 / END OF GENERATOR DATA, BEGIN BRANCH DATA
0 / END OF BRANCH DATA, BEGIN TRANSFORMER DATA
     2,     1,     0,'1 ',1,1,1, 0.00000E+0, 0.00000E+0,2,'            ',1,   1,1.0000,   0,1.0000,   0,1.0000,   0,1.0000,'            '
 0.00000E+0, 1.00000E-4,   100.00
0.50000,   0.000,   0.000,     0.00,     0.00,     0.00, 0,      0, 1.10000, 0.90000, 1.10000, 0.90000,  33, 0, 0.00000, 0.00000,  0.000
1.00000,   0.000
     2,     3,     0,'1 ',1,1,1, 0.00000E+0, 0.00000E+0,2,'            ',1,   1,1.0000,   0,1.0000,   0,1.0000,   0,1.0000,'            '
 0.00000E+0, 1.00000E-4,   100.00
0.50000,   0.000,   0.000,     0.00,     0.00,     0.00, 0,      0, 1.10000, 0.90000, 1.10000, 0.90000,  33, 0, 0.00000, 0.00000,  0.000
1.00000,   0.000
0 / END OF TRANSFORMER DATA, BEGIN AREA DATA
0 / END OF AREA DATA, BEGIN TWO-TERMINAL DC DATA
0 / END OF TWO-TERMINAL DC DATA, BEGIN VSC DC LINE DATA
0 / END OF VSC DC LINE DATA, BEGIN IMPEDANCE CORRECTION DATA
0 / END OF IMPEDANCE CORRECTION DATA, BEGIN MULTI-TERMINAL DC DATA
0 / END OF MULTI-TERMINAL DC DATA, BEGIN MULTI-SECTION LINE DATA
0 / END OF MULTI-SECTION LINE DATA, BEGIN ZONE DATA
0 / END OF ZONE DATA, BEGIN INTER-AREA TRANSFER DATA
0 / END OF INTER-AREA TRANSFER ...
(more)
2019-10-17 13:45:48 -0500 commented answer Locate generators with 10 busses

Agreed, it is important to recognize the stack limitations in Python. In my case, it was not really a concern for my application, and the recursive code was easier to write up. But if there is the potential for hundreds of recursive function calls, it may not always be appropriate.

2019-10-17 09:13:45 -0500 answered a question Locate generators with 10 busses

I've done something that could help with this. I wanted to export portions of a subtransmission system from one model to use in another model.

I used a recursive DFS method to find buses of a similar or lower voltage level to the POI, stopping at any normally open branches or step-up transformers. I'm quite sure you could adapt this code to fit your needs.

def getBusList(POIs, bus_list):
    for POI in POIs:
        bus_list.append(POI) #add bus to list
        ierr, POI_voltage = psspy.busdat(POI,'BASE') #get source base kV

        n = 0 #for tracking branch the search is on

        #initialize and find first branch from source bus
        ierr = psspy.inibrn(POI, 2)
        ierr, jbus, kbus, ickt = psspy.nxtbrn3(POI)

        while ierr == 0:

            #necessary type conversions
            jbus = int(jbus)
            kbus = int(kbus)
            ickt = str(ickt)

            #search jbus for further branches
            ierr, status = psspy.brnint(POI,jbus,ickt,'STATUS')
            #stop at NOs and don't get duplicate buses
            if (status != 0) & (jbus not in bus_list):
                ierr, branch_voltage = psspy.busdat(jbus,'BASE')
                if POI_voltage >= branch_voltage: #don't go to higher voltage branches
                    getBusList([jbus], bus_list)

            # if there's a 3-winding transformer, search kbus for further branches
            if (kbus != 0) & (kbus not in bus_list):
                ierr, status = psspy.brnint(POI,kbus,ickt,'STATUS')
                #stop at NOs and don't get duplicate buses
                if (status != 0) & (kbus not in bus_list):
                    ierr, branch_voltage = psspy.busdat(kbus,'BASE')
                    if source_voltage >= branch_voltage: #don't go to higher voltage branches
                        getBusList([kbus], bus_list)
2019-10-08 12:43:42 -0500 answered a question Fuzzy font in PSSE v34 slider diagrams

Final Update - An update to PSSE v34.7 from v34.6.1 fixed the issue!

Old Update - it seems to be a video driver issue. If I turn off the "Hardware Acceleration" option under Edit > Preferences > Diagram > Advanced Global Settings, the text becomes sharp again (although all the diagram text is moved to a single spot on the diagram, making it impossible to read).

I will have to work with my IT department to update my video drivers and see if that does the trick...

2019-10-01 17:18:28 -0500 answered a question Reduce the time of dynamic runing

The psspy.psseinit() API initializes an instance of PSSE with the number of buses shown in the parenthesis. So psspy.psseinit(150000) reserves enough memory for a 150,000 bus case. On the other hand, psspy.psseinit(200) only reserves enough memory for a 200 bus case. You can read more about the bus size limits in Section 3.3.1 of the PSSE v33 Program Operation Manual.

I would assume psspy.psseinit(200) would run marginally faster than psspy.psseinit(150000), but that's just a hunch. You'd have to test that for yourself.

2019-09-20 09:49:16 -0500 commented answer Simulating Fault Induced Delayed Voltage Recovery

Sorry, I haven't experienced the same issue. If I do run into that and come up with a solution, I'll be sure to post it here.

2019-09-18 10:17:22 -0500 answered a question Method to collaborate PSS/E with Deep Learning

Seems like an interesting project!

Please see the answer from drsgao in this question: https://psspy.org/psse-help-forum/que...

Does that work for what you're trying to do?

2019-09-16 15:17:23 -0500 commented answer Simulating Fault Induced Delayed Voltage Recovery

One note/correction on the model I posted - for FIDVR studies you will need to enable stalling by lowering the J+97 CON (Tstall) from 9999 to something much smaller. The NERC recommendation is about 0.033.

2019-09-16 13:56:56 -0500 commented answer Simulating Fault Induced Delayed Voltage Recovery

Here is a paper that NERC's Load Modeling Task Force put out: https://www.nerc.com/comm/PC/LoadModelingTaskForceDL/Dynamic%20Load%20Modeling%20Tech%20Ref%202016-11-14%20-%20FINAL.PDF A quick google of CMLD model also showed a bunch of other material. Hope that helps!

2019-09-16 11:20:11 -0500 answered a question Simulating Fault Induced Delayed Voltage Recovery

In my experience (in the USA) the typical model we use for loads which can simulate FIDVR is the CMLDxx composite load model family. If you are dead-set on ACMTBL then I won't be able to help, but if you can use the CMLD model, then I can provide some typical parameters. See the model following my post.

You'll need to update the bus number and load ID. You can adjust the fractions of each motor type at CONS J+18 through J+22. The Motor D stalling parameters begin at CON J+103.

There is an absolute ton of material out there on these CMLD models, and I highly recommend reading some of it to ensure you are using the model as intended.

<bus number> 'USRLOD' <load ID> 'CMLDBLU1'        12    1    0  132   27  146   48

     -1.0000       0.0000      0.40000E-01  0.40000E-01  0.75000    
     0.80000E-01   1.0000       1.0000       1.0000      0.90000    
      1.1000      0.62500E-02   1.0250       1.0400       30.000    
      5.0000       0.0000       0.0000      0.64000E-01  0.94000E-01
     0.50000E-01  0.23300      0.18800       1.0000      0.70000    
     0.50000      -1.0000       2.0000      0.19200       1.0000    
     0.80800       0.0000       2.0000     -0.50001       1.0000    
      1.5000      -1.0000    

      3.0000      0.75000      0.40000E-01   1.8000      0.12000    
     0.10400      0.95000E-01  0.21000E-02  0.10000       0.0000    
     0.70000      0.20000E-01  0.20000       1.0000       99999.    
     0.50000      0.20000E-01  0.70000      0.70000      0.10000    

      3.0000      0.75000      0.30000E-01   1.8000      0.19000    
     0.14000      0.20000      0.26000E-02  0.50000       2.0000    
     0.60000      0.20000E-01  0.20000      0.75000      0.50000E-01
     0.50000      0.20000E-01  0.30000      0.65000      0.50000E-01

      3.0000      0.75000      0.30000E-01   1.8000      0.19000    
     0.14000      0.20000      0.26000E-02  0.10000       2.0000    
     0.65000      0.20000E-01  0.20000       1.0000       9999.0    
     0.50000      0.20000E-01  0.30000      0.65000      0.10000    
      9999.0       0.30000       0.20000E-01   0.50000E-01
      1.0000       0.98000       0.60000       0.10000    
     0.10000        0.0000        0.0000        1.0000    
      6.0000        2.0000        12.000        3.2000    
      11.000        2.5000       0.86000       0.20000    
     0.95000        1.0000       -3.3000       0.50000    
     0.40000       0.60000       0.50000        15.000    
     0.70000        1.9000       0.10000       0.60000    
     0.20000E-01    1.0000        9999.0      /
2019-09-09 09:08:54 -0500 received badge  Famous Question (source)
2019-09-09 09:08:54 -0500 received badge  Notable Question (source)
2019-08-27 02:10:51 -0500 received badge  Popular Question (source)
2019-08-26 13:28:36 -0500 answered a question Use multiple Processor for PSSE Dynamics Run

You may know this already, but Siemens sells a "Parallel Dynamics Module," which I'm sure will fit your needs. There is a 1-month free trial available by the looks of it. I'm sure it's quite expensive after that.

I couldn't tell you if there's a good way of parallelizing a dynamics run with Python.

2019-08-14 16:56:43 -0500 received badge  Organizer (source)
2019-08-14 16:56:10 -0500 asked a question Fuzzy font in PSSE v34 slider diagrams

Hey folks,

Just wondering if there is a way to adjust label font in slider diagrams to make it less blurry. Compared to v33, PSSE v34 makes me feel like I need a new pair of glasses...

2019-08-14 12:00:55 -0500 received badge  Teacher (source)
2019-08-13 16:31:28 -0500 marked best answer Vector groups and two_winding_chng_4

I've got a bit of a head scratcher going on. Basically I want to turn a change some transformer's statuses to 0, which I've attempted to do with the following code:

psspy.two_winding_chng_4(i = bus1, j = bus2, ckt = circuitID, intgar1 = 0)

This code is looped many times for many transformers, and when run, the code gives this error (or similar):

Messages for api TWO_WINDING_CHNG_4
Messages for two-winding transformer circuit "1" from <removed> to <removed>:   (002015)
Error: Vector group "Dyn1" not found; set to "Dyn1"   (002073)

Could anyone tell me why I'm getting this error, or maybe a different way of changing the status of a transformer?

Thanks!