Ask Your Question

haveityourwa's profile - activity

2022-05-09 20:49:08 -0500 answered a question PSS/E User-written misc. model crashes

Hey I am not sure if this is the cause of the crash, and I know that this is 2 years after you posted the question but I found that in order to Call certain commands within FORTRAN I needed to enter the PFMODE and then run it and then re enter the DSMODE, otherwise the simulation would crash before the next timestep. Like so

CALL PFMODE(IERR)
CALL BRANCH_CHNG(222, 333, '1', INTGAR, REALAR, IERR)
CALL DSMODE(FALSE, IERR)

This may be worth looking into for others who are having a similar issue. I think it is likely that anything that uses Chapter 2 Power Flow Data commands within the FORTRAN code would likely need to be called this way. I believe that the reason why it works when you run the simulation to the time at which the trip will occur is that, when it pauses the simulation it enters the PFMODE and when you start running to the next simulation time by using the RUN command it re enteres DSMODE, I need to confirm this in the documentation though.

2020-03-23 20:11:30 -0500 received badge  Famous Question (source)
2019-08-29 12:02:57 -0500 received badge  Famous Question (source)
2019-08-28 21:46:32 -0500 commented answer Dynamic Model Creation

Cheers, found your drive link with the uexc_tutorial.

2019-08-28 20:25:39 -0500 received badge  Notable Question (source)
2019-08-28 16:30:48 -0500 received badge  Popular Question (source)
2019-08-27 20:17:25 -0500 asked a question Dynamic Model Creation

Hey, I understand this is not specifcally a Python PSSE question. But can someone point me in the direction of how to write a basic user written model for PSSE. I have been wanting to do this for a while but have not found any good information on how to do so. Cheers

2019-08-27 03:08:37 -0500 received badge  Famous Question (source)
2019-07-30 07:52:18 -0500 received badge  Famous Question (source)
2019-06-27 20:40:55 -0500 received badge  Popular Question (source)
2019-06-27 20:40:55 -0500 received badge  Notable Question (source)
2019-06-24 01:33:59 -0500 asked a question What does PSSE do around resonance?

Hey, Not sure if the issue I am seeing is due to resonance or something else however when running a frequency sweep on a model (change the impedance in each solution in order to study a different frequency) when approaching a resonance it appears that PSSE takes a busses voltage to 0pu at some point. I have actually tried this with a few different powerflow programs, pandapower and even powerworld and they all seem to have the same issue (not sure if it is an issue or simply core to how the Power Flow solution works). image description

The system is simply a 2 bus system with a slack at 1pu voltage. A single line of R,X pu of 0.0833,0.311000 at 50Hz (0.0833,3.732@600Hz). And a single fixed shunt 1.5Mvar at 50Hz(18 @600Hz) Like So. image description

Any information on this would be appreciated, can't upload files yet otherwise I would put up the raw files.

Cheers,

Anthony

2019-03-25 10:22:05 -0500 received badge  Famous Question (source)
2019-01-23 03:55:44 -0500 received badge  Notable Question (source)
2019-01-11 09:18:43 -0500 received badge  Popular Question (source)
2019-01-09 22:12:27 -0500 commented answer Error on Dyntools xlsout

Hey I was running outside of PSSE, turns out my PYWIN32 library was having some issues. Thanks for this though didn't know that you could set the out version inside dyntools. Unsure what I should mark as the answer.

2019-01-08 21:20:48 -0500 asked a question Error on Dyntools xlsout

Hey Guys, Have been trying to work on my process for extracting files into excel from PSSE. However after some time unsure if my installation is corrupt or what however I am now getting this error.

