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

Re: [TRNSYS-users] Float error on squaring



Henk,
 I tried to reproduce this error in both TRNSYS 15 and TRNSYS 16 using:

EQUATIONS 3
Var1 = TIME
Var2 = 24-TIME
Error = (Var1-Var2)^2

and was not able to get the floating point error that you report. Could you please send me an example in which the floating point occurs?
Thanks
  David


At 03:25 2/15/2006, henkwitte wrote:
Hello,

When I try to calculate in an equation the square of a difference of two variables in TRNSYS 15 like:

(value_var_1 - value_var_2)^2

A floating point error is generated when the difference is or becomes zero.

(value_var_1 - value_var_2) * (value_var_1 - value_var_2) does work without problems

Is this a known problem?

If I just create an static equation with 0^2 it does not generate the error, so it could be an underflow problem on the variables.
Is there a round or MIN function in the equation of TRNSYS?

Thanks

Henk WItte


Groenholland b.v.
Valschermkade 26
1059 CD Amsterdam
The Netherlands

Tel.: +31 (0)20 - 6159050
Fax:+31 (0)20 - 6177082

mobiel: 0628176535

http://www.groenholland.nl

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


****************************************************************************************
Thermal Energy System Specialists (TESS), LLC
David BRADLEY                           2916 Marketplace Drive - Suite 104
Partner                                        Madison, WI 53719
Phone: (608) 274-2577 USA
Fax: (608) 278-1475
E-mail: bradley@tess-inc.com
Web Pages:  http://www.tess-inc.com     and      http://www.trnsys.com

"Providing software solutions for today's energy engineering projects"
****************************************************************************************