MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

[Q} MMA: General Linear Differential Operator

  • Subject: [mg3118] [Q} MMA: General Linear Differential Operator
  • From: paddy at sun4.bham.ac.uk (Patrick Jemmer)
  • Date: 3 Feb 1996 01:03:30 -0600
  • Approved: usenet@wri.com
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: The University of Birmingham, UK.
  • Sender: daemon at wri.com

---------------------------------7006122884703
X-Sun-Content-Length: 1215

Hello All!

I need to be able to define a "second-derivative"
type operator (ie like del-squared on scalars).

I feel I am being very inelegant in having to make
all the following declarations for the properties(* define general delsquared
*)

L[a_+b_,q_]:=L[a,q]+L[b,q]
L[a_*b_,q_]:=a*L[b,q]+b*L[a,q]+2*D[a,q]*D[b,q]
L[m_Integer*a_,q_]:=m*L[a,q]
L[a_[q_]*b_[q_],q_]:=a[q]*L[b[q],q]+b[q]*L[a[q],q]+2*D[a[q],q]*D[b[q],q]
L[a_[q_]^n_,q_]:=n*a[q]^(n-2)*(a[q]*L[a[q],q]+(n-1)*D[a[q],q]^2)
L[a_[q1]*b_[q2],q1]:=b[q2]*L[a[q1],q1]
L[a_[q1]*b_[q2],q2]:=a[q1]*L[b[q2],q2]
L[a_[q1]^n_,q2]:=0
L[a_[q2]^n_,q1]:=0
L[a_[q1],q2]:=0
L[a_[q2],q1]:=0
L[a_Real,q_]:=0
L[a_Rational]:=0
 ---------

Is there any systematic way around this ?

I feel I should be using the built-in properties of
D, Dt or things of that kind...

What I want to calculate is the following:

-------------
rho1[q_]:=2*chi1[q]^2
rho2[q_]:=2*chi2[q]^2
rho12[q1_,q2_]:=2*(chi1[q1]*chi1[q2]+chi2[q1]*chi2[q2])
p2[q1_,q2_]:=rho[q1]*rho[q2]-(1/2)*rho12[q1,q2]^2//Expand

d2r[fn_,q1_,q2_]:=L[fn,q1]/4+L[fn,q2]/4-D[fn,q1,q2]/2

d2p2[q1_,q2_]:=d2r[p2[q1,q2],q1,q2]
d2p2a=d2p2[q1,q2]

d2p2=d2p2a /. {q1->r,q2->r}

------------

Thanks... Patrick Jemmer

------------

---------------------------------7006122884703
X-Sun-Content-Length: 885

                                    _
                    _ __   __ _  __| |_ __ ___   __ _ _ __
                   | '_ \ / _` |/ _` | '_ ` _ \ / _` | '_ \
                   | |_) | (_| | (_| | | | | | | (_| | | | |
                   | .__/ \__,_|\__,_|_| |_| |_|\__,_|_| |_|
                   |_|

----------------------------------------------------------------------------------
| Patrick Jemmer,         |   http://tcibm2.bham.ac.uk/home/paddy/padz/padz.html |
| School of Chemistry,    |   e-mail: paddy at tcibm2.bham.ac.uk                    |
| Birmingham University,  |   tel: +44-121-414-7475 (work)                       |
| Edgbaston, Birmingham.  |   fax: +44-121-414-4403                              | 
| B15 2TT                 |   http://www.sr.bham.ac.uk:80/~rm/qhc.html (QHC Page)|
----------------------------------------------------------------------------------

---------------------------------7006122884703--


  • Prev by Date: [Q} MMA: General Linear Differential Operator
  • Next by Date: [Q] How to include PostScript into a mma notebook
  • Previous by thread: [Q} MMA: General Linear Differential Operator
  • Next by thread: [Q] How to include PostScript into a mma notebook