Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
1

how does get_trend_sum() api work?

asked 2022-01-28 10:46:10 -0600

S.Wang's avatar

updated 2022-01-28 15:06:27 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-09-06 03:52:41 -0600

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2022-01-28 10:46:10 -0600

Seen: 134 times

Last updated: Sep 06 '22