Ask Your Question

perolofl's profile - activity

2019-01-23 01:40:53 -0500 answered a question Print a python value in psse progress output

API psspy.progress takes a string as argument, not a real. You must convert the value to a string and also add a carriage return (\n).

psspy.progress(str(Qgen[i])+'\n')
2019-01-23 00:51:28 -0500 received badge  Necromancer (source)
2019-01-21 11:39:46 -0500 answered a question How to simulate secondary frequency control in pss/e

Model LCFB1 can be used for secondary frequancy control of a machine. It is called as a Turbine Load Controller model, updating the power reference of the governor model.

2019-01-16 02:00:46 -0500 answered a question Is there anyway I can count number of branches between specific buses?

Use inibrn and nxtbrn3, for example, to loop all branches and transfomers connected to ibus:

ibus = 154
ierr = psspy.inibrn(ibus, 2)
while True:
    ierr, jbus, kbus, ickt = psspy.nxtbrn3(ibus)
    if ierr>0: break
2019-01-13 16:13:34 -0500 answered a question What is the KP in the CLOD model stand for and what does it do?

In Program Application Guide:

"All real load remaining on the bus after applying the specified percentages varies as the voltage is raised to the KP power."

In Models manual:

image description

2019-01-11 01:15:40 -0500 answered a question Base Python code for a DC load flow interconnection prospecting study in PSS/e

Record a python script while performing the study manually in the GUI.

Edit the script and insert a loop to perform the incremental change.

2019-01-09 09:18:03 -0500 answered a question Data Retrieval aBusTypes, aMachType

Example 1:

ierr, types = psspy.abustypes('TYPE')

will return 0 ['I'] since 'TYPE' is a valid string to API abusint.

Example 2:

ierr, types = psspy.abustypes(['TYPE','PU','VOLTAGE','EXNAME'])

will return 0 ['I', 'R', 'X', 'C'] since the arguments are valid strings to API abusint, abusreal, abuscplx and abuschar respectively.

Example 3:

ierr, types = psspy.abustypes(['TYPE','PU','VOLTAGE','EXNAME','XXX'])

will return 5 [None, None, None, None, None] since argument 'XXX' is not a valid string to API abusint, abusreal, abuscplx or abuschar. I.e., all supplied strings must be valid!!! The error code is 5 here since it is the fifth element in the list that contains the wrong string.

2018-12-17 00:24:11 -0500 commented answer UDM with vars and states equal to zero during dynamic simulation

Use GOTO to jump to another location of the code, not to jump to the next line!!!! Read the example codes again in order to understand the use of GOTO. But again, avoid GOTO!

2018-12-16 16:00:37 -0500 answered a question UDM with vars and states equal to zero during dynamic simulation

Your usage of GOTO statements is totally wrong. For example in mode 1-4 the model will always return at line 19, so the rest of the code is never executed. That's why the state and vars are not updated by the model.

Why are you jumping to the next line with a GOTO statement at line 22, 27, 32, 69, 83 and 90? I recommend you to study programming basics in order to structure the code in a correct way. Avoid GOTO in the code, it is not necessary in modern Fortran.

There are more errors:

Numtrm is not necessary since this is not a generator model. Remove line 12 and 13.

The DYDA record in mode 6 is not correct for a UDM.

L is used instead of N to index VAR at line 25

2018-12-13 00:08:05 -0500 commented question UDM with vars and states equal to zero during dynamic simulation

Have you implemented DOCU (mode 5) and DYDA (mode 6) in your model? If so, perform DOCU and DYDA and check if the model prints the reports.

2018-12-12 12:49:08 -0500 commented question UDM with vars and states equal to zero during dynamic simulation

What kind of model is it? How is it called? In Conet or is it a table-driven-model?

2018-12-11 14:56:39 -0500 commented question UDM with vars and states equal to zero during dynamic simulation

Have you initialised the simulation (STRT) before doing LIST?

2018-11-30 16:51:24 -0500 answered a question ¿what does it mean the line code INCLUDE COMON4.INS in the PSS/E user written model examples ?? also , what is BADMID?

The include statement just inserts the code in file comon4.ins into the source code. It contains declaration of variables and common blocks, for example CON, STATE, VAR, EFD, VREF used in the model.

BADMID is only needed if you have the option of extended term simulation, so you can, most probably, forget that function.

You need a Fortran compiler in order to compile and link the source code.

2018-11-30 16:22:12 -0500 commented answer Monitor branch current in dynamic study

Add a VAR to a channel with the VAR/STATE channel selection tool. Menu: Dynamics - Define simulation output - Misc quantity. It is important to select "Network frequency dependence" option in "Dynamic simulation options".

2018-11-30 16:07:31 -0500 commented answer Monitor branch current in dynamic study

Why shouldn’t the formula give accurate result when frequency changes? I have never used alt. 2 since I am using alt. 3.

2018-11-30 00:43:55 -0500 answered a question Monitor branch current in dynamic study

