Ask Your Question

jconto's profile - activity

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.

2019-03-21 22:32:47 -0500 edited question read and create files in psse

Dear friends, I have a question about the these lines of code.

  Case = P.Path+'/'+P.Plant+'/'+P.Event+'/'+P.Raw+'-'+P.Event+'.raw'
   plbfile  = P.Path+'/'+P.Plant+'/'+P.Event+'/'+'AN.plb'
   SCADAfile=P.Path+'/'+P.Plant+'/'+P.Event+'/'+'scada'+'-'+P.Raw+'-'+P.Event+'.dat'
   dyrfile  = P.Path+'/'+P.Plant+'/'+P.DYR+'.dyr'
   OutFile=P.Path+'/'+P.Plant+'/00-OUT/plot-'+P.Raw+'-'+P.Event+'-'+P.DYR+'.out'

I can not define the Outfile, actually I found this code that works for other but I can not run it. when I run it, I give this error.

Traceback (most recent call last):
  File "C:\NLLtopsse\new.py", line 26, in <module>
    OutFile=='C:\model\PlantB.out'
NameError: name 'OutFile' is not defined

But the path is ok. can anyone help me with that? what is the outfile and how to solve it? Thank you very much

2019-03-18 18:00:15 -0500 edited question INITIAL CONDITIONS SUSPECT: MODEL GENSAL STATE K

Hi everyone,

How to solve this initial conditions suspect??

 INITIAL CONDITIONS SUSPECT:
      I   DSTATE(I)    STATE(I)      MODEL          STATE     BUS# X-- NAME --X BASKV  ID
   3387   -1.3916       1.0554      GENSAL             K        25 MACHINEG1   13.800  1

Beforehand thank you very much

2019-03-15 11:10:54 -0500 answered a question Minimum Three-Phase Fault Admittance

The test of a three-phase fault at a bus implies the concept of bringing the bus to ground, with a zero impedance (infinite admittance) but from a computer coding limitation, a large admittance value is used to simulate this type of test.

The restriction that during fault, the solution must still converge is not valid during the fault period when voltage is zero (or even of small value). Post-fault conditions (recovery of voltage) will allow the load flow to converged again.

You can contact directly PTI about this question.

2019-03-12 16:13:01 -0500 answered a question Model HYGOV Bus 159 [RU-H1 13.800] Machine "1 " : initialized out of limit(s) GMAX

Juan,

In the model HYGOV, GMAX is the maximum gate limit, given as input in the dyr file as J+6

IBUS, ’HYGOV’, ID, CON(J) to CON(J+11) /

It could be that in the base case, the Pgen of the machine at bus 159 is above the Pmax, asking the model to open the gate (g, state K+2) above GMAX. As a test, try to reduce Pgen.

2019-03-08 13:31:36 -0500 edited question Uresolved external symbol error when compiling an UDM

I'm writting a conet type user model to recreate a system protection scheme , so i'm beginning with simple things in the logic, like just getting a var with the voltage magnitud of some bus, i've named this subroutine SPSTRY2, however using the PSS E command prompt and command cload4 , i get an error of this type

conet.obj: ERROR LNK2019: Unresolved external symbol _SPSTRY2@16 referenced in function _CONET

can someone help me finding the mistake here? What i have writting so far is the next code

  SUBROUTINE SPSTRY2(I,N)
  INCLUDE 'COMON4.INS'

C  I      = STARTING 'ICON' INDEX 
C  N      = STARTING 'VAR' INDEX [ USES VAR(N)]

  INTEGER   I,    N
  INTRINSIC ABS 
  REAL      VM

  WHEN (MODE.GT.4) GO TO 1000
  UNLESS (IFLAG) RETURN
  WHEN (MODE.EQ.3 .OR. KPAUSE.EQ.2)
  .
  .  VM=ABS(VOLT(ICON(I)))
  .  VAR(N)=VM
  .  WRITE(LPDEV,10) VAR(N)
  .  WRITE(IPRT,10) VAR(N)
10   .  FORMAT('V AT BUS IS ' ,F8.5)
       ...FIN

C  MODE > 4
 1000 RETURN
      END
2019-03-06 10:25:42 -0500 answered a question Compile PSSE 32

Agree with jfconroy. A minor change if you want to run the above batch file,

change :

FROM PSS001.FOR

to:

del PSS001.FOR

or just comment it, to keep a copy of the translated fortran code, as: rem PSS001.FOR

2019-03-03 17:10:09 -0500 answered a question Model writing and Create User DLL

For PSSe v. 33, you need Intel Fortran and Visual Studio to compile your code.

