Ask Your Question

jconto's profile - activity

2019-07-16 15:35:54 -0500 answered a question Move buses in slider diagrams

for small number of buses, this code creates a slider within PSSe, though it does not set the proper X,Y coordinates:

#slider3.py
'''
Load a case (bus numbering assumes savnw.sav is loaded)
Open a new (blank) diagram
run this code 
'''
def DrawBusesSLD(buslist):
    n_buses=len(buslist)
    buses=[]
    for i in range(n_buses):
        buses.append(buslist[i][0])

    for i in range(n_buses):
        psspy.growbus(buslist[i][0],buslist[i][1], buslist[i][2])

# main:
busdata=[
         [203, 0, 0],
         [204, 2, 0],         #not drawn due to being a dummy bus in a multisection line
         [205, 2, 2],      
         [206, 0, 2]
        ]

DrawBusesSLD(busdata)
2019-07-13 17:23:32 -0500 answered a question Differences between the Environment Manager and Visual Studio 2017

Same issue. Using v.33.12.1 and with already tested data, the compile.bat + cload4.bat files process did not create a dll while using the environment manager, it did. Once the ddl file was created, the simulation run OK. But both methods worked OK when using v.33.10!!!

I will let PTI explain why this is happening.

2019-07-10 14:52:45 -0500 answered a question In PV analysis what exactly is meant by incremental MW transfer. Is it general load increase in sink through increase in 'lambda' or the equivalent load at every bus considered for monitoring?

is the load in the sink. After the sink load is incremented, a load flow solution will set the total output of the generation in the source, while the swing generator would take care of the losses. Now the base case is in a more loaded state. At his point contingencies are applied, load flow solved and monitored buses would have their voltage recorded. The process repeats until the source reached its maximum capacity to export power or the load flow does not solve, signaling that a potential voltage collapse has been uncovered. PSSE migth use linear factors techniques to accelerate computations of each contingency.

2019-06-23 20:53:53 -0500 edited question how to export ANSI values to txt

I need to calculate a lot of fault level cases, so is there any way to export the output bar ANSI results into a txt or ideally csv file.

Currently I am using the syntax below

recdFN=r"recd.recd"

psspy.alert_output(2,recdFN,[0,0])
psspy.progress_output(2,recdFN,[0,0])
psspy.prompt_output(2,recdFN,[0,0])

Filelist = ['a.sav','b.sav']

for i in Filelist:
    psspy.case(i)
    psspy.ansi_3([0,0,0,4,0],[ 40.0, 80.0, 40.0, 80.0],1,[45110],[0],[ 1.0],[ 0.02],"")

the output recd file only includes the progress message but no ANSI_3 output message we can see on the screen.

2019-06-23 20:04:35 -0500 answered a question For the CLOD model, what is the reference size for the Large and Small Motors?

From the Application Guide Vol.2,

"21.2.3.1 CLOD Type Models (CLODBL, CLODOW, CLODZN, CLODAR, CLODAL) ...It is intended for use in situations where it is desirable to represent loads at the dynamic level, as distinct from the algebraic characteristic level used in power flow, but where detailed dynamics data is not available...."

The 'internal' motors modeled by CLOD have H=1 and H=0.6 for large and small motors. I would define "large motors" as industrial motors, while "small motors" be the rest.

Keep in mind that a modern model is the composite load model CMLDxx.

2019-06-23 18:36:05 -0500 answered a question How to incorporate economic load dispatch information in PV analysis

PV engines are not set to trigger economic dispatch tools to assign generation dispatch at different transfer levels. If a PV study is coded in python, then any dispatch criteria is possible.

Only generation set to participate in scaling will be scaled, other generation will not move (not participate in counter-balancing the increase in load) The scaling criteria of generation is set by the PV engine, usually proportional to available spinning or to Pmax, and the swing generator will cover losses.

2019-06-23 09:54:23 -0500 answered a question Will PSSE 34 support Python3?

Yes, it does, but only python v.3.4 The PSSe v.34 installs python 2.7 by default. Once python v3.4 is installed, edit the PSSe link by opening its "properties" option (right-click in link icon) and update the "target" string to:

"C:\Program Files (x86)\PTI\PSSE34\PSSBIN\psse34.exe" -gohome
to
"C:\Program Files (x86)\PTI\PSSE34\PSSBIN\psse34.exe" -pyver 34
2019-06-23 09:32:30 -0500 answered a question Cannot import dyntools

The code looks OK. Dyntools runs outside the PSSe GUI, in a DOS windows. On a default PSSe installation, I start with:

import psse34
import psspy
import dyntools

Also check if the next code requires psspy, it has to go after importing psspy:

import initialize_mute as mt    # mute all psse outputs

Now, if the error persist, try re-installing PSSe.

