1

how does get_trend_sum() api work?

If the simulation comes to the 100th timesteps, what will get_trend_sum(state, handles, 3) return?

the sum of timesteps from 97, 98, 99? or 1~97? or 98, 99, 100?

S.Wang's avatar
131
S.Wang
asked 2022-01-28 10:46:10 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2022-01-28 15:06:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Read the documentation: https://nrel.github.io/EnergyPlus/api...

Parameters trend_handle – An integer returned from the get_trend_handle function. count – The number of time steps to search back in history to evaluate this function.

Returns Floating point value representation of the specific evaluation.

Whether it will get 97, 98, 99 or 98, 99, 100 depends on when your callback happens (at the beginning of the timestep or at the end, before or after the new incoming value is added).

Note that it is pretty pointless (and more confusing IMHO) to use these E+-provided trend sum/average ones in python. Instead just make a python list (or numpy array, or whatever) of your historical values and compute the average/sum yourself using python's sum and mean

Julien Marrec's avatar
29.7k
Julien Marrec
answered 2022-09-06 03:52:41 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments