 
 
 
 
 
 
Re: pattern in list of derivatives
- To: mathgroup at smc.vnet.net
- Subject: [mg22716] Re: pattern in list of derivatives
- From: Eckhard Hennig <hennig at itwm.uni-kl.de>
- Date: Fri, 24 Mar 2000 03:26:59 -0500 (EST)
- Organization: ITWM
- References: <8b9n7a$997@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Klaus Duellmann schrieb in Nachricht <8b9n7a$997 at smc.vnet.net>...
>Dear Mathgroup Member,
>
>I can extract all derivatives from
>
>e.g. s1 = a u'[x] + a u''[x]
>
>by Cases[{s1}, Derivative[_][u][x],-1] and get
>
>{u'[x],u''[x]}
>
>
>But for mixed derivatives
>
>e.g. {a u[x,y]^(0,1) + c u[x,y]^(1,1)}
>
>the correponding command Cases[{s1}, Derivative[_][u][x,y],-1]
>doesn't work and I receive only the empty list {}.
Just add one more underscore to your pattern:
s1 = {a D[u[x, y], y] + c D[u[x, y], x, y]};
Cases[{s1}, Derivative[__][u][x,y],-1]
  (0,1)         (1,1)
{u     [x, y], u     [x, y]}
Inspect the FullForm of your expression to see why this is necessary.
-- Eckhard
-----------------------------------------------------------
Dipl.-Ing. Eckhard Hennig      mailto:hennig at itwm.uni-kl.de
Institut fuer Techno- und Wirtschaftsmathematik e.V. (ITWM)
Erwin-Schroedinger-Strasse,  67663 Kaiserslautern,  Germany
  Voice: +49-(0)631-205-3126    Fax: +49-(0)631-205-4139
    http://www.itwm.uni-kl.de/as/employees/hennig.html
     ITWM - Makers of Analog Insydes for Mathematica
        http://www.itwm.uni-kl.de/as/products/ai
-----------------------------------------------------------

