Ask Your Question

toderesa97's profile - activity

2021-11-26 04:07:44 -0500 received badge  Teacher (source)
2021-11-26 04:07:44 -0500 received badge  Self-Learner (source)
2021-11-26 03:05:26 -0500 received badge  Student (source)
2019-11-14 04:18:59 -0500 received badge  Famous Question (source)
2019-10-17 10:52:59 -0500 received badge  Famous Question (source)
2019-08-09 08:50:39 -0500 received badge  Notable Question (source)
2019-06-24 19:02:06 -0500 received badge  Famous Question (source)
2019-06-24 16:57:43 -0500 received badge  Popular Question (source)
2019-06-21 09:55:29 -0500 received badge  Famous Question (source)
2019-06-20 05:04:15 -0500 answered a question File .out does not have channel outputs (dyntools)

Well turns out, there are no buses that apply to such that range of values. To see that, open your .sav on PSSE and check out the BASEKV column. You will notice that, indeed, no buses fall into such range whereas applying the other, buses are found.

2019-06-20 04:58:33 -0500 asked a question File .out does not have channel outputs (dyntools)

I'm working with this function to target buses and use the BASEKV voltage, as specified on the documentation.

def create_subsystem(self):
    subsys1_ierr = psspy.bsys(2, 1, [50, 210])
    ierr, buses = psspy.abuscount(2, 2)
    return buses

and then,

def generate_events_in(self, file):
    chnfobj = dyntools.CHNF("test.out")
    content = chnfobj.get_data()
    all_events = []
    # ...
    # ...

and everything works perfectly and as expected. The problem comes when changing the values of the array. If I were to change it from [50, 210] to [90, 210] dyntools will raise the following exception:

> File
> "C:\Users\TDRS\PycharmProjects\osmo\simulation\Platform.py",
> line 81, in generate_csv_in
>     chnfobj = dyntools.CHNF("test.out")   File
> ".\dyntools.py", line 1023, in
> __init__   File ".\dyntools.py", line 351, in _outextract_data   File
> ".\dyntools.py", line 307, in
> _outextract_id Exception: ERROR ... File test.out doesn't have channel
> outputs.
2019-06-07 14:03:58 -0500 commented question Error with importing pssexplore34 (related to _set_psse_loc)

Have you checked that those are working directories?

2019-06-07 13:54:36 -0500 commented question Error with importing pssexplore34 (related to _set_psse_loc)

Same error happened to me a few days ago using the licensed version instead of the explore one. Try to comment out line import pssexplore34. That worked in my case.

2019-05-29 11:49:56 -0500 received badge  Notable Question (source)
2019-05-21 10:00:05 -0500 received badge  Notable Question (source)
2019-05-20 20:22:46 -0500 received badge  Popular Question (source)
2019-05-16 05:12:07 -0500 received badge  Popular Question (source)
2019-05-16 04:14:45 -0500 asked a question What is the correct way to finish a simulation

I have some simulations and was wondering what is the best way (instructions using psspy) to finish successfully a simulation. I don't know if it is a silly or useless question, but have searched on this site and have not found anything, so if someone could shed some light on this, I'd really appreciate it.

The way I currently finish a simulation is by executing these set of instructions:

psspy.delete_all_plot_channels()
psspy.dynamicsmode(0)
ierr_close_line = psspy.close_powerflow()
ierr_del_tmpfiles = psspy.deltmpfiles()
ierr_halt = psspy.pssehalt_2()

Thanks, Tomás.

2019-05-16 03:43:12 -0500 received badge  Enthusiast
2019-05-15 06:26:47 -0500 received badge  Supporter (source)
2019-05-15 05:26:08 -0500 asked a question Get the number of buses targeted by BSYS

I am running a simulation using psspy.bsys(2, 1, [3, 210]) to create a subsystem of buses with:

  • sid=2
  • Use KV values
  • Array specifying the range, [3, 210]

but according to the documentation, there are others way to create the subsystem.

I was wondering whether there is a way to know how many buses (the number) has been targeted by such function. I was expecting that function to return the number of buses targeted but it returns just error codes.

