Hsein Moussawi -
The problem with your formulation is that the entire equation is still calculated even if m_H2 = 0, so you are still getting the divide by zero. To prevent the divide by zero the formulation would be:
Eff_energy = (P_load+Q_heating+Q_DHW+Q_cooling)/(MAX(0.000001,m_H2)*LHV)
Regards,
Tim
---
Timothy P. McDowell Executive Vice President Thermal Energy System Specialists, LLC 22 N Carroll St, Suite 370 Madison, WI 53703 608-274-2577
On 2016-05-04 06:42, Hsein Moussawi wrote:
Hello there,
I am trying to compute certain equation, but I am constantly getting the following error:
[ TRNSYS Message 5 : The TRNSYS Program attempted to evaluate an EQUATION that has a division by zero. Please check the EQUATION formulation and re-run the simulationReported information : EFF_ENERGY ]I made sure to calculate the equation only when the denominator is positive as follows:[ Eff_energy = GT(m_H2,0)*(P_load+Q_heating+Q_DHW+Q_cooling)/(m_H2*LHV) ]Any help would be appreciated...Regards.
_______________________________________________ TRNSYS-users mailing list TRNSYS-users@lists.onebuilding.org http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org