Fortran PATH paths (IVF 12.1.325):
    c:\program files (x86)\intel\composer xe 2011 sp1\bin\ia32
    c:\program files (x86)\intel\composer xe 2011 sp1\redist\ia32\compiler

 Visual Studio PATH paths (VS 2010):
    c:\program files (x86)\microsoft visual studio 10.0\intel fortran\microsoft files\vc\bin
    c:\program files (x86)\microsoft visual studio 10.0\common7\ide

Once you have all tools needed, you should be able to re-create the example in the POM model writing section. Use the search box (on UDM, user written model or user defined model) to get forum knowlwedge.

2019-02-22 13:42:16 -0500 commented answer Export all channels of a .out (Dyntools) to excel file

Try the option: chnf = dyntools.CHNF(outlst,0)

2019-02-21 11:32:23 -0500 commented answer Example .dyr data for BESS

it must be REECCU1. Time to upgrade PSSe.

2019-02-21 11:27:31 -0500 answered a question Export all channels of a .out (Dyntools) to excel file

to save channels directly to excel do the following [review functions available to CHNF by getting help from the module itself, check the forum about it):

outlst     = [outfile1]
try:
        chnf = dyntools.CHNF(outlst,0)
except:
        chnf = dyntools.CHNF(outlst,outvrsn=0)
chnf.xlsout(channels=[1,4,11,12])
2019-02-19 18:49:28 -0500 edited question Compile PSSE 32

Traducir del inglés I am taking my first steps in the compilation of user models in PSS / E 32.

I need to check if the file code compilar.bat is correct

@ECHO OFF
FLECS32 "C: \ Users \ Juan \ Desktop \ Dynamic \ CC.flx" -L NO -F PSS001.FOR -W 132 -F77
IFORT / nologo / Od / Oy- / assume: buffered_io / traceback / libs: dll / threads / c / Qip ^
      / extend_source: 132 / noaltparam / fpscomp: logicals / warn: nodeclarations ^
      / warn: unused / warn: truncated_source / Qauto / Op / iface: cvf / define: DLLI ^
      / include: "C: \ Program Files (x86) \ PTI \ PSSE32 \ PSSLIB" ^
      /object:"CONEC.OBJ "^
      PSS001.FOR
FROM PSS001.FOR
@ECHO OFF
FLECS32 "C: \ Users \ Juan \ Desktop \ Dynamic \ CT.flx" -L NO -F PSS001.FOR -W 132 -F77
IFORT / nologo / Od / Oy- / assume: buffered_io / traceback / libs: dll / threads / c / Qip ^
      / extend_source: 132 / noaltparam / fpscomp: logicals / warn: nodeclarations ^
      / warn: unused / warn: truncated_source / Qauto / Op / iface: cvf / define: DLLI ^
      / include: "C: \ Program Files (x86) \ PTI \ PSSE32 \ PSSLIB" ^
      /object:"CONET.OBJ "^
      PSS001.FOR
FROM PSS001.FOR
@REM
IF "% 1" == "" GOTO SKIP
@REM ---------------- CUT HERE ----------------
FLECS32 "% 1" -L NO -F "% 1.F" -W 132 -F77
IFORT / nologo / Od / Oy- / assume: buffered_io / traceback / libs: dll / threads / c / Qip ^
      / extend_source: 132 / noaltparam / fpscomp: logicals / warn: nodeclarations ^
      / warn: unused / warn: truncated_source / Qauto / Op / iface: cvf / define: DLLI ^
      / include: "C: \ Program Files (x86) \ PTI \ PSSE32 \ PSSLIB" ^
      /object:"%1.OBJ "^
      "% 1.F"
@REM ---------------- CUT HERE ----------------
: SKIP
@ECHO If no errors, run "cload4" example.lib

Thank you

2019-02-18 21:02:02 -0500 edited question Psspy, import

Hello everyone, I really appreciate it if anyone helps me with my big problem. I should import psspy, and I run this code:

import os,sys

sys_path_PSSE=r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'  #or where else you find the psspy.pyc
sys.path.append(sys_path_PSSE)
os_path_PSSE=r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN'
os.environ['PATH'] += ';' + os_path_PSSE
os.environ['PATH'] += ';' + sys_path_PSSE
import dyntools
import psspy

but, unfortunately, I got this error.

File "D:/...", line 11, in <module> import psspy

File ".\psspy.py", line 56, in <module>

ImportError: DLL load failed: %1 is not a valid Win32 application. does anyone know how to solve this error? My windows is 64-bit and my python version is also 64 bit, my psse is psse34explore. Thank you for help.

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.