First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Hi Guys,
I have created a user model of the exciter and would like to analyse / access the internal / calculation variable and plot it in the dynamic simulation in PSSE.
I just wonder how to do it since i can not find any information about it.
This is how my code looks like. I would like to plot the VERROR.
The UDM runs fine for your information
SUBROUTINE MYMODELEXC(MC,ISLOT)
INCLUDE 'COMON4.INS'
INTEGER ISLOT,IB,MC,J,K,IM,IBUS
INTRINSIC ABS,MAX
REAL VERROR
IF (MODE .EQ. 8) THEN
CON_DSCRPT(1) = 'K'
CON_DSCRPT(2) = 'Te'
ENDIF
J = STRTIN(1,ISLOT)
K = STRTIN(2,ISLOT)
IB = ABS(NUMTRM(MC))
IF(IB.LE.0)RETURN
IF (MODE .EQ. 1) THEN
! MODE 1 Initialization
STATE(K) = EFD(MC)
VREF(MC) = ABS(VOLT(MC))+EFD(MC)/CON(J)
ENDIF
IF (MODE .EQ. 2) THEN
! MODE 2 CCalculation of derivatives
VERROR = VREF(MC)-ECOMP(MC) ! This varibale i want to plot in PSSE
DSTATE(K) = (CON(J)*VERROR-STATE(K))/CON(J+1)
ENDIF
IF (MODE .EQ. 3) THEN
!MODE 3 SET EFD
EFD(MC) = MAX(STATE(K),0.0)
!EFD(MC) = VREF(MC)
ENDIF
IF (MODE .EQ. 4)THEN
! MODE 4, set number of integrators / select the highest
NINTEG = MAX(NINTEG,K)
ENDIF
RETURN
END
! Dyr Info
! 1 'USRMDL' 1 'MYMODELEXC' 4 0 0 2 1 0 2 0.5/
! 1 'GENSAE' 1 6.1 0.04 0.099 6.54 2 1.75 1.633333333 0.308333333 0.216666667 0 0 0/