MathGroup Archive 2001

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

Search the Archive

Re: Problem with Interval Calculations?

  • To: mathgroup at
  • Subject: [mg30886] Re: [mg30868] Problem with Interval Calculations?
  • From: BobHanlon at
  • Date: Sun, 23 Sep 2001 02:16:26 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/9/21 4:11:43 AM, garnold at writes:

>Mathematica 4.1 gives me the following:
>In[1]:=  expr=a*(1-a)
>Out[1]= (1-a) a
>In[2]:= expr /. a->Interval[{1,2}]
>Out[2]= Interval[{-2,0}]
>In[3]:= Expand[expr]
>Out[3]= a - a^2
>In[4]:= Expand[expr] /. a->Interval[{1,2}]
>Out[4]= Interval[{-3,1}]
>What gives?  Should the answer be the same?  I believe the expanded answer,
>but I'm not sure expanding every problem before assigning the interval

expr = a*(1-a);

expr /. a -> Interval[{1, 2}]

Interval[{-2, 0}]

Expand[expr] /. a -> Interval[{1, 2}]

Interval[{-3, 1}]

Plot[expr, {a, 1,2}];

I believe the first result.  Applying Simplify or FullSimplify before 
assigning the interval would produce better results.

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: RE: New user of Mathematica (FORTRAN related question)
  • Next by Date: Re: how to write a mathematica program
  • Previous by thread: Re: Problem with Interval Calculations?
  • Next by thread: transformations for spherical panoramic viewing...