Unfortunately, PSSE doesn't have any channel for branch current. I see at least three alternatives for you.

  1. Calculate from line MVA and bus voltage. Add channels with line MVA flow and bus voltage magnitude. Use a function in plotbook to calcuate I = MVA / Vpu / base voltage / 1.73205 to get the current in kA.

  2. Use a line relay model, e.g. TIOCR1, with dummy parameters and assign the model VAR containing the line current into a channel. The line current will be in pu.

  3. Write a user written model that calculates the line current and assigns it to a VAR. Add a channel for the model VAR. This is how I solved it myself!

2018-11-27 02:29:59 -0500 commented answer Retrieving Dynamic Generator Outputs

Out of topics!!!

2018-11-23 09:46:22 -0500 commented question PLBVFU1 Playback model

According to the release notes, PLBVFU1 was added at 34.1!

2018-11-22 06:25:09 -0500 answered a question How to sum parallel line / transformers power flows using python code?

Use API inibrn, nxtbrn and brnflo!

Google on how to write to text files in Python! The solution is there if you just search.

2018-11-16 23:46:13 -0500 answered a question Can i use aAPI from PSS/E in a fortran user written model subroutine??

Yes, that is possible!

2018-11-15 02:17:56 -0500 answered a question How to pass only certain elements of an array in function

I have noted that there are many question in this forum regarding which API to use in order to perform a certain task. The method I prefer is to record a python script while performing the task manually in the GUI.

Stop recording and open the script. For example if I manually change Qload at bus 205 to 600 Mvar the recorded script will be:

psspy.load_chng_4(205,r"""1""",[_i,_i,_i,_i,_i,_i],[_f, 600.0,_f,_f,_f,_f])

Now I see which API is used to perform the change (loadchng4) and I can read about the API in the manual. Only the parameter values that I changed are written to the script and the other parameters are represented with their default values ( i for integers and _f for floats). For a data changing API this means that they are not changed, i.e. keeping their old values. For API adding new components, like loaddata_4, the default values will take the same values as for actitivty READ.

It is only necessary to enter the argument up to the last one to be changed. In my example I am changing the second real argument so the rest of the real arguments can be skipped:

psspy.load_chng_4(205,r"""1""",[_i,_i,_i,_i,_i,_i],[_f, 600.0])

Since I am not changing any integer arguments I can skip those defaults and just enter an empty list for the integer arguments:

psspy.load_chng_4(205,r"""1""",[],[_f, 600.0])

It is also possible to pass argument with their keyword name. In this case the second real is named realar2:

psspy.load_chng_4(205,r"""1""",realar2= 600.0)

Integer arguments are named intgar, for example

psspy.load_chng_4(205,r"""1""",realar2= 600.0,intgar3=6)

to change the third integer (zone number) to 6. Note that the order of keyword arguments doesn't matter. The integer argument can be given after the real argument.

2018-11-14 09:40:54 -0500 answered a question How to create a case from Python ?

Use API newcase_2!

For example to create an empty case with 100 MVA base and 50 Hz base frequency:

 psspy.newcase_2([1,1], 100.0, 50.0,"","")
2018-11-13 01:25:51 -0500 answered a question Error: No plant data at this bus

You don't understand the basics of PSSE. You can only add a generator at a Plant, not at an ordinary type 1 bus.

First create a plant with:

psspy.plant_data(601,0,[ 1.0, 100.0])
2018-11-07 01:48:45 -0500 answered a question How does psse calculate frequency at bus?

The bus frequency is calculated from the change in bus voltage angle. A filter is applied to smooth the frequency result, using a 0.04 s time constant for the filter. The frequency filter time can be changed in "Dynamic Solution Parameters".

2018-11-01 11:28:03 -0500 answered a question How to export the voltage value on the busbars from DigSilen via python to excel

This forum is for PSSE users...

2018-11-01 10:29:23 -0500 commented answer Adding primary reserve limits to dynamic model using HYGOV

Yes, Pmax is here the maximum Pmech limit in MW. I have no reference for the formula, I found it out myself many years ago...

2018-11-01 09:29:06 -0500 answered a question Adding primary reserve limits to dynamic model using HYGOV

In HYGOV the governor position p.u. value differ from the generator power p.u. value due to qNL and At parameters.

Calculate Gmax in the following way:

Gmax = Pmax/(Mbase*At) + qNL

For example if At = 1.2 and qNL = 0.08:

Gmax = 900/(1200*1.2) + 0.08 = 0.705
2018-11-01 02:09:54 -0500 answered a question Why there are so many ratings?

Transmission lines have different ratings for different ambient temperatures. Also different rating for normal operation and short time overload operation after contingencies. There are equipments in the breaker bay with different current rating, e.g. breaker, current transformer, switches.

From rev 34 there are twelve ratings, which is enough for the need of most users. You just use the number of ratings that are necessary for you needs.

2018-10-30 02:08:31 -0500 answered a question my question is about Python with Psse

You have to change input mode for the Command Line Input window from "PSSE Response"" to "Python".

