Ask Your Question

SqFKYo's profile - activity

2021-10-25 00:59:03 -0500 answered a question How to call/change DYR file values from python

I'm going to assume you want to change the dynamic data values in memory after reading the dyr file?

Under the "Dynamic Simulation Operation" there's "changecon", "changeicon" etc. method that allow you to change values if you know the array index value of the value you want to change.

In order to find the indexes, use the "mind"-ending functions e.g. windmind for wind models.

PS. If you want to read the values, use "Single Element Data" section's "dsrval", "dsival" etc.

2020-12-10 00:11:51 -0500 answered a question REGCA models erros in dynamics

From purely utilitarian view point this is how I understand it:

Reactive current exceeds type of error messages mean that you have dynamic limits in dyr/snp set to lower than what the system gets as the initial values from the power flow calculation.

Solving this issue usually means changing the Usched in the power flow solution to force the generator close to 0 reactive power or changing the limits on the dynamic side. Naturally changing the model will affect how it performs, but this is in my understanding what causes these issues.

2020-12-10 00:06:39 -0500 answered a question Difference between API's branch flow data and branch data retrieval

I never use aflowXXX commands since it returns the values in different order than abrnXXX and thus is incompatible at least on PSSE33. It also has less options than abrnXXX.

2020-10-02 02:17:25 -0500 answered a question API to get Bus Numbers

The easiest way would be to utilize the numpy Python package and make a filter based on the voltages. First you ask the pu-voltages of the buses and the numbers of the buses: (PSSE33 API here)

import numpy as np
_, (voltages, ) = psspy.abusreal(string='PU')
_, (buses, ) = psspy.abusint(string='NUMBER')
voltages = np.array(voltages)
buses = np.array(buses)
print(buses[voltages < 0.9])
2020-09-08 00:11:07 -0500 answered a question what is the best way to get started in PSSE, Python?

To expand on jconto's answer, if you have a choice, go with PSSE35. PSSE33/34 use Python 2.7, which is obsolete and doesn't receive even security fixes from 2020 onwards. PSSE35 uses Python 3.7, which is forward compatible with the recent versions of python.

2020-03-20 01:39:36 -0500 answered a question Server Sizing for multiple PSSE Instances

There are no images, but you can use multiprocessing.Pool to have N threads in PSSE. I haven't yet used that for dynamic calculations, but it works fine with power flow calculation. You just need to initialize each calculation's PSSE entity separately.

2020-03-20 01:37:37 -0500 commented question Line Properties

It's not yet possible, but afaik it's in the works. Hopefully it will get released at some point. Currently I'd advise to check out some automation software where you automate the mouse/keyboard inputs instead.

2019-01-23 00:50:41 -0500 answered a question How to mimic the stochastic of wind power in dynamic simulation

https://psspy.org/psse-help-forum/que...

EDIT: Are you interested in studying the dynamic behavior of the wind power plants under various output scenarios, or is the wind power just something that allows you to have varied power flows during the dynamic simulation? If the latter, then it might be just easier to model it as a negative load, since it's much easier to control. If not, we'll try to figure something out.

EDIT2: If the goal of your study is to see how changing the operation point of a WPP during the fault would affect the outcome then yes, setting it during power flow would be what I'd do. I wasn't sure if this is what you need or do you need to study how changing the setpoints mid-simulation affects the outcome.

2019-01-23 00:47:30 -0500 answered a question How to mimic the stochastic of wind power in dynamic simulation

You can change the generation data the same way as you can during the power flow simulation: ierr = machine_chng_2(ibus, id, intgar, realar)

I'd advise against changing the value at each time step though as it will make your simulation very slow.

2019-01-23 00:43:46 -0500 answered a question ImportError: No module named psspy

If you're on a newer version of PSS products, you can do import psse33 or import psse34 instead of the explicit extra path adding.

2018-03-02 00:50:31 -0500 commented answer Read dynamic simulation result (time-series) in python

Other issue can be that you have non-ascii characters in your channel names and you're running one of the latest versions of PSSE. In that case you should contact their support for updated pythonfiles as at least 33.11 broke the support for them.

2017-12-22 01:36:08 -0500 answered a question Storing PSSE data in python variables

What do you need from the output? If you're only interested in whether or not it was successful and post-powerflow mismatch, you can call psspy.solved() and psspy.sysmsm() functions to get the two out without changing where the input goes.

2017-12-22 01:34:08 -0500 answered a question Input data from Excel to PSSE

If you want to do this with just python, you probably want to first read your Excel file with pandas (https://pandas.pydata.org/). When you have all the data read in, you need to use individual data changing commands (psspy.busdata3, branchdata3, etc.) to input it to your case.

2017-12-22 01:30:55 -0500 commented answer blown up power flow code

As a detail: Blown up generally means solved returns value of 2, 1 might be still ok, 0 is completely fine.

2017-09-27 00:52:14 -0500 commented answer How do I call a psspy function without listing every argument?

In most cases (95%+) you only need to specify what you need to actually change, and the others will be sent as default arguments. Be aware though that some functions need all arguments (scal_2), and some functions like fdns might need testing to see what they default values really are. *doh, necro*

2017-09-20 00:55:55 -0500 received badge  Commentator
2017-09-20 00:55:55 -0500 commented answer psse34 vs psse33 dynamic simulation

I'm not running dynamic load model, and the results are *different*, and not 'different' since they give different stability margins. EDIT: Also the change was in 33.9.1 instead of 33.10. And there's nothing that would suggest related changes there. So it's just hidden extra bug afaik.

2017-09-19 00:38:06 -0500 answered a question psse34 vs psse33 dynamic simulation

With our model PSSE up until 33.9.0 gives the same results, but 33.9.1, 33.10.0 and the recent 34 series give different results. I've no idea why, so we don't plan to update to the new versions any time soon for dynamics simulation.

2017-09-11 00:47:00 -0500 commented answer Extract data with dyntools and plot with matplotlib

exec is completely unnecessary here, deprecated in Python 3, and generally a bad idea when posting code for public use. I'm not sure why you got errors with set_ylim and set_facecolor, could you perhaps post them? The difference in using plt.stuff and ax.stuff is that plt style is more Matlab.

2017-09-11 00:43:16 -0500 commented answer Extract data with dyntools and plot with matplotlib

Should be `axes.plot(t,v,linestyle='-', linewidth=1, color='green',label="Voltage")` After the `axes = plt.gca()`

2017-03-16 01:29:28 -0500 answered a question Running PSSE from Python IDLE or Python IDE

Here's a tutorial from this very site: http://www.whit.com.au/blog/2012/10/i...

2016-11-28 00:59:03 -0500 answered a question How to get MW and MVAR on psspy.aloadcplx and How to kill excel on Task Manager
ierr,bus = psspy.abusint(string='NUMBER')

This yields you bus object that looks like this: [[1,2,3,4,5]], so when you zip(*bus), you get [([1,2,3,4,5],)] back, which is probably what you don't want. Instead use this:

ierr, [bus] = psspy.abusint(string='NUMBER')

This unpacks it so the bus object is a flat list [1,2,3,4,5] and zip(*bus) yields [(1,), (2,), (3,), (4,), (5,)]

2016-10-04 04:16:11 -0500 received badge  Supporter (source)
2016-09-26 01:15:42 -0500 answered a question How do I find an available bus number?

Get the maximum bus number and add one would probably the easiest way: max(psspy.abusint(flag=2, string='NUMBER')[1][0])+1

2016-09-26 01:11:01 -0500 answered a question Get names of buses in correct order.

Unfortunately psspy.notona gives the EXNAME instead of NAME of the bus.

2016-09-12 01:13:13 -0500 answered a question How can you edit branch data from PSSE raw file using Python?

As I couldn't find a field with the status from the raw file, I'd ask you to reconsider and instead instead use Python to open the raw file (read-function), then change the statuses using e.g. abrnint/abrnchar/branchchng and finally save the file to raw using rawd2. Would this be acceptable?

2016-07-11 02:17:11 -0500 answered a question Run GUI with Python

I'd recommend that since you're already running PSS/E from Python, you'd forget about the PSS/E GUI and instead use e.g. matplotlib to plot your graphs.

2016-06-09 01:42:40 -0500 answered a question Get names of buses in correct order.

If you ask PSS/E both the numbers and the names of the buses, you'll get them back in the same order. Then to sort them you can use Python's sort combined with key-parameter such as in this example: http://stackoverflow.com/questions/13...

2016-06-01 01:24:00 -0500 answered a question Frequency Value of the Bus

I'm assuming you're running dynamics simulation. Based on perusing the API I found only the method to add a channel and then read it from the out file using:

ierr = bus_frequency_channel(status, ident)

e.g.

psspy.bus_frequency_channel(status2=busnumber)
2016-05-27 08:09:22 -0500 commented answer PSSE crash after trying to install some python libraries

Can you elaborate the problem a bit more? Can you run PSS/E from Python instead?

2016-05-17 04:21:55 -0500 answered a question PSSE crash after trying to install some python libraries

Hello there,

Did you by any chance update your Python to e.g. 2.7.11? This update caused my PSS/E to launch for a second, and then to immediately crash. Luckily I got a solution from PTI, but it requires some registry tinkering. Make an empty text file, and save it with .reg ending (e.g. fix.reg) with the following text inside of it:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7-32]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7-32\PythonPath]
@="C:\\Python27\\Lib;C:\\Python27\\DLLs;C:\\Python27\\Lib\\lib-tk"

Running the file you just made (as admin) should fix your problem.

2016-02-08 01:12:37 -0500 answered a question How to connect and disconnect a load during dynamic simulation?

Unless we're talking about very old version of PSS/E I'd highly recommend using Python instead. ierr = load_chng_4(i, id, intgar, realar) is what you're most probably looking for. See more details on page 2-36 or 724 in your API.pdf

2016-01-29 02:16:49 -0500 answered a question Plot Legend for Dyntools

Have you considered using the matplotlib library bundled with the PSS/E? Sample code after you have your time, and channel data read into memory:

from matplotlib import pyplot as plt
plt.plot(time_data, channel_one_data, label='channel_one')
plt.plot(time_data, channel_two_data, label='channel_two')
plt.legend()
plt.show()
2016-01-29 02:11:18 -0500 answered a question Using psspy and dyntools without PSSE

Heyas, I'm fairly certain you need PSS/E since you still need to use the PSS/E libraries, and when I tried to run my scripts on a remote machine, I got license warnings even though I didn't launch the PSS/E GUI itself.

2016-01-26 08:54:02 -0500 asked a question Python 2.7.11 breaks PSS/E 33

I updated my Python to 2.7.11 and it seems that my PSS/E 33 installation is irreversibly broken. It starts, but crashes immediately afterwards. Uninstalling 2.7.11 and reinstalling 2.7 doesn't seem to help.

I'm mostly posting this as a warning, and if anyone has installed the 2.7.11 and doesn't have the problems, I'd love to hear from you.

2015-12-18 02:45:36 -0500 commented answer How to get the list of Machine inertia from PSSE?

Yes, PSS/E .dyr files are normal ASCII files. I hope you can progress using this information!

2015-12-18 02:34:13 -0500 commented answer Is it possible to change generator and load values in dynamic simulation?

Under the dynamic simulation, the dynamic models of the generators govern the behaviour. You have to change those parameters if you want to change how your generator operates. I'm sorry, but I'm not leaving my e-mail on public online forums.

2015-12-18 02:32:23 -0500 commented answer How to get the list of Machine inertia from PSSE?

No, it's normal Python command. Check e.g. https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files for more details.

2015-12-18 02:09:20 -0500 commented answer How to get the list of Machine inertia from PSSE?

I mean that you should read the .dyr file with something like `with open('dyrefile.dyr')` and then iterate over it using standard Python commands.

2015-12-18 02:08:06 -0500 commented answer Is it possible to change generator and load values in dynamic simulation?

Thanks for the clarification. I'm not 100% sure, but this sounds like the dynamics data controls the power output, and you'd have to use the change_var or such methods. In order to do that, you'd need to first check which dynamics models your system is using and consult MODELS.pdf.

2015-12-18 00:51:02 -0500 commented answer Is it possible to change generator and load values in dynamic simulation?

Did you get some error? Are you using the PSS/E 33? I have used `load_chng_4` successfully myself in my own dynamic script.

2015-12-18 00:50:19 -0500 answered a question Is it possible to change generator and load values in dynamic simulation?

Did you get some error? Are you using the PSS/E 33? I have used load_chng_4 successfully myself in my own dynamic script.

2015-12-15 21:46:57 -0500 received badge  Teacher (source)