Re: tiny negative numbers

*To*: mathgroup at smc.vnet.net*Subject*: [mg92878] Re: tiny negative numbers*From*: Bill Rowe <readnews at sbcglobal.net>*Date*: Thu, 16 Oct 2008 05:06:42 -0400 (EDT)

On 10/15/08 at 5:36 AM, arorahina at gmail.com (a) wrote: >I am trying to solve a set of differential equations using NDSolve. >But I'm seeing some really tiny negative numbers like this one: >-1.28E-12. I'm guessing this is a machine-precision related problem. >So I was wondering if I can somehow ensure that the variable values >never go below 0, or alternatively, ensure that these tiny numbers >equate to 0? You can use Chop to force small numbers to 0. For example, In[31]:= Chop[-1.28 10^-12] Out[31]= 0 Larger values can be forced to zero with Chop by using the second argument.= For example, In[33]:= Chop[.2, 1] Out[33]= 0