tellsimp inside functuons



I don't know how you can avoid using DEPENDS, but I do know how you can use
TELLSIMP in a function to do what you apparently want to do:

(C1) foo(x):=(depends(x,t),apply('tellsimp,['diff(x,t),dx_dt]));
                                                     dx
(D1) 	   foo(x) := (DEPENDS(x, t), APPLY('TELLSIMP, [--, dx_dt]))
                                                     dt
(C2) foo(x1);
(D2) 			 [DERIVATIVERULE1, SIMPDERIV]
(C3) diff(x1,t);
(D3) 				     dx_dt


Viktor


 

-----Original Message-----
From: maxima-admin@math.utexas.edu [mailto:maxima-admin at math] On
Behalf Of Andrei Zorine
Sent: Thursday, May 06, 2004 1:48 PM
To: maxima
Subject: tellsimp inside functuons

Hello,
I want to write a function, which amongst all does what is done below.
(C1) depends(x,t);

(D1) 				    [x(t)]
(C2) tellsimp('diff(x,t),dx/dt);

(D2) 			 [DERIVATIVERULE1, SIMPDERIV]
(C3) diff(x,t,2);

(D3) 				       0
(C4) diff(x,t);

				      dx
(D4) 				      --
				      dt
(C5) :lisp $d4

((MTIMES SIMP) ((MEXPT SIMP) $dt -1) $dx)

So, the function should look like
f(x):=( ... do this and that, then tellsimp to substitute diff(x,t) with 
dx/dt, then do more and more...)
My intention is to be able to do f(x1), f(x2), etc., and the have 
diff(x1,t,2)=0 , diff(x1,t)=dx1/dt, etc.

the problem is either f(x1) results in tellsimp('diff(x,t),...).

If I write a macro like buldq([x],'tellsimp('diff(x,t),dx/dt)), then 
tellsimp gets not evaluated :(

How do I define patterns with differentiation of a function's argument?

I have to say depends(x,t) to emulate mma's Dt call. Can I define 
simplification of 'diff(x,t) without saying depends(...) in the above 
framework?

--
Andrei Zorine

_______________________________________________
Maxima mailing list
Maxima@www.math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima