 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] 4 examples - an explanation?
| [MUG] 4 examples - an explanation? |
|
Author: Vladimir Bondarenko
Posted: Tue, 4 Jun 2002 05:48:38 +0400
|
>> From: Vladimir Bondarenko "vvb"
Hello,
These 2 examples are trivial.
>1956*(1+1)^2;
3825936
>1994*(diff(a,a)+y(z))^2;
1994*(1+y(z))^2
However, if I eliminate the multiplication operator, '*',
>1956(1+1)^2;
3825936 # = 1956^2
>1994(diff(aleph,a)+y(z)+ISSAC-2003)^2;
3976036 # = 1994^2
Could I hear an explanation?
Many thanks in advance.
Vladimir Bondarenko
Applied mathematician
|
| [MUG] Re: 4 examples - an explanation? |
|
Author: Maple User Group
Posted: Tue, 11 Jun 2002 17:30:57 -0400
|
>> From: Maple User Group "maple_gr"
> >> From: Vladimir Bondarenko "vvb"
> However, if I eliminate the multiplication operator, '*',
> >1956(1+1)^2;
> 3825936 # = 1956^2
> >1994(diff(aleph,a)+y(z)+ISSAC-2003)^2;
> 3976036 # = 1994^2
> Could I hear an explanation?
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Wed, 5 Jun 2002 13:26:57 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: 4 examples - an explanation?
Eliminating the * in a*(...) gives you a(...), which is interpreted
as the function a evaluated at "...". Numbers are considered as
constant functions when necessary. This allows algebra to be
performed on functions, e.g.
> g:= f^2 + 3*f + 2:
g(p);
2
f(p) + 3 f(p) + 2
Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Wed, 05 Jun 2002 13:34:48 -0700
To: "maple-list"
From: David Harrington "dharr"
Subject: 4 examples - an explanation?
I think 1956() is a function that returns the constant 1956, no matter what
its argument is. You can see that type('1956()',function); returns true.
However, Maple immediately simplifies it to 1956 and it no longer behaves
like a function: type(1956(),function); returns false.
So 1956(1+1)^2; returns 1956^2 but 1956*(1+1)^2; returns 1956*4 (not 1956^2).
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 06 Jun 2002 09:33:38 +0200
From: Adri van der Meer "A.W.J.vanderMeer"
To: "maple-list"
Subject: 4 examples - an explanation?
If the `*` operator is omitted, the syntax becomes
"name(arguments)" that is a function call.
Maple accepts a constant as a procedurename, as can be
seen in:
> f := x -> 1956;
f := 1956
> 1956(x,y,z);
1956
This explains your results.
--
A. van der Meer
Dept. Applied Mathematics
University of Twente Phone +31 (53) 4893427
P.O. Box 217 Fax +31 (53) 4894824
7500 AE Enschede
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Dr Francis J. Wright" "F.J.Wright"
To: "\"Vladimir Bondarenko\"" "vvb"
Subject: 4 examples - an explanation?
Date: Thu, 6 Jun 2002 12:46:22 +0100
Maple treats the form `number(...)' as a constant function, which evaluates
to `number' (ignoring what appears within the parentheses). It performs
this calculation first, and then squares the result.
Francis
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 6 Jun 2002 16:17:25 +0100
To: "maple-list"
From: Nicolas PUECH "puech"
Subject: 4 examples - an explanation?
In the second series of examples, just as one uses to consider things in
mathematical notation, MAPLE considers that 1956(1+1) is the application of
the constant function x->1956 to the value 2 which leads to the result
1956. The same holds for 1994(diff.....)^2.
Nicolas PUECH
INFRES
Ecole Nationale Superieure des Telecommunications
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: Stanley J Houghton "S.J.Houghton"
Date: Fri, 7 Jun 2002 15:36:45 +0100
To: "maple-list" "vvb"
Subject: 4 examples - an explanation?
In Maple by definition
<number>(<anything>)
evaluates to <number>. Hence, 45(<anything>)= 45
I have encountered this as a rather involved bug (due to a mistyped
expression) and would prefer that error checking could be switched on
for this particular form (where a constant is in place of a
function). However, other manipulations may rely on the convention.
At least Maple is consistent in that
x->45
evaluates to 45 as well!
Can others help on this one?
Regards
Stan
|
Previous by date: [MUG] Re: Plotting a point, Maple User Group
Next by date: [MUG] Re: evalm and mapping of function, Maple User Group
Previous thread: [MUG] Assignment, Edgar G Goodaire
Next thread: [MUG] evalm and mapping of function, Guy Gendron
|
|
|