Ask Your Question

perolofl's profile - activity

2019-03-22 11:21:41 -0500 commented answer model writing and debugging

Mode 4-1-3-2 is called at STRT. Mode 3-2 during each time step of the simulation.

2019-03-22 11:20:48 -0500 commented answer model writing and debugging

From POM: "Any error or progress report messages written in MODEs one through four should be written to the FORTRAN unit number specified by the variable LPDEV" Unit DBUF01 is unknown to me. Where do you find those statements?

2019-03-22 02:36:59 -0500 answered a question model writing and debugging

The MODEs are described in Program Application Guide, Volume 2, Chapter 13.5. Only MODE 1-4 are called in a dynamic simulation.

2019-03-22 02:29:04 -0500 answered a question read and create files in psse

You have double equal sign, i.e. a Comparison Operator:

OutFile=='C:\model\PlantB.out'

It should just be a single equal sign for assignment:

OutFile='C:\model\PlantB.out'
2019-03-19 09:59:43 -0500 commented answer Model HYGOV Bus 159 [RU-H1 13.800] Machine "1 " : initialized out of limit(s) GMAX

Actually, for HYGOV the formula is Pgen <= ((Gmax-qNL)*At)*Mbase.

2019-03-16 02:30:39 -0500 answered a question How does PSSE file match real-time branch flow measurements?

If bus names are static in the PSSE-files, you can use the names for bus identification.

2019-03-12 09:46:11 -0500 commented answer How to Convert synchronous generators into asynchronous generators?

YQload is 173.9142 Mvar at 1 pu voltage! You have already converted Qload to 100% constant impedance load.

2019-03-08 16:26:53 -0500 commented answer How to Convert synchronous generators into asynchronous generators?

GNET is just taking the plant out of service and replacing it with a negative load. It has nothing to do with renewables. The new load is constant load. It seems you have converted the active load to 100 constant current. What about reactive load? Is is converted to constant impedance (YQload)?

2019-03-08 00:13:37 -0500 answered a question How to Convert synchronous generators into asynchronous generators?

Use GNET to convert the generator at bus ibus to a load:

psspy.bsys(1,0,[0.0,0.0],0,[],1,[ibus],0,[],0,[])
psspy.gnet(1,0)
2019-03-07 10:41:08 -0500 commented question Uresolved external symbol error when compiling an UDM

The correct call in CONET is CALL SPSTRY2(I, J, K,N). Since your model has no cons or states J and K will be 0 while I and N will have non-zero values with indices to the ICON and VAR vector respectively. Do as @txc writes above.

2019-03-05 10:05:51 -0500 commented question Uresolved external symbol error when compiling an UDM

It seems like the file SPSTRY2.obj is missing in the linking process. Have you compiled your model?

2019-03-05 04:55:09 -0500 commented answer How to ramp the value of exciter output voltage in dynamic simulation?

How can we change the EFD in Python?

2019-03-02 02:19:48 -0500 commented answer Getting y matrix through conet crashes pss e

As I wrote above: Replace 0 with variable IERR!!! The subroutine returns the error code in the last argument.

2019-03-01 15:12:08 -0500 commented answer Getting y matrix through conet crashes pss e

Can you show the call statement you are using?

2019-03-01 08:24:54 -0500 commented answer Getting y matrix through conet crashes pss e

Does it work after changing to IERR?

2019-02-28 01:31:22 -0500 answered a question Getting y matrix through conet crashes pss e

The last argument in the subroutine call should be an integer variable, e.g. IERR. You have entered a constant.

Isn't it easier to just call the python API before the first run command, instead of calling it in Fortran from CONET?

2019-02-25 01:40:11 -0500 answered a question configure or write my own user model of power system stabilizer in PSS/E

You have to learn yourself to write user models. Read POM chapter 23 several times...

2019-02-25 01:37:02 -0500 commented answer I couldnt find what this functions are for in mode 5 in user model programming

The last two are described in PAG-II, chapter 24.

2019-02-25 01:34:42 -0500 commented answer VSC-HVDC or MMC-HVDC User-defined model writing

Where have you seen those functions? I'm not aware of them.

2019-02-22 09:19:42 -0500 commented answer Adding a time-delay during simulation

No , it is not possible.

2019-02-22 05:25:10 -0500 answered a question Adding a time-delay during simulation

You have to write a user-model of the PSS with built-in time delays of the signals.

2019-02-22 00:25:21 -0500 answered a question How to print the sld file neatly, with flow arrows and such ?

Install a pdf-printer so the diagram can be printed to a pdf-file instead to the printer. The diagram will then be written as a vector plott so you can zoom into the image without deteriorated resolution.

