Re: Re: Simplifying with KroneckerDelta
- To: mathgroup at smc.vnet.net
- Subject: [mg101535] Re: [mg101462] Re: [mg101426] Simplifying with KroneckerDelta
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 9 Jul 2009 01:59:29 -0400 (EDT)
- Reply-to: hanlonr at cox.net
sub = expr_* KroneckerDelta[c_, d_] :> Simplify[expr, c == d] * KroneckerDelta[c, d]; Exp[a - b] KroneckerDelta[a, b] /. sub KroneckerDelta[a, b] Bob Hanlon ---- "Francisco Rojas Fern=C3=A1ndez" <fjrojas at gmail.com> wrote: ============= Thanks. That helps, but maybe I should have been more specfic because I actually have long and more involved expressions. What would be really useful for me in this case would be a replacement rule like this: krule = f[b_] KroneckerDelta[a_, b_] -> f[a] KroneckerDelta[a, b] where f[ ] is any function. For example, if I had an expression like: Exp[a-b] KroneckerDelta[a,b] I would like Mathematica to give me Exp[0] KroneckerDelta[a,b] which after simplifying of course it's just KroneckerDelta[a,b] Is there anyway I can do this? I tried some ways but they didn't work (maybe writing f[b_] is not the right way?) Thanks in advance again for your help. -Francsico On Tue, Jul 7, 2009 at 7:43 AM, David Park <djmpark at comcast.net> wrote: > Why not use a rule? > > krule = b_ KroneckerDelta[a_, b_] -> a KroneckerDelta[a, b] > > (m + n) KroneckerDelta[k, m + n] /. Krule > k KroneckerDelta[k, m + n] > > But the real work might be if you have a sum before the KroneckerDelta that > only includes m + n as sub-terms. You could write a routine that collected > on the KroneckerDelta forms, then wrapped Hold around the m+n sub-terms > (both places), then applied the rule and released the Hold. > > > David Park > djmpark at comcast.net > http://home.comcast.net/~djmpark/ <http://home.comcast.net/%7Edjmpark/> > > > From: frojasf [mailto:fjrojas at gmail.com] > > > Hello, > > Does anybody know how to tell mathematica to use the KroneckerDelta in > order > to simplify expressions? For example, it would be great if it could receive > something like this: > > (m+n) KroneckerDelta[k,m+n] and give > > k KroneckerDelta[k,m+n] > > Of course this is simple example, but I have an expression which is about > 200 terms long, so if it could use the delta to simplify things by itself, > that would be great. > > Thanks to all in advance, > Francisco > -- > View this message in context: > > http://www.nabble.com/Simplifying-with-KroneckerDelta-tp24362541p24362541.ht > ml<http://www.nabble.com/Simplifying-with-KroneckerDelta-tp24362541p24362541.ht%0Aml> > Sent from the MathGroup mailing list archive at Nabble.com.