       Re: Problem with Interval Calculations?

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

```In a message dated 2001/9/21 4:11:43 AM, garnold at mbvlab.wpafb.af.mil writes:

>Mathematica 4.1 gives me the following:
>
>In:=  expr=a*(1-a)
>Out= (1-a) a
>
>In:= expr /. a->Interval[{1,2}]
>Out= Interval[{-2,0}]
>
>In:= Expand[expr]
>Out= a - a^2
>
>In:= Expand[expr] /. a->Interval[{1,2}]
>Out= 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
>is
>practical.
>

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...