Jpg is not suitable for large diagrams since the resolution is set by the pixels. See below, where I zoomed into bus 3005 in a .jpg-diagram. image description

A screen copy of the same bus in a pdf-file looks as below. Here there is full resolution and all figures are clear. image description

If I zoom even more into the pdf, the resolution is still perfect due to the vector plotting used, see below. image description

2019-02-21 03:25:49 -0500 answered a question Array UMDNAM

In PSSE-33 array UMDNAM is declared with a length of 16 charaters. See fil pssCharLen.h in PSSLIB.

2019-02-20 03:08:10 -0500 answered a question How to calculate the governor reference?

PSSE initialises the model at start of simulation and sets the value of the governor reference. It does not matter what value has been set by you before initialisation, PSSE will, of course, update to the correct value to get steady state conditions.

You can change the governor reference during the dynamic simulation if you want, to perform a power reference step change.

Normally, governor reference value will correspond to Pgen, but the governor model may limit the power to maximum or minimum power limit in the governor model. The governor will hit the limitation if Pgen in load flow is outside the governor limits. If that happens either Pgen or governor limits should be adjusted.

2019-02-19 00:28:26 -0500 commented answer I couldnt find what this functions are for in mode 5 in user model programming

You can ignore the usage of CONINT and variable IVEC if you want. The only benefit with CONINT is that you can abort the writing of DYDA report with interrupt control code and 'AB'.

2019-02-17 16:03:21 -0500 answered a question VSC-HVDC or MMC-HVDC User-defined model writing

Subroutine VLTFR6 is explained here.

Function NWLDLG_MODE2 is used to calculate the output of a non-windup lead-lag block in mode 2, see Program Application Guide, Volume II, Chapter 24.8.

2019-02-17 15:46:03 -0500 commented answer I couldnt find what this functions are for in mode 5 in user model programming

The usage of CONINT is only applicable to models called by CONEC or CONET. There is no reason to write such a model today since all types of model can be called by PSSE directly, i.e. Table-driven. See POM, chapter 23.6.

2019-02-15 00:35:41 -0500 answered a question I couldnt find what this functions are for in mode 5 in user model programming

Subroutine VLTFR6 converts the real base voltage BASVLT(IB) to a left justified character returned in string VLTI.

Subroutine ADINTN converts the integer JJ to a left justified character returned in string CB1.

VLTI and CB1 are local variables and must be declared as CHARACTER, e.g. CHARACTER*6.

The benefit is that the last CON number can be written left justified in the DOCU report, i.e. immedietaly after the minus sign, see example below, where the CON range is 1-14.

 Model GENROU Bus 101 [NUC-A       21.600] Machine "1 " :

                  C O N S     S T A T E S
                    1-14          1-6

If JJ had been written as an integer the corresponding report would look like:

 Model GENROU Bus 101 [NUC-A       21.600] Machine "1 " :

                  C O N S     S T A T E S
                    1-    14      1-    6

which is not so nice since there are several spaces between the minus sign and the value.

In mode 5, 6 and 7, dynamic models shall write to the Fortran number stored in common variable IPRT.

2019-02-13 05:18:39 -0500 answered a question VAR index for USRMDL with conec code 505

Use API cctmind_mcno for machine other models!

2019-02-06 05:54:44 -0500 answered a question pause psspy.run based on the status of a monitored variable (to simulate an SPS)

Only a dynamic model can pause an ongoing simulation so you have two options:

1) Write a dynamic model to stop the ongoing simulation.

2) Use a Python loop to advance the simulation in small steps with psspy.run, checking the monitored parameters and perform any necessary action in each loop.

2019-02-01 00:47:52 -0500 answered a question how to tap a multi-section line

A multi-section line cannot be tapped since each dummy bus must have exactly two branches connected to it.

You have to remove the multi-section line definition for that line and make a normal line tap.

2019-01-24 02:16:21 -0500 answered a question Complex generation: get the Real par and Imagine part

In addition to jconto's answer your code should check the ierr value before taking the real part of cmpval. If the bus doesn't exist or there is no machine at the bus the API will return None. For example in savnw:

ierr, cmpval  = psspy.gendat(101)

will return ierr=0 and cmpval=(750+95.0456008911j) and it is possible to retrieve the real part of the complex power with cmpval.real.

If the bus or plant do not exist the error code will be non-zero and None will be returned instead of the complex power. For example ierr=3 and cmpval=None. You cannot use method .real on a NoneType object and therefore need to check the value of ierr before using method .real. E.g.

if  ierr==0: REAL_MW=cmpval.real
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.