 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Evaluation problem
| [MUG] Evaluation problem |
|
Author: Colin Campbell - IST
Posted: Wed, 11 Dec 2002 15:59:37 -0500
|
>> From: Colin Campbell - IST "campbell"
Dear MUG and Maple Support:
This problem actually arose recently in a Calculus assignment on
exploring limits with the help of Maple.
1. Here is the function:
f := (x) -> ( x - 8 ) /
( x^(1/3) - 2 );
2. We evaluate the function at x=8, (Maple 8, Win XP)
f(8);
but instead of getting: "Error, numeric exception: division by zero"
we get: "0" as the result.
3. Some insight may perhaps be found by evaluating:
1 / ( 8^(1/3) - 2 );
which comes back unchanged. It has to be "simplify"ed to get the error.
4. Question: Should Maple be more aggressive in evaluating denominators
before returning a zero result based on the numerator?
It seems uncharacteristic of Maple to take short-cuts.
5. Comment: Naturally this sort of behaviour is confusing to students
until this feature of Maple is explained to them. Is it
documented in the manuals or help so that students may be
directed to an explanation whenever this arises?
Colin Campbell - IST - University of Waterloo - ON - Canada
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: Colin Campbell - IST "campbell"
To: "maple-list"
cc: "Support (WM Support)" "Support"
Dear Support:
Thank you for your reply. Correct me if I'm wrong but
it seems the most reasonable way Maple "could" evaluate:
f := (x) -> ( x - 8 ) /
( x^(1/3) - 2 );
f(8);
would be as:
0
-----------
8^(1/3) - 2
so it doesn't make assumptions about the denominator being non-zero.
And then the user could decide to:
simplify(%); # <- accepting the assumptions simplify makes
and get the error they possibly seek: "division by zero".
Colin
On Tue, 10 Dec 2002, Support (WM Support) wrote:
> Dear Colin Campbell,
>
> Perhaps the following two FAQs on our Support website may be of interest to you:
>
> http://www.maplesoft.com/support/Faqs/MapleV/Math/7.shtml
> http://www.maplesoft.com/support/Faqs/Maple7/Math/1.shtml
>
> When simplifying (8)^(1/3), Maple is looking for a complex number, z, such that
> z^3=8. Basically, Maple is doing the following calculation:
>
> > solve(z^3=8,z);
>
> 1/2 1/2
> 2, -1 + 3 I, -1 - 3 I
>
> Notice that 8^(1/3) has three possible solutions (one real, two complex).
> Therefore, Maple cannot make the generalization that 8^(1/3) - 2 is equivalent
> to 0.
>
> Usually in situations where one defines a function with fractional powers, we
> would suggest:
>
> 1. using surd(x,n) (Non-principal root function) instead of x^(1/n):
>
> > f := (x) -> ( x - 8 ) / ( surd(x,3) - 2 );
>
> x - 8
> f := x -> --------------
> surd(x, 3) - 2
>
> > f(8);
> Error, (in f) numeric exception: division by zero
>
> 2. using RealDomain:
>
> > with(RealDomain):
> > f := (x) -> ( x - 8 ) / ( x^(1/3) - 2 );
>
> x - 8
> f := x -> ---------------------------
> RealDomain:-`^`(x, 1/3) - 2
>
> > f(8);
> Error, (in f) numeric exception: division by zero
>
> We hope this information helps.
>
> Sincerely,
> Technical Support Department
> Waterloo Maple Inc.
>
> Maple's new Distance Education Solution
> Introducing MapleNet
> http://www.maplesoft.com/maplenet
>
|
[View Complete Thread]
Previous by date: [MUG] Two bugs in evalapply(), Helmut Kahovec
Next by date: [MUG] Re: Import RTF files into maple., Carl Devore
Previous thread: [MUG] Forcing Maple Output with Simplifying, Fraser Murray
Next thread: [MUG] Import RTF files into maple., Aldrovando Azeredo Araujo
|
|
|