0

model writing

  • retag add tags

I am writing a user-model for an online tap-changer of a two-winding transformer. My question is: How do you change the tap position from within the user-model? It seems that using the "TWO-WINDING-CHNG_6" API (or similar) is an obvious choice. When using APIs in Python, you can use defaults and only specify the parameters that you want to change, but I don't know how to do that with the Fortran call statement. Can someone please advise me how to use this API in a Fortran call statement, while specifying only the parameters that need to change. Or is there an alternative way to change the tap position from within the user-model?

An answer to the above question will be greatly appreciated.

Willem

WN's avatar
21
WN
asked 2023-10-27 21:06:33 -0500, updated 2023-10-27 21:12:55 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

This is not described in the manual, but the internal variables for the load flow data of the tap changer is as follows:

NT = ABS(TAPNO(KNUM(KM)))   ! Internal # of tap changer
IC = PQCONT(NT)             ! Internal # of controlled bus
RMAX(NT)                    ! maximum ratio
RMIN(NT)                    ! minimum ratio
NTAPOS(NT)                  ! number of positions
VMAX(NT)                    ! maximum voltage
VMIN(NT)                    ! minimum voltage
WINDRP(NT)                  ! winding 1 ratio

The model shall use IT = 2 (metering model) and update the ratio in MODE=3.

Update variable WINDRP to the new ratio when a tap changer operation is done by the model.

The matrices must be factorised with CALL FACTDS whenever the ratio is changed by the model.

perolofl's avatar
3.8k
perolofl
answered 2023-10-29 03:31:59 -0500
edit flag offensive 0 remove flag delete link

Comments

I have tested this solution and I confirm that it works in principle. Where I got a problem was with the factorisation. There is not enough space to provide the details here and I provide that below. Thank you so much for providing this answer, it is greatly appreciated! Willem

WN's avatar WN (2023-10-29 21:46:20 -0500) edit

Hey, I tried to do this in version 36, but GET_KNUM(KM) seems to return the wrong value, is this still the correct way to get the number to use for accessing the GET_WINDRP for example? I obviously read this wrong, and missed the GET_TAPNO required. Is there a way to get the tap to update in V36?

haveityourwa's avatar haveityourwa (2026-02-11 05:01:43 -0500) edit
add a comment see more comments
0

The original solution provided by perolo fl works perfectly well, except when I tried to factorise with CALL FACTDS, PSSE displayed the message "Array allocation failed in FACT-1" and then crashed. I was able to resolve that. I show part of the code I used to test it:

IF (MODE.EQ.3)THEN       !   PSSE crashed in this case.
    WINDRP(NT) = 1.0
    CALL FACTDS
 ENDIF

The following does not crach:

 IF (MODE.EQ.3)THEN      
    WINDRP(NT) = 1.0
    CALL PFMODE(IERR)
    CALL DSMODE(.TRUE.,IERR)
 ENDIF

Strangely, if CALL FACTAPI(IERR) is added just below CALL PFMODE(IERR), PSSE will factorise twice without crashing, but if CALL FACTAPI(IERR) is added, and CALL DSMODE(.TRUE.,IERR) is commented out, or changed to CALL DSMODE(.FALSE.,IERR), PSSE crashes.

I use PSSE version 34.5; maybe that is a factor in why PSSE crashes with CALL FACTDS.

Thanks again, Willem

WN's avatar
21
WN
answered 2023-10-29 21:46:25 -0500, updated 2023-10-30 16:39:40 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer