List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Diff remember table
| [MUG] Diff remember table |
|
Author: Marc Prevosto
Posted: 28/02/2000 10:42:05 GMT
|
>> From: Marc Prevosto
I would like to impose in the remember table of the diff procedure
diff(theta,t):=a;
without defining theta.
Is it possible?
Thanks
Marc Prevosto
--
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Marc PREVOSTO
Tel:
(+33) (0)2.98.22.41.39
(+33) (0)2.98.22.40.40
Tel. Secr.:
(+33) (0)2.98.22.40.81
Fax:
(+33) (0)2.98.22.46.50
E-mail:
WWW: http://www.ifremer.fr/ditigo/com/
IFREMER - Centre de BREST
TMSI/IDM/COM
BP 70
29280 PLOUZANE
FRANCE
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
|
| [MUG] Re: Diff remember table |
|
Author: Maple Group
Posted: 01/03/2000 19:21:46 GMT
|
>> From: Maple Group
On Mon, 28 Feb 2000, Marc Prevosto wrote:
|> I would like to impose in the remember table of the diff procedure
|> diff(theta,t):=a;
|> without defining theta.
|> Is it possible?
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 29 Feb 2000 11:57:59 -0800 (PST)
From: Robert Israel
To:
Subject: Diff remember table
For most functions F, you could just say
> F(theta,t):= a;
But this doesn't work for "diff". I'm not sure why, but it looks
like Maple treats "diff" in a special way. For example, although
"diff" has option remember, the remember table is not changed when
you say diff(theta,t) or even diff(t,t). Anyway, it looks like
you could do it with a "wrapper" for the diff procedure:
> olddiff:= eval(diff);
> unprotect(diff);
> diff:= proc() olddiff(args) end;
> protect(diff);
> diff(theta,t):= a;
However, that is almost certainly not what you want, because while it
will evaluate diff(theta,t) as a, this won't be used in more
complicated expressions such as diff(theta+t,t). Instead you could
try doing more with the wrapper.
> restart;
olddiff:= eval(diff);
unprotect(diff);
`diff/_theta`:= proc(e,v) if v=t then a else 0 fi end;
diff:= proc(e)
eval(olddiff(subs(theta=_theta(t),e),args[2..nargs]),
_theta=proc() theta end);
end;
protect(diff);
And now, for example:
> diff(theta^2 + t, t);
2 theta a + 1
Robert Israel
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Wed, 01 Mar 2000 17:42:04 +0000
To: Marc Prevosto
From: Stanley J Houghton
Subject: Diff remember table
At 17:18 01/03/2000 +0100, you wrote:
>Yes of course, but I have a complicated function g of theta and t
>(trig,power,exp) and I would like to compute diff(g,theta) as a function of
>theta an t. If I put theta:=a*t+C and use diff it is then a difficult job
>(simplify,combine,...) to obtain the function of theta.
>I do not know if it's clear?
>
>Marc
I understand. However, without seeing the function, it is difficult to
suggest an approach.
Function algsubs may help to reintroduce theta, using the constant C as an
indicator thus:
> expr:=exp(theta*t)*sin(theta+4*t+t^2);
> theta:=a*t+C; #define theta in terms of a using C as an indicator constant
> d:=diff(expr,t);
> theta:='theta'; #revert to theta undefined
> algsubs(C=theta-a*t,d); #now substitute back for theta using the indicator
Please excuse the naive functional form invented for the purpose but it
serves to show the approach. Alternatively, you could use:
> restart;
> expr:=exp(theta*t)*sin(theta+4*t+t^2);
> theta:=f(t); #define theta as a function form
> `diff/f`:=proc(x,t) a end; #define the differential as 'a'
> d:=diff(expr,t);
> theta:='theta';f(t):=theta; #now reset theta and set f(t) to evaluate to
theta
> d; #check the result
Hope it helps
Stan
|
Previous by date: [MUG] Re: Incredible Laplace bug, Maple Group
Next by date: [MUG] A question about solving Laplace's PDE with Maple, Vassil Vassilev
Previous thread: [MUG] painting of prime, John Cosgrave
Next thread: [MUG] A question about solving Laplace's PDE with Maple, Vassil Vassilev
|