 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Re: yp := (t) -> %;
| [MUG] Re: yp := (t) -> %; |
|
Author: Maple User Group
Posted: Wed, 7 Aug 2002 16:27:47 -0400 (
|
>> From: Maple User Group "maple_gr"
| >> From: Colin Campbell - IST "campbell"
|
| Could people vote on the following proposal for Maple 9? 10?
| You define a function:
|
| f := (t) -> sin(t^2); # ( ) on t not needed
|
| You differentiate it and get a result:
|
| diff( f(t), t );
|
| You want to use the result to define a function. You'd like to type:
|
| fp := (t) -> %; # Method 1 Mmm ... pretty!
|
| but you have to type:
|
| fp := unapply(%, t); # Method 2 Mmm ... not pretty!
|
| Would you support the idea of Maple 9? 10? permitting "Method 1"?
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 06 Aug 2002 11:13:22 -0700
From: Allan Wittkopf "wittkopf"
Subject: yp := (t) -> %;
To: "maple-list"
Even prettier:
> f := (t) -> sin(t^2);
2
f := t -> sin(t )
> fp := D(f);
2
fp := t -> 2 cos(t ) t
- Allan Wittkopf
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 6 Aug 2002 14:30:43 -0400 (EDT)
From: Fred Chapman "fwchapma"
To: "maple-list"
Subject: yp := (t) -> %;
Yes, I vote in favor of Method 1.
In this particular example, you could just do fp := D(f), which is much
simpler. In general, however, I think it would be very convenient and
desirable for t -> % to mean the same thing as unapply(%, t).
---------------- http://www.scg.uwaterloo.ca/~fwchapma/ ----------------
Frederick W. Chapman, Ph.D. Student UW Office: Math & Computer 5162
Department of Applied Mathematics UW Phone: (519) 888-4567 x6672
University of Waterloo E-Mail: "fwchapman"
Waterloo, Ontario, N2L 3G1, Canada Curriculum Vitae: see home page
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Richard Quint" "rquint"
To: "maple-list"
Subject: yp := (t) -> %;
Date: Tue, 6 Aug 2002 11:44:08 -0700
You can already do this
> f:=x->sin(x^2);
2
f := x -> sin(x )
> fp:=D(f);
2
fp := x -> 2 cos(x ) x
> fp(t);
2
2 cos(t ) t
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: Joe Riel "joer"
To: "maple-list"
Date: Tue, 06 Aug 2002 11:40:17 -0700
Subject: yp := (t) -> %;
I'm inclined to vote against it, though I haven't given it much thought.
Here is an operator that does what you want.
> `&->` := proc() unapply(args[-1],args[1..-2]) end:
> f := t &-> sin(t^2):
> diff(f(t),t);
2
2 cos(t ) t
> fp := t &-> %;
2
fp := t -> 2 cos(t ) t
Joe Riel
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 6 Aug 2002 14:41:35 -0500
From: Phil Mendelsohn "mend0070"
To: "maple-list" "campbell"
Subject: yp := (t) -> %;
Yes, as long as it doesn't break any multivariable combinations.
I.e., you can still specify the mapped symbols arbitrarily, i.e.,
fp:= (z, t) -> %
should work, even if t doesn't show up in the expression. Why?
'cause if you make a mistake, you don't want the value of % to have
changed underneath you and do all the calculations over again.
(Why % is slippery in the first place.)
Cheers,
Phil Mendelsohn
--
www.rephil.org / University of Minnesota
"To misattribute a quote is unforgivable" -- Anonymous
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 6 Aug 2002 13:50:36 -0700 (PDT)
From: John Kurtzke "kurtzke"
To: "maple-list"
Subject: yp := (t) -> %;
Colin,
Maybe I am missing something, but what about D?
f := t -> sin(t^2);
g := D(f);
Maple responds with;
g := t -> 2 cos(t^2) t
Ask Maple what g(t is and you get:
g(t);
2*cos(t^2)*t (except Maple doesn't put in the asterisks).
g(sqrt(Pi));
-2 sqrt(Pi)
Is this what you want?
(I'm using Maple 7, but this works on Maple 6, ...)
john
--
John F. Kurtzke, C.S.C.
Department of Mathematics
278 Buckley Center
University of Portland
Portland, OR 97203
503-943-7377
"kurtzke"
|
[View Complete Thread]
Previous by date: [MUG] Re: hfarray --> Maple float, Maple User Group
Next by date: [MUG] Options Menu in Maple 7, Carl Eberhart
Previous thread: [MUG] Thermodynamic Cycle Analysis, Sherrell R Greene
Next thread: [MUG] Options Menu in Maple 7, Carl Eberhart
|
|
|