Traceback (most recent call last):
  File "C:/Dropbox/Power System Services/Scripts/New folder/PYTHON/2.7/PSSE Python Scripts/PSSE/General/DynDataExtractorBenchmarkingTeebar.py", line 129, in <module>
    achnf.xlsout(channels=signals, show=False, xlsfile=(PathDir + "\\sheets\\" + "Case_" + str(i+1) + '_2.xlsx'), outfile='', sheet ='', overwritesheet=True);
  File ".\dyntools.py", line 1084, in xlsout
  File ".\dyntools.py", line 428, in _xls_export
  File ".\excelpy.py", line 168, in <module>
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
    import gencache
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 662, in <module>
    __init__()
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 56, in __init__
    _LoadDicts()
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 111, in _LoadDicts
    clsidToTypelib = p.load()
ValueError: insecure string pickle

Process finished with exit code 1

While working on one script it has now broken all of my scripts where this function(below) is used.

 achnf = dyntools.CHNF(outfile);
 achnf.xlsout(channels=signals, show=False, xlsfile=excel_file, outfile='', sheet ='', overwritesheet=True);

Have tried re installing PSSE V34 Excel python

Any help would be appreciated

2018-12-02 23:20:04 -0500 received badge  Notable Question (source)
2018-11-30 19:29:34 -0500 received badge  Famous Question (source)
2018-11-01 15:19:11 -0500 received badge  Notable Question (source)
2018-10-21 09:03:07 -0500 received badge  Notable Question (source)
2018-10-19 09:23:08 -0500 received badge  Popular Question (source)
2018-10-19 00:55:53 -0500 commented answer How to add multiple seq files to a project

Thanks!!!!

2018-10-18 23:20:54 -0500 commented answer How to add multiple seq files to a project

I don't know what IC is, what do you mean by IC set to 0/1 ? Thanks for the response

2018-10-18 18:34:50 -0500 asked a question How to add multiple seq files to a project

Hey, Have a few sequence files that share part of the data of one Raw file, is there anyway to add them easily together without creating a single .seq file beforehand. Cheers

2018-10-04 04:23:18 -0500 received badge  Popular Question (source)
2018-09-19 21:51:59 -0500 received badge  Popular Question (source)
2018-09-14 01:29:14 -0500 commented answer Request, Online Tap Changer Example

Thanks, I thought this was the case, but have been unable to get this to work in practice. I guess I will continue trying. Thanks for the clarification on the delays.

2018-09-14 00:41:52 -0500 marked best answer Simulation Crash at Fault Creation

Hey, I am running a series of test on a SMIB and have noticed that some simulations with a fault at the POC that bring the voltage to around 0.05 pu cause the simulation to crash. I was curious if there was a way to ensure this does not happen, or if I simply am doing something wrong. Cheers

2018-09-14 00:27:52 -0500 asked a question Request, Online Tap Changer Example

Hey Guys, I was wondering if someone had an example of how the OLTC1T works. This is what I have entered into a dyr file.

108,'OLTC1T', 107 ,  1,20,0,2.5/

From what I understand from the documentation this will control the transformer from bus 108 to 107. This will have a CID of 1 and from page 814 in the models.pdf it will have a time delay of 20, a time constant of 0 and a subsequent time before tap signals is sent of 2.5.

However I am not sure what voltage it is controlling to?

Also I am unsure as to what these delays actually mean.

Ultimately I would like to use this model in order to change the tap every timestep (I know this may sound silly) after a certain period of time.

Any Help would be appreciated. Cheers

2018-09-12 22:08:39 -0500 asked a question Query About Codemeter PSSEV34

Hey, I've noticed that depending on the version of codemeter I use it can take between 0.2s and 27s to initialise V34.2 PSSE. Has anyone else encountered this sort of an issue when updating CodeMeter. Cheers, (If I should post this as an edit to my previous question let me know)

2018-09-02 21:21:06 -0500 received badge  Famous Question (source)
2018-08-31 01:58:33 -0500 received badge  Notable Question (source)
2018-08-31 00:16:47 -0500 received badge  Popular Question (source)
2018-08-28 22:23:40 -0500 received badge  Famous Question (source)
2018-08-28 20:16:09 -0500 asked a question Shunt Modelling Inside PSSE

Hey guys,

Propbably a total lack of looking.

