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

Ask Your Question
0

User Written Generator Model

asked Apr 24 '18

anjumrm gravatar image

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?

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 gravatar imageperolofl (Apr 25 '18)

Can VAR's hold complex numbers?

anjumrm gravatar imageanjumrm (Apr 25 '18)

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

perolofl gravatar imageperolofl (Apr 25 '18)

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 gravatar imageanjumrm (Apr 25 '18)

Yes, the code is correct.

perolofl gravatar imageperolofl (Apr 25 '18)

1 answer

Sort by » oldest newest most voted
0

answered Apr 25 '18

perolofl gravatar image

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)
link

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

2 followers

Stats

Asked: Apr 24 '18

Seen: 682 times

Last updated: Apr 25 '18