2019-06-23 09:18:10 -0500 edited question Cannot import dyntools

Recently I start to use Python instead of MATLAB. However, there is a lot of problems. I try to run python scripts, but it seems that there is something wrong with import dyntools. Code:

from __future__ import division

import os, sys, math, csv, time
PSSPY_location = r'C:\Program Files (x86)\PTI\PSSE34\PSSPY27'
PSSE_location = r'C:\Program Files (x86)\PTI\PSSE34\PSSBIN'
sys.path.append(PSSPY_location)
os.environ['PATH'] += ';' + PSSPY_location
os.environ['PATH'] += ';' + PSSE_location

import socket
import struct
import numpy, copy

import initialize_mute as mt    # mute all psse outputs
# import psse34
import dyntools
import psspy
import redirect

Report:
    import dyntools
  File ".\dyntools.py", line 51, in <module>
ImportError: No module named pssevrsn

Process finished with exit code 1
2019-06-13 19:08:23 -0500 commented answer PSSE 31 format

Can you expand about the goal of your project. It seems you are comparing raw files (v.30 vs. v.31?) to create input data from a raw v.31 for another program (not PSSe). BTW, I use v.33

2019-06-12 10:31:57 -0500 commented answer PSSE 31 format

Yes, the fixed shunt data per bus has been moved to its own data block, after the load data block. The file savnw.raw at the "example" folder of the PSSe installation directory shows the data block structure for v.31

2019-06-10 20:31:07 -0500 answered a question PSSE 31 format

can you post some of the inconsistencies between the manual (version 31.0) and the data in the raw file?

2019-06-10 20:28:23 -0500 answered a question Is it possible to merge to .dll files in just one ?

No, *.dll files cannot be 'merged' into a single one. Using python to drive the simulation, I load them everytime in a "for" loop by detecting all files with extension .dll within a specific folder ("dlls")

2019-05-20 23:17:22 -0500 answered a question How to perform transient stability for HVDC

if step 4 includes simulation of a fault, clearing of such fault and continuing the simulation without fault, then you are set, else add such steps.

2019-05-20 13:56:11 -0500 answered a question ERROR in compiling dynamic library

Compiled UDM code (ob, lib, dll) have to be recompiled for the PSSE version in which is going to be used. Ask the source of the lib in v.32 to provide a new one for v.34

2019-05-14 22:36:17 -0500 commented answer converting ps file to pdf

what is the ImageMagick (using ImageMagick-7.0.8-Q16) command line to convert aa.ps to aa.pdf?

2019-05-14 12:03:10 -0500 commented answer converting ps file to pdf

Distiller comes with Adobe Acrobat Standard or the Pro version.

2019-05-10 11:18:12 -0500 answered a question Dyntools Overwrite Excel Sheet

In v.33.12, the overwritesheet setting works as expected. The following is the code I used:

   try: 
     chnfobj.xlsout(channels=mychannels, 
                    outfile=filei,
                    xlsfile=XLSfile,
                    sheet=sheetname,
                    overwritesheet = True,
                    show=False 
                    )
   except:
     print '\n ERROR: Exporting Channels to %s Excel file, sheet %s failed.'%(XLSfile,sheetname)
2019-05-07 14:38:11 -0500 answered a question How to output in a readable format the monitoring in PSS/E

Check the python code "dyntools_demo.py" located in the "example" folder, to extract (all or selected) channels in an *.out file. To get a description of the functions available in "dyntools.pyc", run the following code:

#display help in module dyntools.pyc
import psse33
import dyntools
help(dyntools)
2019-05-05 09:14:09 -0500 answered a question psse.lib file not found

In my v.34 setup, there is no psse.lib file [but I found a psseng.lib in the psslib folder]

2019-05-01 16:10:11 -0500 answered a question Pink SLD contents

The 'pink' sld is shown when values (like voltages or flows) in the sld are not know. Solve the powerflow to update those values.
New network elements added would be in pink (or not represented) until values and topology issues are resolved.

2019-05-01 16:08:18 -0500 commented answer How can you interpret a .acc file from PSSE and extract useful data? I have a .acc file and it has a lot weird characters:

These violation conditions are set in the monitor file (*.mon) used to create the *.dfx file, which is use in creating the *.acc files. Review the *.mon file and run again the ACCC as needed.

2019-04-30 19:49:18 -0500 answered a question converting ps file to pdf

ps2pdf has been reported as problematic under windows.
One other method is to use Distiller, an application that comes with Adobe Acrobat Standard or the Pro version. PSSPLT creates the *.ps file and distiller grab the ps filename to create a pdf file. You can set watch folders that when a ps file 'arrives' (save folder used by PSSPLT), it gets converted to pdf automatically, avoiding user intervention. Additional code would move the pdf files to the final folder destination. Distiller can also run from the command line, therefore it can be called by the same application that called PSSPLT, and convert the ps file to pdf as part of a loop process.