But if someone could point me into the direction of the way shunts a modelled inside PSSE so that I can create an equivalent in my case specifically inside PSCAD.

Cheers

2018-08-22 18:03:21 -0500 received badge  Citizen Patrol (source)
2018-08-20 22:34:10 -0500 commented question Multi-Threading using xlsout

Hey Juan, I just posted an answer to your question. If you have some example code if you could add it to that question I would be happy to have a look at it.

2018-08-20 22:33:03 -0500 marked best answer Multi-Threading using xlsout

Hey Guys, Long story short I am trying to extract results into excel quicker and am trying to multi-thread this process. However it seems that even though the multi-thread side of things works within my script only 1 file will properly extract and the rest will just be empty workbooks.

 Process Process-54:
Traceback (most recent call last):
  File "C:\Python27\lib\multiprocessing\process.py", line 267, in _bootstrap
    self.run()
  File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Dropbox\Power System Services\Scripts\New folder\PYTHON\2.7\PSSE Python Scripts\PSSE\PSSE_MAT\DynDataExtractorMATMulti.py", line 179, in run_data_extract
    outfile=outfile1, sheet='', overwritesheet=True);
  File ".\dyntools.py", line 1084, in xlsout
  File ".\dyntools.py", line 428, in _xls_export
  File ".\excelpy.py", line 168, in <module>
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
    import gencache
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 662, in <module>
    __init__()
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 56, in __init__
    _LoadDicts()
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 109, in _LoadDicts
    version = p.load()
EOFError

This is the error code that comes out. This is essentially the only line of the code which is causing these errors.

dyntools.CHNF(outfile1).xlsout(channels=signals, show=False, xlsfile=(PathDir + "\\sheets\\" + filename + str(fileNumber) + '.xlsx'),
                 outfile='', sheet='', overwritesheet=True);

Note this code works as intended if I reduce the thread count to 1 however that sort of defeats the point. Cheers

EDIT Thanks for the response EBahr. - I implemented your method of multi-threading the process and still recieving an error once I increase from 1 thread to any other number.

Traceback (most recent call last):
  File "C:/Dropbox/Power System Services/Scripts/New folder/PYTHON/2.7/PSSE Python Scripts/PSSE/PSSE_MAT/ExtractionPSSE.py", line 137, in <module>
    main()
  File "C:/Dropbox/Power System Services/Scripts/New folder/PYTHON/2.7/PSSE Python Scripts/PSSE/PSSE_MAT/ExtractionPSSE.py", line 115, in main
    results = out_pool.map(build_xls, processes)
  File "C:\Python27\lib\multiprocessing\pool.py", line 253, in map
    return self.map_async(func, iterable, chunksize).get()
  File "C:\Python27\lib\multiprocessing\pool.py", line 572, in get
    raise self._value
pywintypes.com_error: (-2147418111, 'Call was rejected by callee.', None, None)

Below is my implementation it simply requires a set of Out files named like so. (Please excuse my lack of structure :/) Results_0.out

Results_1.out

Results_2.out

Results_3.out

import sys
import os
import shutil
import Tkinter, tkFileDialog
import ntpath
import csv
import time
import multiprocessing
from multiprocessing import Pool as ThreadPool
import math
PSSE33BINPATH = r"C:/Program Files (x86)/PTI/PSSEUniversity33/pssbin;C:/Program Files (x86)/PTI/PSSEUniversity33/psslib;"

def main():

    # Prompt user for input

    root = Tkinter.Tk()
    root.withdraw()

    resultType = "Teebar"

    dirname = tkFileDialog.askopenfilename(parent=root, initialdir="/",
                                        title='Please select a _0.out File')
    PathDir = os.path.dirname(dirname)
    PathDir = os.path.abspath(os.path.join(PathDir, os.pardir))

    if not ...
(more)
2018-08-20 22:33:01 -0500 commented answer Multi-Threading using xlsout

Hey The delay seems to add the stability and stop the errors from occuring thanks for helping with this, also the code from Ebahr and yourself has helped increase my understanding of the multiprocessing library.