Ask Your Question
0

No of constants reading error in user defined model

asked Feb 10 '5

Nasika gravatar image

I have written user defined model for excitation system with 12 constants. it has been successfully compiled. when I included in the dynamic simulation it is able to take 6 constant values only. below is the format statement. FORMAT(I7,' ''USRMDL'' ',A,' ''PSS_EDN'' 4 0 0 6 2 0 4 0 0 6 2 0'/ & 7X,12(G12.12,3X),' /')

I am unable to find the error in format that can take 12 variables when I use it in dynamic simulation. Can anyone please help where is the error That I made in the above format

Comments

At the end of the first line you write six hardcoded values of the CONS, "4 0 0 6 2 0". Why? Please also show the write statement.

perolofl gravatar imageperolofl (Feb 10 '5)

Thank you When I use my Dyr File to include the user defined model I used the below format @! savnw_PSS_EDN.dyr - user defined exciter model 101 'USRMDL' 1 'PSS_EDN' 4 0 0 6 2 0 4 0 0 6 2 0 / But It is not reading all the 12 values as required by the user defined mod

Nasika gravatar imageNasika (Feb 11 '5)

2 answers

Sort by » oldest newest most voted
0

answered Feb 10 '5

perolofl gravatar image

updated Feb 11 '5

The model is using 12 CONs and 4 STATEs. The format statement should be something like:

507 FORMAT(I7,' ''USRMDL'' ',A,' ''PSSEDN'' 4 0 0 12 4 0 '/ 7X,12(G12.5,3X),' /')

In your code the CONs are written with format code G12.12, i.e. 12 decimals in a total field width of 12 characters. It will not work!

EDIT:

The DYRE record shall be like this:

BUSID 'USRMDL' ID 'model name' IC IT NI NC NS NV data list /

where IC=4 and IT=0 for an exciter model.

NI, NC, NS, NV are the number of ICONs, CONs, STATEs and VARs used by the model. In your case 0 12 4 0.

The DYRE record becomes:

101 'USRMDL' 1 'PSS_EDN' 4 0 0 12 4 0 data list /

where data list is your 12 CONs.

Please read Chapter 18.1.1 in POM (rev 35).

link
0

answered Feb 10 '5

Nasika gravatar image

Thank you for your response... I have assumed that they are initial values that we need to give. please correct me if I am wrong.

Please find the below code

C[PSS_EDB] SIMPLIFIED EXCITATION SYSTEM MODEL C (Version Independent Form) C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * * C * THIS PROGRAM AND ITS DOCUMENTATION ARE TRADE SECRETS OF POWER TECHNO- * C * LOGIES, A DIVISION OF S&W CONSULTANTS, INC. THEY HAVE BEEN LEASED TO * C * YOU, OUR CLIENT, * C * SUBJECT TO TERMS WHICH PROHIBIT YOU FROM DISCLOSING OR TRANSFERRING * C * THE PROGRAM OR ITS DOCUMENTATION, WHETHER IN ITS ORIGINAL OR MODIFIED * C * FORM, TO A THIRD PARTY, OR FROM USING THE PROGRAM FOR ANY PURPOSE * C * OTHER THAN COMPUTATION RELATING TO YOUR OWN SYSTEM. ANY SUCH * C * TRANSFER OR USE BY YOU OR YOUR EMPLOYEES WILL CONSTITUTE A BREACH OF * C * CONFIDENCE AND OF THE CONTRACT UNDER WHICH RIGHTS OF USE HAVE BEEN * C * GRANTED. * C * * C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  SUBROUTINE PSS_EDN(MC,SLOT)

C++ C define the local variables and global variables that are going to be used C in the model C--
USE PSSDM ! this is the global declaration

  IMPLICIT NONE

C++ C Now add all the local variable declarations that will be used in this C model C--
INTEGER IB ! bus index INTEGER IERR ! error code INTEGER J ! starting CON index INTEGER K ! starting state index INTEGER L ! starting VAR index INTEGER M ! starting ICON index INTEGER MC ! this is the machine index INTEGER SLOT ! used to get starting indices J, K, L & M

  REAL VINP   ! block input
  REAL VOUT   ! block output

  LOGICAL ERRFLG ! used in docu,check functionality

  IF (GET_MODE() == 8) THEN

C++ C Add the logic here for whatever the model is expected to do when MODE is C 8. C-- J=1 CALL SETCONDSCRPT('KVT (pu), VTGain onstant', J) CALL SETCONDSCRPT('TR (s), lead time constant', J+1) CALL SETCONDSCRPT('TC2 (s), lag time constant', J+2) CALL SETCONDSCRPT('TB2 (s), lag time constant', J+3) CALL SETCONDSCRPT('TC1 (s), lag time constant', J+4) CALL SETCONDSCRPT('TB1 (s), lag time constant', J+5) CALL SETCONDSCRPT('KR (pu), exciter gain', J+6) CALL SETCONDSCRPT('KS (pu), exciter gain', J+7) CALL SETCONDSCRPT('TS (s), exciter time constant', J+8) CALL SETCONDSCRPT('KC (pu), exciter gain', J+9) CALL SETCONDSCRPT('EMIN (pu), exciter minimum', J+10) CALL SETCONDSCRPT('EMAX (pu), exciter maximum', J+11)

     K=1
     CALL SET_STATE_DSCRPT('First state of the block', K)
     CALL SET_STATE_DSCRPT('Second state of the block', K+1)
     CALL SET_STATE_DSCRPT('Third state of the block', K+2)
     CALL SET_STATE_DSCRPT('Fourth state of the block', K+3)

     RETURN
  ENDIF

C++ C At this point in the code, MODE is any value 1 through 7 C-- J = GETSTRTIN(1,SLOT) ! starting CON index K = GETSTRTIN(2,SLOT) ! starting state index L = GETSTRTIN(3,SLOT) ! since this model does not use VAR, L ... (more)

link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Feb 10 '5

Seen: 396 times

Last updated: Feb 11