| 1 | initial version |
I am writing a user-defined load model. I am trying to calculate the current using the old (previous time step) powers and new (this time step) powers. I store the new power as a VAR during MODE 2 and 3 (do I need to be doing this in both?), and recall it in the T-entry. Then, after calculating and injecting the current using:
CALL SET_CURNT(GET_CURNT(IB) - CONJG(S_NEW / GET_VOLT(IB)), IB)
I set the OLD powers as:
CALL SET_VAR(GET_VAR(L+19), L+21)
where L+19 is P in this timestep, L+21 represents P from the previous timestep.
My issue is that the old and new powers are being stored as exactly the same (no difference between time steps), so my incremental current injection is zero. Is my procedure correct? Are there any steps that I am missing or doing incorrectly?
Thanks
whit loves you. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.