Ask Your Question

jconto's profile - activity

2019-02-14 16:48:40 -0500 commented answer getting latest pssbin location

For a standard PSSe v34 installation, the original code works fine.

2019-02-14 16:45:10 -0500 edited question getting latest pssbin location

I am using the below code to get the latest possible pss version. I have Psse34 trial version installed

def latest_pssbin_location():
    import _winreg
    ptiloc = r"SOFTWARE\PTI"
    ptikey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, ptiloc, 0, _winreg.KEY_ALL_ACCESS)
    ptikeyinfo = _winreg.QueryInfoKey(ptikey)
    numptisubkeys = ptikeyinfo[0]
    vdict = {}
    for i in range(numptisubkeys):
        vernum = _winreg.EnumKey(ptikey, i)
        try:
            n = int(vernum[-2:])
            vdict[n]=vernum
        except:
            pass

    vers = vdict.keys()
    vers.sort()
    k = vers[-1]
    lver = vdict[k]
    lverloc = ptiloc + "\\" + lver + "\\" + "Product Paths"
    lverkey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, lverloc, 0,_winreg.KEY_READ)
    lverdir, stype = _winreg.QueryValueEx(lverkey, 'PsseInstallPath')
    _winreg.CloseKey(ptikey)
    _winreg.CloseKey(lverkey)

    return lverdir+r"\PSSBIN"

I am getting an error "Error 2" the system cannot find the file specified. How to resolve this?

2019-01-30 07:30:10 -0500 answered a question can anyone please provide me model library with a the model parameters.

Check the file savnw.dyr, with models for the savnw.sav case provided in the folder 'Example' in the PSSe installation folder tree. For other small test systems, search this forum for 'IEEE39'.

2019-01-23 11:07:58 -0500 answered a question Complex generation: get the Real par and Imagine part

The function gendat returns a tuple with two entries, an integer ierr and a complex value cmpval. Use the following format (as it appears in the API manual) to 'break' the returned tuple:

ierr, cmpval = psspy.gendat(ibus)
2019-01-22 15:14:21 -0500 answered a question Why aareareal for interchange gives "[None]"?

Use instead of bsys:

ier = psspy.asys(1,1, [70,])
2019-01-21 14:11:28 -0500 edited answer import psspy

At the beggining of the code you need to have something like this :

#import standard libraries
import os, sys
#add psspy to the path
sys.path.append(r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN")
os.environ['PATH'] = (r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN;"
                      + os.environ['PATH'])
sys.path.append(r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27")
os.environ['PATH'] = (r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27;"
                      + os.environ['PATH'])

#imported libraries for psse
import psspy
from psspy import _i
from psspy import _f
from psspy import _s
import redirect

It doesnt necessarily has to look like this, but check your folders and try in every folder related to psse and python til you find the one which contains the psspy. In my case the standard code didnt work in all my computers, but after trying many directories (folders) I was able to make it work everytime.

2019-01-16 20:46:58 -0500 answered a question Help with compiling FORTRAN Models

On your question:"Is there anyway for PSSE 34 to use DLLs compiled for PSSE 33?"

No, Fortran code have to be recompiled into DLL for the PSSE version in which is going to be used.

2019-01-09 06:36:11 -0500 answered a question Error on Dyntools xlsout

Review previous posts on "dyntools". Your code should run outside PSSE. Try:

 MyOUTVRSN = 0    #=0 for old out format; =1 for new outx format
achnf = dyntools.CHNF(outfile,outvrsn=MyOUTVRSN)
2018-12-27 21:48:06 -0500 answered a question How do you get the current working case file name (and path)?

Use psspy.sfiles() to get the loaded sav case in PSSe GUI. Check the API manual for details.

2018-12-22 09:51:51 -0500 answered a question PV and WTG Step Change

An equivalent approach is to change network voltage and/or frequency at the POI (point of interconnection). Use the playback model PLBVFU1 to run such simulations. Check the posting "PLBVFU1 Playback model" for more info, and the PTI manual, Models -> Generator.

2018-12-04 21:14:44 -0500 commented answer Create a dll from a user model i wrote in fortran , PSS/E crashes or does nothing the model supposed to do

You are welcome. On your suggestion, time and knowledge permitted... Your code looks good and I was surprised I did not get an error or crash. I did not get the intention of your UDM code. I recommend to search for PSSe models first before developing UDM code.

2018-12-04 18:02:36 -0500 answered a question Create a dll from a user model i wrote in fortran , PSS/E crashes or does nothing the model supposed to do

I compiled your fortran-77 code in PSS/e v33.12, using the "CREATE USER DLL" tool. This tool is a single-pass to a dll creation. It did create a dll, so no need to use compile and cload4. I added the dyr entry without modification and use it in a run with no disturbance, the dll loaded without error and the run completed.

BTW, you can use the PSSe UVLS model library "LVSHBL" to check load shedding for undervoltages.

2018-12-03 16:02:21 -0500 answered a question psse with python

Go to the internet and or youtube and search for python, GENTJP, PSSe dynamics tutorial, example, etc. Also, get familiar with the python code in the folder "Example", part of the PSSe installation.

The post "IEEE 39 BUS DYNAMIC SIMULATION IN PSSE" has a link to my google site to get a full dynamic data set for the IEEE 39 bus system that uses the GENTPJ model for all generators.

2018-12-03 15:56:03 -0500 answered a question playback event-plbvfu1_V33

Check the post "Example using PLBVFU1 playback generator" for additional info on a demo data set.

Go to the internet and or youtube and search for PSSe dynamics tutorial, example, etc.

2018-11-29 15:40:41 -0500 answered a question User defined model code in different fortran files

The compiling of different pieces of Fortran code is done by the Fortran compiler, which creates *.obj for each piece of code. Break the code into subroutines. The final aggregation of all *.obj or *.lib files (from the PSSe library set) is done by the linker, creating a final dll file. There is no a 'PSS/e compiler''

2018-11-25 10:42:42 -0500 received badge  Favorite Question (source)
2018-11-23 17:42:50 -0500 answered a question CHSB maximum allowed channel reached

Memory allocation are related to bus number dimension. Raise the number of buses in psspy.psseinit(2000) to 50000 up to 200000 in v.34

2018-11-23 17:31:04 -0500 answered a question PLBVFU1 Playback model

It is available since v.33.10, and for versions before that, use the PLBVFU1.dll

Check the post "Example using PLBVFU1 playback generator" for additional info.

2018-11-16 16:05:34 -0500 received badge  Taxonomist
2018-11-14 12:33:35 -0500 edited answer problem with excelpy ,does not save the excels automatically

hi i fixit with

import psspy
import excelpy

x1 = excelpy.workbook()
x1.worksheet_rename('LINEAS', 'Hoja1', overwritesheet=True)
x1.set_active_sheet('LINEAS')

x1.show_alerts(False)
dir(x1)
x1.save('prueba.xlsx')
x1.show_alerts(True)
x1.close()
x1.close_app()
2018-11-13 15:07:01 -0500 edited question problem with excelpy ,does not save the excels automatically

when i use the lib excelpy, does not save the excels automatically when i need to create more than one, even when i only create one.

import psspy
import excelpy

x1 = excelpy.workbook()
x1.worksheet_rename('LINEAS', 'Hoja1', overwritesheet=True)
x1.set_active_sheet('LINEAS')

x1.save('prueba.xlsx')
2018-11-13 15:05:32 -0500 answered a question problem with excelpy ,does not save the excels automatically

I use PSSe v33.12 + Excel 2013 on a Win7 pc. When using the module excelpy with overwritesheet=True, mode='w' I do not have the problem that you experienced. Excel remains in memory (maybe a microsoft thing) but the xls file created is not locked so I can even delete it. I use the following test code:

import excelpy

x1 = excelpy.workbook(overwritesheet=True, mode='w') 
x1.worksheet_rename('LINEAS', 'Sheet1', overwritesheet=True) 
x1.set_active_sheet('LINEAS')
x1.save('prueba.xlsx')
x1.close()
x1.close_app()
print 'done.'
2018-11-12 10:37:16 -0500 answered a question HVdc VSC Power Flow Model

Open the "sample.sav" located at the example folder of the PSSe installation set. It contains 2 VSC lines! More info from the v.33 "Program Application Guide, Vol.2" Chapter "25.10 Voltage Source Converter DC Line Dynamic Model"

2018-11-12 10:28:56 -0500 answered a question Psspy library error for psse34

can you post the code lines up to "import psspy"? Post also the error messages.

If critical files are missing, try re-installing PSSe with/to default parameters and locations.

2018-11-09 20:31:15 -0500 answered a question Prony Analysis

Check the posting "Dynamic simulation in PSSE."

2018-11-09 10:12:46 -0500 answered a question excel.exe process still running after creating pssexcel.accc

I use PSSe v33.12 + Excel 2013 on a Win7 pc. When using the module.function pssexcel.accc with overwritesheet=True, show=True, I do not have the problem that you experienced.
Do you get *.acc data exported to excel?, Could you post your code?

2018-11-08 09:33:26 -0500 commented answer Can someone please share the IEEE 14 bus system data including generator, load, branch, and transformer?

Once on my google site, select and download "solarPV_v33.zip" Check the 'readme' file for hints on how to run a simulation.

2018-11-06 20:13:42 -0500 answered a question Possible to change load MW value during dynamic simulation

Check the post 'dynamic simulation with load change' or search for "load change".

2018-10-30 09:24:01 -0500 answered a question Line closure distribution factor-PSS/E

A good discussion about these linear factors can be found at "https://www.powerworld.com/files/TrainingI11LinearAnalysis.pdf"

does someone have a related python code, besides the "sensitivity_factors.py" posted at the example folder?

2018-10-30 08:58:39 -0500 commented answer Can someone please share the IEEE 14 bus system data including generator, load, branch, and transformer?

PVGUI is listed in Chp. 17, Models manual under Wind generator models. You can check my post "Renewable Plant Modeling - Solar PV - Wind" for a PVGUI data set.

2018-10-29 20:07:39 -0500 commented answer Can someone please share the IEEE 14 bus system data including generator, load, branch, and transformer?

I posted the original IEEE 14 network data for PSSev33 above. I modified the original dispatch & loading to suit better dynamic studies.

2018-10-28 22:03:32 -0500 answered a question Can someone please share the IEEE 14 bus system data including generator, load, branch, and transformer?

See post "can u send dynamic data for IEEE-24 bus and IEEE-30 bus system" to get my version of the IEEE 14 bus system (topology remain, different generation dispatch and loading, more suitable for dynamic studies) .

The original IEEE 14-bus translated from its cdf version is below:

0,   100.00, 33, 0, 1, 60.00     / PSS(R)E-33.12   MON, OCT 29 2018  19:57
 08/19/93 UW ARCHIVE           100.0  1962 W
 IEEE 14 BUS TEST CASE
     1,'BUS 1       ',   0.0000,3,   1,   1,   1,1.06000,   0.0000,1.10000,0.90000,1.10000,0.90000
     2,'BUS 2       ',   0.0000,2,   1,   1,   1,1.04500,  -4.9680,1.10000,0.90000,1.10000,0.90000
     3,'BUS 3       ',   0.0000,2,   1,   1,   1,1.01000, -12.6768,1.10000,0.90000,1.10000,0.90000
     4,'BUS 4       ',   0.0000,1,   1,   1,   1,1.02371, -10.3822,1.10000,0.90000,1.10000,0.90000
     5,'BUS 5       ',   0.0000,1,   1,   1,   1,1.02809,  -8.8636,1.10000,0.90000,1.10000,0.90000
     6,'BUS 6       ',   0.0000,2,   1,   1,   1,1.03854, -14.6164,1.10000,0.90000,1.10000,0.90000
     7,'BUS 7       ',   0.0000,1,   1,   1,   1,1.04612, -13.6563,1.10000,0.90000,1.10000,0.90000
     8,'BUS 8       ',   0.0000,2,   1,   1,   1,1.08508, -13.6563,1.10000,0.90000,1.10000,0.90000
     9,'BUS 9       ',   0.0000,1,   1,   1,   1,1.03491, -15.3593,1.10000,0.90000,1.10000,0.90000
    10,'BUS 10      ',   0.0000,1,   1,   1,   1,1.02799, -15.5332,1.10000,0.90000,1.10000,0.90000
    11,'BUS 11      ',   0.0000,1,   1,   1,   1,1.02970, -15.2202,1.10000,0.90000,1.10000,0.90000
    12,'BUS 12      ',   0.0000,1,   1,   1,   1,1.02405, -15.5147,1.10000,0.90000,1.10000,0.90000
    13,'BUS 13      ',   0.0000,1,   1,   1,   1,1.01992, -15.6089,1.10000,0.90000,1.10000,0.90000
    14,'BUS 14      ',   0.0000,1,   1,   1,   1,1.00994, -16.5202,1.10000,0.90000,1.10000,0.90000
0 / END OF BUS DATA, BEGIN LOAD DATA
     2,'1 ',1,   1,   1,    21.700,    12.700,     0.000,     0.000,     0.000,     0.000,   1,1,0
     3,'1 ',1,   1,   1,    94.200,    19.000,     0.000,     0.000,     0.000,     0.000,   1,1,0
     4,'1 ',1,   1,   1,    47.800,    -3.900,     0.000,     0.000,     0.000,     0.000,   1,1,0
     5,'1 ',1,   1,   1,     7.600,     1.600,     0.000,     0.000,     0.000,     0.000,   1,1,0
     6,'1 ',1,   1,   1,    11.200,     7.500,     0.000,     0.000,     0.000,     0.000,   1,1,0
     9,'1 ',1,   1,   1,    29.500,    16.600,     0.000,     0.000,     0.000,     0.000,   1,1 ...
(more)
2018-10-24 12:17:11 -0500 answered a question Problems running large number of simulations using same raw and dyr file

Some ideas:

Do not mix running simulation with plotting. Use a second script (or loop) to perform the plotting. Plotting within a loop, if not coded properly, is known to eat memory.

Run the code outside PSSe GUI. Increase bus allocation to its max. -> psspy.psseinit(buses=200000).

Minimize commands within the main loop. save the case after:

ierr = psspy.tysl(0) #solving the converted case
ierr = psspy.sav('case_cnv.sav')   #as example

save a snap file after defining the channels:

       ierr = psspy.bus_frequency_channel([-1, bus])
ierr = psspy.snap([-1,-1,-1,-1,-1],'case.snp')   #as example

and move all that code before the main loop, since it does not change per iteration. Within the loop, load the converted case and load the snp file. This way previous memory allocation and temporary files in the background may be deleted.

2018-10-19 11:13:52 -0500 edited answer HOW TO CALCULATE FVSI FROM DYNAMIC SIMULATION

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.

2018-10-17 10:39:55 -0500 answered a question Short Circuit Current Use psse dynamic simulation and IEC module (psse34)

Simulation of the type 3, type 4 wind generator or PV short circuit current using psse dynamic simulation is just the same as testing a fault at the point-of-interconnection of the renewable plant. All inverter-based generation resources (type 3, type 4, PV plants) will limit the current output to just over 1 p.u. during faults (or short-circuits). Search the net for "model wind plants with PSSe" or "second generation of wind turbine models" Visit my google drive site and download rewind.zip and solarPVv33.zip, PSSe demo dynamic data set.

The short-circuit test under IEC60909 is done using the PSSe fault analysis tool with additional sequence network data (not a dynamic simulation.) Search the net for "PSSe IEC60909"

2018-10-12 16:20:55 -0500 commented answer I have the following problem

Error on second line: Generation dispatch subsystem is not defined (000031) ACCC_WITH_DSP_3 requires a "Label" parameter defined as the name of the generation dispatch subsystem (blank by default, no default allowed if OPTACC(10) is not 0). The outcome was that the *.acc was not created.

2018-10-12 15:57:09 -0500 edited answer I have the following problem

This is the complete code

Messages for api ACCC_WITH_DSP_3
 Generation dispatch subsystem is not defined   (000031)

Traceback (most recent call last):
  File "C:\\0-Simulaciones\0-FC\ACCC_1.py", line 95, in <module>
    baseflowvio, basevoltvio, flowlimit, flowchange, voltchange)
  File ".\pssexcel.py", line 1167, in accc
  File ".\pssarrays.py", line 1303, in accc_summary
  File ".\pssarrays.py", line 1223, in _accc_size
  File ".\pssarrays.py", line 954, in _check_file
  File ".\pssarrays.py", line 662, in _ShowError
RuntimeError:  InputError -->  ACCC output file C:\0-Simulaciones\0-FC\CA_MAXMAR19_Intgr-T_NS_M_G_200\CA_MAXMAR19_Intgr-T_NS_M_G_200.acc does not exist.
Couldn't open Python file:C:\0-JJ\0-Simulaciones\H-E_MG_=PNNL\02-Simu\0-FC\ACCC_1.py
2018-10-12 09:21:29 -0500 answered a question what's the difference between using REGCAU1 series and WT3G(WT4G) series ?

The second generation of renewable plant models shall be used instead of outdated first generation models.
Search the net for "second generation of wind plant models" and "nerc acceptable model list".

2018-10-11 18:43:18 -0500 answered a question I have the following problem

Not enough information! Show the full error messages. Can you post the full code?

'pssexcel.py' requires the file 'excelpy.pyc' which might not be in your system. Check this forum for it, if so.

2018-10-11 18:24:35 -0500 edited question I have the following problem

I have the following problem

Traceback (most recent call last):
  File "C:\0-Simulaciones\02-Simu\0-FC\ACCC_1.py", line 95, in <module>
    baseflowvio, basevoltvio, flowlimit, flowchange, voltchange)
  File ".\pssexcel.py", line 1167, in accc
  File ".\pssarrays.py", line 1303, in accc_summary
  File ".\pssarrays.py", line 1223, in _accc_size
  File ".\pssarrays.py", line 954, in _check_file
  File ".\pssarrays.py", line 662, in _ShowError
2018-10-08 14:01:40 -0500 commented answer vref dynamic disturbance for REECA1

I have confirmed that erun, a test of the excitation system on conventional machines, does NOT work on wind machine second generation models, (updated my answer above)

2018-10-07 10:25:18 -0500 answered a question vref dynamic disturbance for REECA1

Check if the machine is modeled as a wind machine in the load flow case. REECA1 shall be modeled together with REGA1. PSSe has a test named ERUN, a step voltage change test, but it does not work on machines defined as wind's. You can use the playback model PLBVFU1 to simulate a drop (or increase in terminal voltage at the POI of the wind plant. A sample content of the *.plb follows, 1.03 V pu is V at the POI bus before test is done:

 time,   V,   F
4.999,1.03,60
5.0  ,0.95,60
25.0 ,0.95,60
2018-10-06 11:02:44 -0500 commented answer Can anyone please give me an Example Governor Model?

I cannot access your google drive. No need to sync generator parameters with governor parameters. Inertia of generator does not change with generation dispatch. Use the ieee39 test system to perform frequency response tests. Search the net for frequency response studies.