Ask Your Question

model writing

asked 2023-10-27 21:06:33 -0600

WN gravatar image

updated 2023-10-27 21:12:55 -0600

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.


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2023-10-29 21:46:25 -0600

WN gravatar image

updated 2023-10-30 16:39:40 -0600

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

The following does not crach:

 IF (MODE.EQ.3)THEN      
    WINDRP(NT) = 1.0

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

edit flag offensive delete link more

answered 2023-10-29 03:31:59 -0600

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.

edit flag offensive delete link more


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 ( 2023-10-29 21:46:20 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2023-10-27 21:06:33 -0600

Seen: 102 times

Last updated: Oct 30