First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

model writing

asked Oct 28 '3

WN gravatar image

updated Oct 28 '3

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

2 answers

Sort by » oldest newest most voted
0

answered Oct 30 '3

WN gravatar image

updated Oct 30 '3

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

link
0

answered Oct 29 '3

perolofl gravatar image

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.

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 gravatar imageWN (Oct 30 '3)

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: Oct 28 '3

Seen: 368 times

Last updated: Oct 30 '23