[TRNSYS-users] Error: division by zero

mcdowell at tess-inc.com mcdowell at tess-inc.com
Wed May 4 05:38:07 PDT 2016


 

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 simulation 
> Reported 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 at lists.onebuilding.org
> http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org [1]
 

Links:
------
[1]
http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20160504/240a97f0/attachment.htm>


More information about the TRNSYS-users mailing list