A second option is to use python to extract data from the *.out files and plot them using matplotlib, saving the picture to pdf format. The user will have to set/deal with plotting options such as titles, legends, curves per plot, plots per page, etc. "Channels" is a tool that will create pdf for selected channels set by the user. Search for channels in this forum for downloading.

2019-04-30 19:20:21 -0500 answered a question How can you interpret a .acc file from PSSE and extract useful data? I have a .acc file and it has a lot weird characters:

The *.acc file is a binary file and to extract its content its better to use API functions like acccsummary or acccsolution. Search the API document for "ACCC" to get what is being offered.

What data is not being reported by pssexcel.pyc or pssarrays.pyc? What kind of output data are you looking for?

2019-04-25 21:45:09 -0500 answered a question Is there any way to convert a .sav to .xlxs using psspy?

On the first question, There is not a function that would extract all the network data to xls format (or csv).

A potential scripted workaround:

Having a *.sav, create a *.raw file (same network data, but in text format) Then, use python code to parse the different block of data into separate files, saving each data block in *.csv format. For multiple *.sav cases, put the above process within a "for-loop"

2019-04-25 21:09:48 -0500 answered a question How to set a custom value of the .sav file using psspy

Check the post "How to modify an existing case data?"

Changing one variable (or multiple) using the recording feature in PSSe will let you know what is the right function to use to execute such change and how to use default value variables (_i, _f,_s) to represent those variables that do not need to be changed. Since the recording creates a python code, open such file and re-use it in your code.

2019-04-25 06:55:38 -0500 commented answer Can you work around PSSe crashing on some events?

The "commandxx" represents the specific psspy function (like "run", to execute a dynamic run) that could cause a crash. The "except" block will handle any error caused in the execution of such function.

2019-04-23 07:39:27 -0500 answered a question Question about NEVA eigenvalue analysis

It looks this is a question for PTI Customer Support.

2019-04-11 18:17:51 -0500 edited question How to see the effect of wind variation on power system

I am trying to see the effect of wind variation on the power system but could not see any change in system response with change in any parameter of the wind machine. I have used WT3E1, WT3T1 or WT3G1 in my power system. Is there any way to see this. Someone suggested me to model the wind machine as negative load and change the value stochastically. Is this the only way to see the stochastic variation of wind in the system in PSSe and if yes then how to do that either in GUI or python. Thank you in advance for your help.

I am adding python code to change Paero variable of the WT3T1 VAR(L+4) but still there is no effect from wind plant side

psspy.read(0,r"""C:\Users\admin\xxxxxxxx\NE with wind.raw""")
psspy.dyre_new([1,1,1,1],r"""C:\Users\admin\xxxxxxx\NE with wind.dyr""","","","")
psspy.nsol([0,0,0,1,1,0,-1])
psspy.cong(0)
psspy.conl(0,1,1,[0,0],[0.0,0.0,0.0,0.0])
psspy.conl(0,1,2,[0,0],[0.0,0.0,0.0,0.0])
psspy.conl(0,1,3,[0,0],[0.0,0.0,0.0,0.0])
psspy.chsb(0,1,[-1,-1,-1,1,2,0])
psspy.chsb(0,1,[-1,-1,-1,1,7,0])
psspy.chsb(0,1,[-1,-1,-1,1,15,0])
psspy.strt_2([1,0],r"""C:\Users\admin\xxxxxxxx\wind_spd_Change1.out""")
psspy.run(1, 1.5,0,0,0)
psspy.change_wnmod_var(1,r"""1""",r"""WT3T1""",5, 150.0)  # change wind plant initial output to 150
psspy.run(1, 3.5,0,0,0)
psspy.change_wnmod_var(1,r"""1""",r"""WT3T1""",5, 300.0)  # change wind plant initial output to 300
psspy.run(1, 5.0,0,0,0)
psspy.change_wnmod_var(1,r"""1""",r"""WT3T1""",5, 200.0)  # change wind plant initial output to 200
psspy.run(1, 9.5,0,0,0)
2019-04-11 05:30:51 -0500 received badge  Nice Answer (source)
2019-04-10 19:06:54 -0500 edited question i got error when i click "export to excel" in .out file

I am using PSS / E32 version. I run dynamic simulation, get OUT file, and then use OUT file to "export to excel" in graph file of OUT file. Please help me this error

I think I have an error because I have a lot of python version

Traceback (most recent call last):
  File ".\dyntools.py", line 1983, in _xlsout
  File ".\dyntools.py", line 1074, in xlsout
  File ".\dyntools.py", line 435, in _xls_export
  File ".\excelpy.py", line 1870, in workbook
  File ".\excelpy.py", line 180, in __init__

  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line 536, in EnsureDispatch
    mod = EnsureModule(tla[0], tla[1], tla[3], tla[4], bForDemand=bForDemand)
  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line 449, in EnsureModule
    if module.MinorVersion != tlbAttributes[4] or genpy.makepy_version != module.makepy_version:

