Ask Your Question

zezo510's profile - activity

2019-09-05 07:00:13 -0500 answered a question Getting .RUN error "Activity RUN is invalid--activity STRT needs to be executed (003381)" after succesfully running .STRT

I ran your code on a sample case and snap files and it worked fine. Which leads me to think that the issue is in the initialization stage. Check if the case initialized OK and no initial suspects or messages are present in the progress of activity STRT. However, initial suspects will not prevent the RUN activity unless a generator model is missing.

2019-09-04 19:43:45 -0500 commented answer How to get the Model VARS value output in Dynamic Simulation?

One way to get the frequency in HZ is to add a function in the plot tree in psse after opening the .out file. Type in the function 60*(1+A) or 50*. After adding the function, then you can assign the frequency deviation channel you have to the value of A and plot the full functio

2017-11-15 00:57:43 -0500 answered a question Plotting .out of PSSEv32 with python 2.5 code

First let me start by saying that PSSPLT is the worst tool of plotting anything in recorded human history.

I have a simple python code to plot a single channel from an out/outx file. It can be modified to plot any number of channels. However, it is working with PSSE33 and python27. I tried to use matplotlib with python25 but couldn't. I would recommend you install PSSE33 or 34 and run this python file. Don't worry you wont need to repeat your simulations as you can plot any out file from any PSSE version. Also with PSSE 33 and 34 you can always use PSSE's plotting GUI which is very stable and actually quite descent.

import os
import sys

def add_psse_path():
    PSSEdir = str('C:\Program Files (x86)\PTI\PSSE33') # Determine PSSE Path By Default : C:\Program Files\PTI\PSSE33
    PSSEbinDir = os.path.join(PSSEdir,'PSSBIN')
    os.environ['PATH'] = PSSEbinDir + ';' + os.environ['PATH']
    sys.path.insert(0,PSSEbinDir) # Add [ C:\Program Files (x86)\PTI\PSSE33\PSSBIN ] to Python Lib Path
    return "PSSE path added"


import redirect
import psspy
import dyntools
psspy.throwPsseExceptions = True

import matplotlib.pyplot as plt

outfile = r"""outfile location"""
chnfobj = dyntools.CHNF(outfile)
short_title, chanid, chandata = chnfobj.get_data()

print short_title
print chanid
print chandata

t = chandata['time']
f = chandata[1]
v = chandata[2]

fig = plt.figure()
ax1 = plt.subplot2grid((1,1),(0,0))
ax1.plot(t,v,'g-', linewidth=1,label="Voltage")
axes = plt.gca()
plt.grid(linestyle='--', color='grey',linewidth=0.5,which='both')
2017-09-03 17:48:09 -0500 answered a question Speed Governor (K) of GAST2A initialized out of limits

The highlighted values below are the Max and Min governor limits in pu (on the turbine MW rating).

'GAST2A' 2 25.0 0.0 0.05 1.0 0.02 0.1 40.0 0.25 1.5 -0.1 0.01 0.77 1.0 0.05 1.0 0.4 0.0 0.2 0.8 15.0 2.5 450.0 3.3 700.0 550.0 0.23 1.3 0.5 1020.0 0.23 1020.0

Therefore, I would think that it's not possible to set them outside the range (0,1)

Try setting them as follows:

MAX = (Pmax/turbine rating)

MIN = (Pmin/turbine rating)

Note: the turbine rating to be taken in the calculation is the one entered in your dynamic model (40 MW in your case).

2017-09-03 10:57:32 -0500 answered a question Extract data with dyntools and plot with matplotlib

This is a simple example to extract (time) and (voltage) channels from an output (.out) file and plotting them using matplotlip. Then saving the resulting plot in a pdf file. You can manipulate it to extract and plot any other data you need.

import dyntools
import matplotlib.pyplot as plt

outfile = r"""test.out"""
chnfobj = dyntools.CHNF(outfile)
short_title, chanid, chandata = chnfobj.get_data()

t = chandata['time']
v = chandata[1]              #based on the channel identifier set in the dynamic simulation

fig = plt.figure()
ax1.plot(t,v,linestyle='-', linewidth=1, color='green',label="Voltage")
plt.grid(linestyle='--', color='grey',linewidth=0.5)
axes = plt.gca()
2017-05-02 01:40:10 -0500 received badge  Enthusiast
2017-05-01 15:19:53 -0500 answered a question abusint returning ierr=1 (working case is empty)


2017-04-28 08:36:32 -0500 answered a question Different between 2 syntax (psspy & ierr)

Ok. Here are the differences:


This is the error code resulting from applying any function in module psspy and it returns a value 0 if it was executed correctly or other integers if not. However, in case of your friend's code, he did not want to see this value. He just wanted to execute the branch data changing.


This has to be typed for any API in the module psspy. It is not mentioned in the API syntax description but if you run the API branch_data as it is shown in the documentation, it won't work.


instead of typing a full list of the integers you want to assign as parameters for the branch in question, you can just specify the parameters you want to change and the rest of the parameters will assume the default values (_i,_f,...etc)

2016-11-13 09:04:09 -0500 received badge  Famous Question (source)
2016-11-13 09:04:09 -0500 received badge  Notable Question (source)
2016-10-28 17:47:36 -0500 received badge  Popular Question (source)
2016-10-24 11:50:54 -0500 received badge  Teacher (source)
2016-10-24 04:04:01 -0500 received badge  Editor (source)
2016-10-24 03:57:43 -0500 answered a question How to see what case is open / if there is a case open using psspy?

You can use sfiles() to return the current Saved case and Snapshot filenames.

SavedCase, SnapFile = psspy.sfiles()
print SavedCase

and you can use it to check if a case file is open as follows:

if not psspy.sfiles()[0]:
    print "No Saved Case file is open"
    print psspy.sfiles()[0] + " Saved Case file is open"
2016-10-24 03:47:06 -0500 asked a question How can I export limit check results to excel?

Hello. I was wondering if there's a way to restore, manipulate and export results that are not restored in psse files such as qv, pv, accc and cannot be retrieved by pssearrays. Mainly, bus voltages and branches flows limit check and dynamics simulation initial suspects for example.

Thanks in advance.