Answer Question
Average function in PSCAD EMTDC
Hi everyone
I have worked related to calculate the Average value of sinwave in my customer model.
I want to make the subroutine like this:
SUBROUTINE AVERAGE_V(INT,NSAMP,OUT)
INT: input
NSAMP: number of sample in one cycle
OUT: output of average value.
Exactly I need to save the data in the array like this:
STORF(NSTORF)= INT(1)
STORF(NSTORF+1)= INT(2)
STORF(NSTORF+3)= INT(3)
.....................................
STORF(NSTORF+NSAMP)= INT(NSAMP)
And calculate the average value like this:
OUT=(STORF(NSTORF)+STORF(NSTORF+1)+........STORF(NSTORF+NSAMP)) /NSAMP
But I don't know how tho do this type of work on PSCAD EMTDC model.
Can you give me some Idea or example code?????????????
Thank you so much