<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>Hsein Moussawi -</p>
<p>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:</p>
<p><span style="font-size: 12pt;">Eff_energy = (P_load+Q_heating+Q_DHW+Q_cooling)/(MAX(0.000001,m_H2)*LHV)</span></p>
<p><span style="font-size: 12pt;">Regards,<br /></span></p>
<p><span style="font-size: 12pt;">Tim<br /></span></p>
<p> </p>
<div>
<pre>---<br />Timothy P. McDowell
Executive Vice President
Thermal Energy System Specialists, LLC
22 N Carroll St, Suite 370
Madison, WI 53703
608-274-2577</pre>
</div>
<p>On 2016-05-04 06:42, Hsein Moussawi wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: #000000; background-color: #ffffff; font-family: Calibri,Arial,Helvetica,sans-serif;">
<p>Hello there,</p>
<p>I am trying to compute certain equation, but I am constantly getting the following error:</p>
<p> </p>
<p> </p>
<div>[ 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</div>
<div>   Reported information  : EFF_ENERGY ]</div>
<div> </div>
<div>I made sure to calculate the equation only when the denominator is positive as follows:</div>
<div> </div>
<div>[ <span style="font-size: 12pt;">Eff_energy = GT(m_H2,0)*(P_load+Q_heating+Q_DHW+Q_cooling)/(m_H2*LHV) ]</span></div>
<div><span style="font-size: 12pt;"> </span></div>
<div><span style="font-size: 12pt;">Any help would be appreciated...</span></div>
<div><span style="font-size: 12pt;">Regards.</span></div>
<p> </p>
</div>
<!-- html ignored --><br />
<pre>_______________________________________________
TRNSYS-users mailing list
<a href="mailto:TRNSYS-users@lists.onebuilding.org">TRNSYS-users@lists.onebuilding.org</a>
<a href="http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org">http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org</a>
</pre>
</blockquote>
</body></html>