image description

2018-10-26 01:32:25 -0500 commented question termination message: program has STOPPED

It seems to be an issue with your dyre-file since PSSE is crashing.

2018-10-23 23:21:23 -0500 answered a question Arrary allocation failed in DYRE

Dyre_new replaces old dynamic models with the new models defined in the dyre-file. PSSE will then allocate the new model parameters at the end of the CON, VAR, STATE and ICON vectors. After doing that 900 times you reached the maximum possible index for the a vector.

Open the snapshot again before doing dyre_new.

EDIT: In my answer above I mixed up dyrenew with dyreadd. My discussion above is valid for dyreadd but you are using dyrenew so there should not be any problems with the vectors.

Why are you reading in models with dyre_new before every simulation? What parameters are you changing in your simulations? You are not following the normal procedure for dynamic simulations.

EDIT 2: I would recommend you to move all code from line:

#Parameters

to line:

ierr = psspy.bus_frequency_channel([-1, bus])

before the loop, since the same raw-file and dyr-file is used in all simulations. Then save the converted saved case and the prepared snapshot (including all dynamic data and channels).

psspy.save(xxx)
psspy.snap(yyy)

Inside the loop:

Read the converted case and restore the snaphot at the beginning, so you will start each simulation with same data (case and snapshot).

psspy.case(xxx)
psspy.rstr(yyy)

In this way dyre_new will only be executed once!!!

2018-10-23 08:16:35 -0500 answered a question How to change voltage angle in dynamic simulation

Change the phase shift of the generator step-up transformer with 20 degrees. For example use API:

psspy.two_winding_chng_4(3008,3018,r"""1""",[],[_f,_f,_f,_f,_f, 20.0])

to change for generator at bus 3018 in savnw.sav.

2018-10-23 06:25:19 -0500 commented question How to change voltage angle in dynamic simulation

I don't understand. In a dynamic simulation the voltage angle is a result at each time step and not input data that can be changed by the user.

2018-10-23 06:11:46 -0500 commented answer If Solar Generation increases in a power system, what is the expected effect on Rate of Change of Frequency (RoCoF)?

The rotating energy for a generator is Hi*Si, where Si is nominal MVA rating. The formula is RoCoF = deltaP / (2*sigma(Hi*Si)) * fn [Hz/s]. The actual electrical power Pi for the generators does not affect the RoCoF.

2018-10-22 05:56:00 -0500 commented answer dynamic simulation using bus fault

Connect the fault at the dummy bus so all fault current will flow on the ZIL.

2018-10-22 05:54:20 -0500 commented answer dynamic simulation using bus fault

Only the positive sequence network is modeled in dynamic simulation. To plot the fault current, split the bus and insert a dummy bus with a ZIL between the buses. Add line channel with MVA for the ZIL. Divide the channel with Ubase and sqrt(3) in order to plot the line currrent.

2018-10-21 23:51:01 -0500 answered a question How to simulate unbalanced load flow in untransposed transmission line?

It cannot be simulated in PSSE.

2018-10-21 23:49:44 -0500 commented answer How to ramp the value of exciter output voltage in dynamic simulation?

Read Chapter Model Writing in Program Operation Manual!

2018-10-21 23:46:29 -0500 answered a question How to change the time step of a dynamic simulation case ?

Menu: Dynamics - Solution parameters... - DELT

or

psspy.dynamics_solution_param_2([_i,_i,_i,_i,_i,_i,_i,_i],[_f,_f, 0.001,_f,_f,_f,_f,_f])
2018-10-21 15:47:21 -0500 commented answer Fast valving initiation

Fast valving in TGOV2 follows the scheme defined by Ta, Tb and Tc. Maybe it is possible to affect the scheme by changing the parameters during the simulation.

2018-10-21 15:34:21 -0500 answered a question How to ramp the value of exciter output voltage in dynamic simulation?

PSSE does not have any facility to ramp EFD. However it can be done with some code in the CONEC file or with a user-written model.

2018-10-21 15:29:28 -0500 commented answer how to ger sequence data with (.raw and .dyr) use psse

Unfortunately there is no channel for line current. One workaround is to add a channel with MVA flow and divide with Ubase and sqrt(3) when plotting.

2018-10-21 15:17:13 -0500 answered a question Plotting a CON Parameter

Assign the CON-value to a VAR in the following way:

  1. Find out the number of the CON you want to plot with DOCU. Let us assume the number is 1234.

  2. Create CONEC and CONET subroutines with DYRE if you don't have them already.

  3. Enter the following line in the CONEC file before the RETURN statement (make sure the VAR number is higher than the highest number used in the snapshot):

    VAR(99999) = CON(1234)

  4. Compile CONEC and CONET and link dsusr.dll.

  5. Load dsusr.dll into PSSE.

  6. Add a new VAR channel for the VAR number used in step 3. E.g. psspy.var_channel([-1,99999],"STATCOM VREF")

  7. Save the snapshot.