0

User Written Generator Model

If I am writing a model for a generator and I have blocks and equations such that the final quantity is a current (ISORCE). How do I incorporate it within the model and how do I set PELEC and QELEC? I feel like my approach is not correct. This is my first time writing a model. I have gone through the UEXC example but things are not clear to me.

Also, if I have certain VARs as the output of a model, is it possible to make them the input for another model or do I need to always use inbuilt arrays to pass quantities between models?

anjumrm's avatar
1
anjumrm
asked 2018-04-24 03:24:24 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Regarding transfering a VAR to another user written model, the other model can have an ICON with the index to the VAR set by the generator model. In other words, the second model just needs to know the VAR index for the generator model.

perolofl's avatar perolofl (2018-04-25 01:57:40 -0500) edit

Can VAR's hold complex numbers?

anjumrm's avatar anjumrm (2018-04-25 02:35:27 -0500) edit

No, only real numbers. To transfer a complex number you need two VARs.

perolofl's avatar perolofl (2018-04-25 03:36:50 -0500) edit

Thank you for your answers. They have been helpful. I have some more queries. You can answer if you have the time. Thanks again. Would this FORTRAN code segment be correct? VAR(L) = 2 __ VAR(L+1) = 3 __ ISORCE(II) = CMPLX( VAR(L), VAR(L+1) ), where II is the machine index

anjumrm's avatar anjumrm (2018-04-25 03:54:25 -0500) edit

Yes, the code is correct.

perolofl's avatar perolofl (2018-04-25 04:59:53 -0500) edit
add a comment see more comments

1 Answer

0

A model can get the starting index for another plant model with MDLIND subroutine. Example on how to get the first VAR index for a generator model:

CALL MDLIND(IBUS, ID, 'GEN', 'VAR', IVAL, IERR)
perolofl's avatar
3.8k
perolofl
answered 2018-04-25 03:40:53 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer