0

Is there a way to assign states to output channels without knowing the state index/number?

Greetings,

The STATE_CHANNEL command lets you assign states (e.g. motor slip) to output channels for dynamic simulation. However, it requires as its input the "index" of the state you want to see -- basically, as you add models to the system, their states are appended to a single big list, and PSSe wants to know where in that list the requested state is.

Obviously, the index of a given state may change as you add or remove other models. So I was wondering, is there a way to identify a state by meaningful parameters, e.g. "give me the Nth state of model X at bus Y"? I hate having to slog through DOCU output to note the state numbers every time I change something about my modelling setup.

Many thanks in advance!

CamillusRex's avatar
1
CamillusRex
asked 2017-08-04 06:55:37 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

One approach is to use the set of model "IND" functions that retrieve the starting indexes for various STATEs,VARs, and so on. The exact function used depends on the model type: mdlind is used for generator plant models, lmodind is used for load models, etc. Generally the functions are defined in Section 7 of the API, but you may have to hunt a bit for the specific model type.

For example, assume the real output power of a generator at bus 10000 is stored in VAR(L+15) of the generator model. A VAR channel can be added with the code below. ival represents the starting VAR index of that specific model. No modifications to the code below are required for different dyr files :

ierr, ival = psspy.mdlind(10000,"""1""", 'GEN','VAR')
psspy.var_channel([-1,ival + 15 ] ,"""POUT""")
cajief's avatar
174
cajief
answered 2017-08-04 13:51:17 -0500
edit flag offensive 0 remove flag delete link

Comments

:D Thank you so much! That's exactly what I was looking for and I feel kind of stupid for not discovering it myself now.

CamillusRex's avatar CamillusRex (2017-08-05 06:02:48 -0500) edit

old answer, i know, but figured I'd ask anyway. How do you use the fortran version of MDLIND() within User-Model code?

wassup_doc's avatar wassup_doc (2019-06-24 11:02:10 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer