Ask Your Question
1

Why my user defined model can not work?

asked 2024-07-31 02:48:12 -0600

memo gravatar image

updated 2024-09-04 06:55:31 -0600

I want to creat a user defined model to contol wind turbine's active power, so I creat a model of electrical part.The code is

  SUBROUTINE WTEC(MC,ISLOT)
  INCLUDE 'COMON4.INS'
  INTEGER   MC,   ISLOT
  INTEGER J, K, IB
  IB=NUMTRM(MC)
  J=WSTRTIN(1,ISLOT)
  K=WSTRTIN(2,ISLOT)
  IF (MODE.EQ.8) GO TO 1000
  IF (MODE.EQ.3) GO TO 1200
  1000  CON_DSCRPT(1) ='Pref'
           RETURN
  1200  WIPCMD(MC)=CON(J)/VOLT(IB)
           RETURN
  END

I want to control the array WIPCMD and 'WTG3' will use it to control wind turbine's active power.But when I initialized my model the PSSE crashed. What's wrong with my code?

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
2

answered 2024-07-31 20:18:23 -0600

YKC gravatar image

First, suggest you could change the variable "VOLT(IB)" to "ETERM(IB)", ETERM is terminal voltage. I did build the electric control model of WT before and I did not use that variable.

Second, the wind machine ID is not same as machine ID, so you need to add the WNDNUM. Comparing your code and mine, your "MC" is my "IARG", and my "IARG" is equal to "I", then IW is convert machine ID to wind machine ID.

  SUBROUTINE REE(IARG,ISLOT)
  I=IARG                                      
  J=WSTRTIN(1,ISLOT)                          
  K=WSTRTIN(2,ISLOT)                           
  L=WSTRTIN(3,ISLOT)
  IW=WNDNUM(I)       #this one

Third, this model actually has "two" output signals, which are WIPCMD and WIQCMD. However, you only write one output signal, I'm not sure whether it would cause the problem or not, so suggest you adding the equation of WIQCMD.

Hope you can solve the problem!!

edit flag offensive delete link more

Comments

Thank you for your advice.Does that mean 'WIPCMD(MC)' of my model must use the wind machine ID but not machine ID anymore? I have thought the ID of wind machine equal to that of machine because the statement of them in dyr is identical .

memo gravatar imagememo ( 2024-07-31 21:35:52 -0600 )edit

ID in dyr is the same, but in code is not. You can give a test to measure the machine ID and wind machine ID, you can see the difference

YKC gravatar imageYKC ( 2024-07-31 21:51:15 -0600 )edit

I have another question about 'ETERM'.In POM the Dynamic Simulation Arrays shows ETERM is indexed by machine index.Can it be indexed by wind machine? If it can what ID should I use? machine ID , wind machine ID or BUS ID?

memo gravatar imagememo ( 2024-08-01 01:49:48 -0600 )edit

Yes it is, and please use machine id, actually the table "Dynamic Simulation Arrays" show which id you should use. It does not matter what machine you use, the point is the "array" you use. If you use the array which index by "machine index", then you use "machine index", so as others.

YKC gravatar imageYKC ( 2024-08-02 07:49:50 -0600 )edit

WIQCMD is initialised by the renewable generator model and will be kept constant if it is not updated by the electric model.

perolofl gravatar imageperolofl ( 2024-08-03 02:00:29 -0600 )edit
0

answered 2024-09-04 06:50:47 -0600

memo gravatar image

updated 2024-09-04 06:51:57 -0600

My new code is:

SUBROUTINE WTEC(MC,ISLOT)
      INCLUDE 'COMON4.INS'
      INTEGER   MC,   ISLOT
      INTEGER J, K, IB, IW, I
      I=MC
      J=WSTRTIN(1,ISLOT)
      K=WSTRTIN(2,ISLOT)
      IW=WNDNUM(I)
      IF (MODE.EQ.8) GO TO 1000
      IF (MODE.EQ.3) GO TO 1200
    1000  CON_DSCRPT(1) ='Pref'
          RETURN
    1200  WIPCMD(IW)=CON(J)/ETERM(I)
          RETURN
          END
edit flag offensive delete link more
0

answered 2024-08-03 01:55:15 -0600

perolofl gravatar image

Variable VOLT is complex. Use ABS(VOLT(IB)) instead to get the voltage magnitude.

edit flag offensive delete link more

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

Stats

Asked: 2024-07-31 02:48:12 -0600

Seen: 279 times

Last updated: Sep 04