Ask Your Question

Aryan Ritwajeet Jha's profile - activity

2023-10-02 10:01:29 -0500 received badge  Necromancer (source)
2023-10-02 10:01:29 -0500 received badge  Teacher (source)
2022-06-12 13:21:40 -0500 answered a question Python API to Terminate Dynamic Simulation

You may use a small script within your python file which reads the last n lines of progress_file.txt generated by the simulation at fixed time intervals. If and when it detects the Network not converged string, you may extract the full line to get further details, example:

'Network not converged at TIME = 97.8525'

As per the asked question, you are free to stop your simulation at the same interval.

Why use this method?

This method can help you diagnose (or at least get an idea about) your simulation problems within your python run. By reading the progress_file, you can also acquire 'events' which led to the Network not converged without shifting your eyes from the python file you're using to run PSSE. For example, using an additional search for beyond string in the the same last n lines may reveal warning lines like:

Machine "1" at bus 1 [BUS1 16.500]: PGEN (7.0) is beyond its limits (PMIN=10.0, PMAX=250.0)

which you may then print to the terminal within the run.

Python code

If you want, you may refer to my implementation of this script in python, which itself uses a module (tail.py) I found in this StackOverflow answer for reading last n lines of the desired file.

Note 0: The tail.py linked in this answer is only for Python 2. But you may use a different implementation available on the same page for Python 3.

Note 1: My implementation is a bit sloppy as I chose the value of n to be arbitrarily high like a 1000 which may cause overlapping 'reads' of the same string in different checking intervals. The code can definitely be refined to 'smartly' read after simulation time step or a multiple of such steps instead of a fixed number of lines.

2022-05-15 07:17:15 -0500 answered a question Where can I download PSSE version 34 for students?

Here is an installer I fortunately had saved on my PC before they took it down for some reason.

2022-04-18 09:59:47 -0500 received badge  Famous Question (source)
2022-04-17 12:54:52 -0500 received badge  Notable Question (source)
2022-04-17 02:16:25 -0500 received badge  Popular Question (source)
2022-04-16 07:52:15 -0500 asked a question So what physically causes my highly loaded system to blow up?

