[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] "Average value over time step" in TRNSYS Types



Knut Erik,
 Sorry for the delay in getting back to you. Since almost all of the outputs that TRNSYS deals with are averages over the timestep, the input values that are passed to your components are the averages at the previous timestep and so your component doesn't really have to compute what those values are. If your component has some capacitance (thermal or electrical storage) to it then you do need to get what the value of certain inputs at the end of the last timestep were in order to calculate what the outputs at the end of the current timestep are. One typical way of handling the job of keeping track of those is to use the "getStorageVars()" and "setStorageVars()" subroutines. If you have to call the Differential Equation subroutine from within your Type, it will return the average and final value for the time step. You can then store that final value and use it as the initial value for the next time step.
Kind regards,
 David


knut.erik.enerstvedt@niva.no wrote:

Hello TRNSYS users,

 

As I understand, TRNSYS outputs are averaged values over a time step, meaning that the output value of T at timestep n is an average of T between n-1 and n. When creating a new Type, would it be correct of me to have T_output(n) = (T(n) + T(n-1))/2, where T(n) is the newly computed value in the current iteration and time step and T(n-1) is the converged value from the previous time step? If not, how is this average normally computed in TRNSYS Types?

 

Best regards,

Knut Erik Enerstvedt



------------------------------------------------------------------------------------------------------

Meld deg på vårt nyhetsbrev på www.niva.no


_______________________________________________ TRNSYS-users mailing list TRNSYS-users@cae.wisc.edu https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users

-- 
***********************************************************************
Thermal Energy System Specialists (TESS), LLC 
David BRADLEY                      22 N. Carroll Street - Suite 370 
Partner                            Madison, WI 53703 
                                   USA
P: +1.608.274.2577 
F: +1.608.278.1475
E-mail: bradley@tess-inc.com 
Web Pages:  http://www.tess-inc.com    and      http://www.trnsys.com

***********************************************************************