Re: Naming Operators in Pure Function form
- To: mathgroup at smc.vnet.net
- Subject: [mg101833] Re: Naming Operators in Pure Function form
- From: Roland Franzius <roland.franzius at uos.de>
- Date: Sat, 18 Jul 2009 08:00:37 -0400 (EDT)
- References: <h3s1u3$61l$1@smc.vnet.net>
Sid schrieb: > Dear Mathgroup, > > I am having a problem with naming differential operators wriiten as > pure functions. > > Consider the simple example (1-D wave operator) > > (D[#1, x] + D[#1, t] & ) @ (D[#1, x] - D[#1, t] & ) ... > (*) > > I want to name the diffl operators as follows : > > Let X be d/dx and T be d/dt > > Now, if I define X = D[#1, x] & and T = D[#1, t] &, that > > won't do. Also, omitting an ampersand will give zero. > > So , how should I define pure functions X and T so that (*) above > > can be written as > > (X +T ) @ (X -T ) > > (In my actual problem, I have in place of X a spherical Laplacian > plus some first-order operators and constants. ) > > > Any hints to help me suss this out will be most appreciated. D needs a first argument explictly dependent on the second. If no such argument is supplied the result is zero. Use instead T = Derivative[1,0][#]& X = Derivative[0, 1][#]& But even in this case you need an argument f or you loose T@X -> Derivative[1][Derivative[0, 1]][#1] & But with arguments it works endlessly down to the roots T@X@f -> f^(1,1) X@T@(2* #1^2 * #2^3 &))[x, y] -> 12 x y -- Roland Franzius