In my very hypothetical scenario, I'm simulating the IEEE 9 bus system, whose loads I am deliberately increasing linearly with time in order to make the system 'blow up'. Some unrealistic modifications I have done to this systems are:

  • Disabled all protection mechanisms (didn't put any such mechanisms would be a more accurate statement)
  • Generator maximum allowed powers and operation voltage ranges have been drastically increased (no chance of hitting the limits during the simulation).
  • Used zero time lag governors which can sense any change in load powers and instantly increase the real power generation of the generators.
    • Additional power lost in the transmission lines due to extra loading has also been accommodated for in these power increments.

Yet after all this, once my generator bus voltages dip below some critical values, say between 0.80pu to 0.75pu, the simulation eventually 'blows up', and the bus voltages start drastically oscillating.

I was hoping for a result in which the generator bus voltages dip until they reach 0pu (or close to zero). So physically what goes on which causes my system to 'blow up'?

2022-02-04 00:44:51 -0500 received badge  Famous Question (source)
2022-01-15 09:58:53 -0500 received badge  Famous Question (source)
2022-01-15 09:58:53 -0500 received badge  Notable Question (source)
2021-12-12 22:35:25 -0500 received badge  Popular Question (source)
2021-12-12 22:35:25 -0500 received badge  Famous Question (source)
2021-12-12 22:35:25 -0500 received badge  Notable Question (source)
2021-12-12 18:38:13 -0500 commented answer Is it possible to change generator and load values in dynamic simulation?

The annotated diagram really helps to understand!

2021-12-10 08:45:08 -0500 answered a question Is it possible to change generator and load values in dynamic simulation?

The below code snippet has been made as per the details of the original question.

Note 0: The method for changing the real power generation in dynamic simulation is based on @peroflofl 's answer.

Note 1: psspy.scal2 works fine for dynamic simulation as far as load increments are concerned. It however, does not change the dynamic generation values for me. So in such a case @peroflofl's code does the job. I have added a slightly modified version of his code into this snippet.

Note 2: Any slashes in the command below ' \ ' are used to split the command in multiple lines in Python2

# Housekeeping code before running the simulation for efficient changing of loads and generations.
genBus = 1
loadBus = 3
subsystemNum = 1
ierr = psspy.bsyso(subsystemNum, loadBus) #Adding Bus 3 to Subsystem 1. It is assumed that a subsystem identified by that number has not been created.
ierr, mbase1 = psspy.macdat(genBus, '1', 'MBASE')
# add dummy governor without droop and time constants to Bus 1
psspy.add_plant_model(genBus, '1', 7, r"""IEESGO""", 0, "", 0, [], [], 11, \
[0.0,0.0,0.05,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0])
psspy.machine_array_channel([-1,6, genBus], '1' ,"")

ierr = psspy.strt(0, 'ieee39_outfile.out')
psspy.run(0, 0.5, 0, 1, 0) #It is assumed that your initial values of Bus 1 generation and Bus 3 load are already set

changeType = 1 # Parameter for psspy.scal_2. Use 2 for Percent change and 3 for Incremental change. I've used 1 since you need to specify a new value.
loadChange = 75  # New load should be 75 MW

ierr, totals, moto = psspy.scal_2(subsystemNum, 1, 0, \
        [psspy._i, 2, 0, 1, 0], \
        [loadChange, changeType, 0.0, 0.0, 0.0, -0.0, 0.0]) # Now Bus 3 PLoad is 75 MW.

genChange = 100 # New generation should be 100 MW
psspy.increment_gref(genBus, '1',genChange/mbase1) # Now Bus 1 PGen is 100 MW.

psspy.run(0, 1.0, 0, 1, 0) # Run till 1.0 s

loadChange = 20 # New load should be 20 MW

ierr, totals, moto = psspy.scal_2(subsystemNum, 1, 0, \
        [psspy._i, 2, 0, 1, 0], \
        [loadChange, changeType, 0.0, 0.0, 0.0, -0.0, 0.0]) # Now Bus 3 PLoad is 20 MW.

psspy.run(0, 2.0, 0, 1, 0) # Run till 2.0 s

Assuming you are using dyntools.CHNF to record the dynamic simulation state variable values, you may then plot POWR 1 [BUS 1 BasKV_val]1 values from the .xlsx file using your preferred progarmming software.

2021-12-10 03:13:23 -0500 received badge  Notable Question (source)
2021-12-08 05:56:42 -0500 commented question How to model a Fourth Order Generator in PSSE?

Trying to Initialize throws something like 'Initial Conditions Suspect' and in red: "Fatal Error: Run not allowed".

2021-12-07 03:22:42 -0500 received badge  Editor (source)
2021-12-07 03:19:25 -0500 asked a question How to model a Fourth Order Generator in PSSE?

I couldn't find a specific generator model for modelling the fourth order synchronous generator in PSSE 34.0

which does not need Xd'', Xq'', Tdo'' and Tqo''.

and only needs Tdo', Tqo', Xd, Xd', Xq and Xq'.

I can find the second order classical model GENCLS, third order model GENTRA and sixth order models GENSAL, GENROU and GENTPJ1.

As per page 4 of this paper I should put Tdo'' = 0 and Tqo'' = 0 in a sixth order model in order to make it a fourth order one.

But these higher order models either explicitly have the requirement of putting Tdo'' > 0 and Tqo'' > 0 or in case of GENTPJ1 (which seems to allow Tdo'' >= 0 and Tqo'' >= 0) PSSE flags the values with an error, by showing the filled boxes as red if I try to specify them as zero.

Kindly help me model a fourth order generator in PSSE.

2021-12-06 11:12:52 -0500 received badge  Popular Question (source)
2021-12-06 11:11:32 -0500 received badge  Popular Question (source)
2021-12-04 07:44:32 -0500 commented question HELP PSSE ERROR - Power Flow

It may be that the system you built does not have 'suitable' parameters. Have you tried solving for power flow in standard bus systems (say the IEEE9 bus or IEEE39 bus systems)?

2021-12-04 07:18:18 -0500 asked a question aBusReal and aMachReal behaving weirdly

In my dynamic simulation of the IEEE9 bus system, I wish to retrieve the real power generation data of generator buses w.r.t. time. However there seems to be an inconsistency between the values of Real Power retrieved when I use

ierr, current_PGEN = psspy.amachreal(-1, string = "PGEN")

or

ierr, current_PGEN = psspy.agenbusreal(-1, string = "PGEN")

which show the same constant values as in steady state

as opposed to the command

chnfobj = dyntools.CHNF(outfile)

which shows the correct values for the real powers generated in its POWR columns in the resultant excel file.

Some context for the simulation:

  1. I'm increasing all the loads with time.
  2. The generators have governors (and therefore their generations should increase).
  3. Since the first two commands (agenbusreal and amachreal) give values for only that instant, I'm appending the output values to one table for the whole run, instance by instance.
  4. Other API retrievals (bus voltages, line currents) seem to work just fine.
  5. I've set up channel object such that PGens are recorded (an example column in the excel file is POWR 1[BUS1 16.500]1)
2021-12-04 06:10:20 -0500 received badge  Scholar (source)
2021-12-04 06:08:23 -0500 answered a question Where may I find the documentation for PSS/E?
2021-12-03 19:26:27 -0500 asked a question API routine in Python to retrieve Bus Frequencies

There must be a routine similar to the ones to retrieve bus voltages, branch currents and generator real powers, right? I know that in the GUI, one can set channels for BsFreq and use the frequency values obtained in the output files. Just looking for something along the lines of:

ierr, bus_voltages = psspy.abusreal(-1, string = "PU") // API command to retrieve bus voltages
2021-11-27 17:08:30 -0500 commented answer impedance load

For future seekers: Use abusint command. ierr, buses = psspy.abusint(-1, string = "NUMBER")

2021-10-04 07:33:04 -0500 received badge  Enthusiast
2021-10-02 08:47:51 -0500 received badge  Famous Question (source)
2021-09-16 06:07:10 -0500 received badge  Supporter (source)
2021-09-11 22:49:34 -0500 received badge  Notable Question (source)
2021-09-11 07:10:22 -0500 received badge  Student (source)
2021-09-10 08:51:55 -0500 received badge  Popular Question (source)
2021-09-09 05:58:18 -0500 asked a question Where may I find the documentation for PSS/E?

I have recently begun working on PSS/E. The PSS/E version installed on my university computer is 34.0, but the documentations in the DOC folder are not exactly compatible, at least for the PAGV and API manuals. For example, both PAGV1 and PAGV2 open PAGV2. The API manual is for version 33.9. Could someone point me to a resource where i may download the manuals for version 34?

In case it matters, I am working on Python27.

2021-09-09 05:51:40 -0500 commented answer Error using python to apply bus fault

Hi! Can you please explain what are the parameters required in the command dist_bus_fault2_()? For some weird reason, my PSS/E 34 has broken/outdated documentation files. I have the 33.9 API manual, but the software for 34.0.