This doubt is because when monitoring multiple measures (VOLT, BSFREQ,...) using psspy.chsb happens to output everything indistinctly to the same file defined in psspy.strt()

Do you know if there is such a way to "output every chsb" to different output files? If not, is there any way to find out how many buses were targeted by bsys?

Thank you for any help you can provide. Tomás.

2019-05-10 02:23:18 -0500 received badge  Notable Question (source)
2019-05-09 01:32:28 -0500 commented answer Module dyntools is not being imported PyCharm

I made the assumption, that `dyntools` would not work using version 2.7 of Python (the one I am currently using for version PSSEXPLORE 34), but turned out it worked well. Thanks.

2019-05-08 12:01:04 -0500 received badge  Popular Question (source)
2019-05-08 06:27:39 -0500 commented answer Module dyntools is not being imported PyCharm

I managed to make it work by simply deleting the project and recreating it. Thanks anyway for your reply.

2019-05-08 03:52:05 -0500 received badge  Famous Question (source)
2019-05-08 03:51:43 -0500 received badge  Famous Question (source)
2019-05-08 03:49:04 -0500 asked a question Module dyntools is not being imported PyCharm

I am using python version 3.7 and I am trying to import the dyntools module to convert the output of a binary file (generated by psspy.strt) to a readable format (you may remember my https://psspy.org/psse-help-forum/question/5870/how-to-output-in-a-readable-format-the-monitoring-in-psse/ (question)). I do not whether I am using an incorrect version of python but with version 2.7 (the one needed to execute the python API of the PSSEXPLORE34).

I have been looking out there I cannot find anything related to this topic. And the information about the module dyntools is really broad.

Thanks for any help that you can provide,

Tomás.

2019-05-07 16:38:51 -0500 received badge  Notable Question (source)
2019-05-06 10:24:46 -0500 commented answer How to output in a readable format the monitoring in PSS/E

Thank you for replying. Unfortunately, that's not a valid solution for me. Do you know if there is a way to ask for the monitoring data through the python API?

2019-05-06 03:53:23 -0500 received badge  Popular Question (source)
2019-05-04 12:49:20 -0500 asked a question How to output in a readable format the monitoring in PSS/E

I have this script:

CASE = r'''C:\\Program Files (x86)\\PTI\\PSSE34\\EXAMPLE\\savnw.sav'''
psspy.case(CASE)

# Convert loads (3 step process):
psspy.conl(-1,1,1)
psspy.conl(-1,1,2,[0,0],[100,0,0,100])
psspy.conl(-1,1,3)

# Convert generators:
psspy.cong()

# Solve for dynamics
psspy.ordr()
psspy.fact()
psspy.tysl()

# Add dynamics data
psspy.dyre_new(dyrefile="C:\\Program Files (x86)\\PTI\\PSSE34\\EXAMPLE\\savnw.dyr")

# Add channels by subsystem
#   BUS VOLTAGE
psspy.chsb(sid=0,all=1, status=[-1,-1,-1,1,13,0])

# Initialize
psspy.strt(outfile="test.out")   <----------------------------------------------
simtime = 1
#psspy.run(tpause=simtime)
psspy.run(0,simtime,99,19,0)

but turns out that the test.out file is in binary and hence, cannot be interpreted directly but just for PSS/E. I was wondering whether there is a way to output such content in a readable format, such as .csv, .xlxs,... to treat it. If not, could you come up with an idea to deal with this situation?

Thanks for your time.

Tomás.

2019-05-03 02:40:25 -0500 commented answer How to set a custom value of the .sav file using psspy

Exactly what I was looking for! Thank you for your contribution!

2019-05-03 02:39:24 -0500 commented answer Is there any way to convert a .sav to .xlxs using psspy?

That's certainly cumbersome but have thought about it. Thank you for your contribution!

2019-05-03 02:38:10 -0500 received badge  Scholar (source)
2019-05-03 02:38:00 -0500 commented answer Is there any way to convert a .sav to .xlxs using psspy?

Thank you for your contribution!

2019-05-02 05:11:10 -0500 received badge  Notable Question (source)
2019-04-29 10:17:26 -0500 received badge  Famous Question (source)
2019-04-28 19:28:38 -0500 received badge  Popular Question (source)
2019-04-27 08:34:14 -0500 received badge  Notable Question (source)
2019-04-26 12:01:17 -0500 received badge  Popular Question (source)
2019-04-26 02:52:57 -0500 commented answer How to set a custom value of the .sav file using psspy

Such post does not help at all sir. I do not want to use PSS/E at all, but psspy, its associated library in python.

2019-04-25 17:39:17 -0500 received badge  Editor (source)
2019-04-25 17:36:20 -0500 asked a question Is there any way to convert a .sav to .xlxs using psspy?

I have a .sav file and I was wondering if there is any way to convert it from .sav to either .csv or .xlxs using psspy. I do know that there is a workaround in the PSS/E.

  1. Load the file
  2. Go to File>Export>SpreadSheet Tab to CSV file, but the problem is that it is not only somewhat cumbersome when having a bunch of .sav but also that such export does only convert a table (bus, machine, plant,... and not the entire .sav)

Is there a way this can be achieved? If not, do you know about a function in psspy that permits set a value of a particular quantity? For example: let's say I would like to change the bus base voltage (BASKV). The only way I know right now is by invoking:

ierr = bus_data_3(ibus, intgar, realar, name)

but, by using this function, psspy requires that all values within the arrays intgar and realar must be specified. Is there any setter, something like:

psspy.bus_data_set(ibus, quantity, value)

######################################

The curious thing is that psspy already in their retrieval package this function:

ierr, rarray = abusreal(sid, flag, string)

Further explanation in psspy.org/psse-help-forum/question/5827/how-to-set-a-custom-value-of-the-sav-file-using-psspy

2019-04-25 16:55:13 -0500 asked a question How to set a custom value of the .sav file using psspy

I have a program in python and I'd like to know if there are a sort of setters to set a value of a custom quantity or column given the corresponding id (targeting such device is not a problem).

Let's consider I want to change the value of bus base voltage (BASKV) but don't want to modify the rest. The most approachable way I've found is by invoking:

ierr = psspy.bus_data_3(ibus, intgar, realar, '')

but intgar and realar are arrays in python, and I would not like to put again the arrays with all of their values, but just modifying one. (BASKV, localed in REALAR(2)).

Can anyone shed some light on this? Thank you in advance.

According to the API of psspy

2.7. BUSDATA3 Use this API routine to modify the data of an existing bus in the working case, or to add a new bus to the working case (see PSSE Program Operation Manual, Bus Data).

Where:

Integer IBUS bus number (input; no default allowed).

Integer INTGAR (4) array of 4 elements specifying (input). INTGAR(1) IDE, bus type code (1 by default) INTGAR(2) AREA, area number (1 by default) INTGAR(3) ZONE, zone number (1 by default) INTGAR(4) OWNER, owner number (1 by default)

Real REALAR (7) array of 7 elements specifying (input). REALAR(1) BASKV, bus base voltage in kV (0.0 by default) REALAR(2) VM, bus voltage magnitude in pu (1.0 by default) REALAR(3) VA, bus voltage phase angle (0.0 by default) REALAR(4) NMAXV, normal bus voltage magnitude high limit in pu (1.1 by default) REALAR(5) NMINV, normal bus voltage magnitude low limit in pu (0.9 by default) REALAR(6) EMAXV, emergency bus voltage magnitude high limit in pu (1.1 by default) REALAR(7) EMINV, emergency bus voltage magnitude low limit in pu (0.9 by default)

Character*12 NAME bus name (input; blank by default).

Integer IERR error code (output). IERR = 0 no errors occurred IERR > 0 fatal error occurred IERR = 1 invalid bus number IERR = 2 bus table is full IERR = 3 working case is not initialized IERR = 5 prerequisite requirements for API are not met IERR = -1 data error, warning and information messages; one or more of: - Invalid base voltage. - Invalid bus type code. - Invalid area, zone or owner number. - Bus name is more than 12 characters. - New area number but bus is the area swing for its old area. - Bus type code is 3 but is not the swing bus for its area. - Area table is full. - Zone table is full. - Owner table is full. - High voltage limit is not greater than the low voltage limit. - Normal voltage limit is less restrictive than the emergency limit