MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A simple error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102156] Re: [mg102140] A simple error
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Fri, 31 Jul 2009 05:53:23 -0400 (EDT)
  • References: <200907300934.FAA21778@smc.vnet.net>
  • Reply-to: drmajorbob at bigfoot.com

Get rid of decimals (Rationalize) or use Chop:

DTEP12 = 0.11 (80000 - 12000 P + 800000 (1 - R)) +
    0.11 (40000 - 12000 P + 1000000 (1 - R)) +
    0.28 (-12000 P + 1200000 (1 - R));

MTEP12 = 0.11 (-130000 + 12000 (-35 + P) + 800000 R) +
    0.11 (-130000 + 12000 (-35 + P) + 1000000 R) +
    0.28 (-130000 + 12000 (-35 + P) + 1200000 R);

DTEP12 + MTEP12 // Rationalize // Simplify

272200

or

DTEP12 + MTEP12 // Simplify // Chop

272200.

Bobby

On Thu, 30 Jul 2009 04:34:27 -0500, Youness Eaidgah <y.eaidgah at gmail.com>  
wrote:

> Dear all,
> I have faced a awkward situation in Mathematica. I want to sum the  
> following
> simple equations:
>
> DTEP12 = 0.11 (80000 - 12000 P + 800000 (1 - R)) +   0.11 (40000 - 12000  
> P +
> 1000000 (1 - R)) + 0.28 (-12000 P + 1200000 (1 - R))
> MTEP12 = 0.11 (-130000 + 12000 (-35 + P) + 800000 R) + 0.11 (-130000 +  
> 12000
> (-35 + P) + 1000000 R) + 0.28 (-130000 + 12000 (-35 + P) + 1200000 R)
>
> Obviously, the result of the DTEP12+MTEP12 is : 272200
>
> However, when I use the following commands
>
> Simplify[DTEP12+ MTEP12]   or FullSimplify[DTEP12+MTEP12]
>
> Mathematica returns: 272200.+ 0. P + 5.82077*10^-11 R. I am suprised  
> where
> the last term comes form (5.82077*10^-11 R)! It is a really really small
> value, however, it is still an error. it creates some inconveniences  
> later
> in my calculations. I would appreciate if you could help me out.
> Thank you,
> Youness
>
>



-- 
DrMajorBob at bigfoot.com


  • References:
  • Prev by Date: Re: A simple error
  • Next by Date: Re: Slow start to AstronomicalData[]
  • Previous by thread: A simple error
  • Next by thread: Re: A simple error