AttributeError: 'module' object has no attribute 'MinorVersion
2019-04-08 12:29:21 -0500 edited answer Dynamic data for IEEE 9 bus

The following link will takes you to my google drive public folder "PowerSystem", which contains the IEEE9, IEEE14, IEEE39 and IEEE59 systems: https://drive.google.com/open?id=0B7u... Click on a zip file icon, and then click on the downloading icon on top.

I added governors and pss models to the IEEE9 data set latest version with scripts and log files. Adjust the path for filenames in the scripts for your case.

2019-04-05 13:57:38 -0500 answered a question time steps in dynamic simulation.

if using the playback model "PLBVFU1" , check the post "Example using PLBVFU1 playback generator" for additional info.

In a playback run, the time step of the input signal may be different that the one used for the simulation (usually 1/4 of a cycle = 0.004166) The value given, 0.03 sec is seven times larger than 0.004166!! Try a run with the default time step.

2019-04-04 16:40:16 -0500 answered a question Is there any chance to shut down the output of OPF?

What "IDE console" are you using?

If you can run in a DOS window and execute OPF runs from the line command then all output will be suppressed (going to the NUL device) with the following:

c:\..\>psse33 abc def > nul
2019-04-03 13:44:09 -0500 commented answer user-defined

So you have a Fortran compiler, right? can you describe the step that you follow to create a *.dll file? run the tool "Create User DLL" in the PSSe folder. Check the window in the background listing the paths of psse, intel fortran and visual studio. Post the error message.

2019-04-02 15:02:17 -0500 answered a question black start in PSS/E

There is no model for black start because it is not a model but a process. A generator machine is started at minimum loading, then let it pick up more load (or a small network). Do the same for a second machine. Now joint both networks making sure that after closing the switch (synchronization!), all machines remain stable.

2019-04-02 14:50:52 -0500 answered a question user-defined

What kind of errors does PSSe issue?

Phyton comes with PSSe so there is no need to "install it".

If the user-defined model is in *.dll format, there is no need to compile it, otherwise a Fortran compiler is required.

To test that your PSSe setup is OK to create UDMs, search for "User defined models" in the forum and then download the data set to simulate an exciter UDM (example from chapter "Model Writing", in POM manual).

2019-04-01 20:56:01 -0500 answered a question Changing the parameter of generators during dynamic simulation

Read the dyre file first and then make the change to H

psspy.dyre_new([1,1,1,1],dyrfile)
psspy.change_plmod_con(5,r"""03""",r"""GENTPJ1""",5, 8)
...

What test was applied?

Also, line 2 may not be needed.

2019-04-01 20:42:54 -0500 edited question Changing the parameter of generators during dynamic simulation

Hi everyone. I have a question about changing the parameter during the dynamic simulation, I run this code:

psspy.bsys(sid=2, numbus=1, buses=1)                     
psspy.addmodellibrary('C:\Program Files (x86)\PTI\PSSEXplore34')
psspy.change_plmod_con(5,r"""03""",r"""GENTPJ1""",5, 8)
psspy.change_plmod_con(6,r"""04""",r"""GENTPJ1""",5, 10)
psspy.dyre_new([1,1,1,1],dyrfile)

I try to change the parameter H for gentpj at bus 5 and 6. but the results are not different from the before. Can anyone help me with that?

2019-04-01 08:48:39 -0500 answered a question Regarding interruptible load modelling in PSS/E

Add a frequency relay model to simulate shedding the load due to frequency drop. Use a model in the group "LDSHxx" (xx =BL, ZN...) to model such load behavior to frequency.

2019-03-31 14:56:18 -0500 answered a question How to write a user-defined model

Check the post "User defined models" for a simple example. Read the whole chapter on "Model Writing" in POM manual.

2019-03-31 14:53:59 -0500 edited answer User defined models

The demo exciter model, uexc, in PSSe manual [POM manual, "Model Writing" chapter], using savnw.sav, is posted at my google drive site "https://drive.google.com/open?id=0B7uS9L2Woq_7YzYzcGhXT2VQYXc"

The 'uexc_tutorial' text provides the steps to follows to produce a UDM dll for a dynamic run.

2019-03-24 07:04:05 -0500 answered a question Question about user models of Library and of users models in PSSE

A library user model in PSSE does not need to be compiled to be used (no *.dll needed) while and a user model written in fortran has to be compiled to create a * .dll file, to be loaded during a dynamic run. As examples, cmldznu2 or PLBVFU1 (in v.33) are models not part of the standard PSSe library but available to the user without need to compile them.