Re: Re: computing residues

*To*: mathgroup at smc.vnet.net*Subject*: [mg54854] Re: [mg54821] Re: [mg54785] computing residues*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Fri, 4 Mar 2005 05:07:49 -0500 (EST)*References*: <200503010658.BAA25262@smc.vnet.net> <200503030329.WAA21091@smc.vnet.net> <4a6a68e0a91addc250bf47ab9ab03e74@mimuw.edu.pl> <f3885ad81d34cd0aeb321c924314a621@mimuw.edu.pl>*Sender*: owner-wri-mathgroup at wolfram.com

Here is a working example of what I really meant: This gives the correct answer: Residue[1/Sin[x],{x,Sin[w]^2+Cos[w]^2-1}] 1 while this gives a wrong answer: Residue[1/Sin[x],{x,w-Abs[w](Cos[Arg[w]]+I*Sin[Arg[w]])}] 0 Of course this is less urgent than what I first thought I had observed, that is, analogous behaviour with numerical quantities) although I am pretty sure that if we use as expansion point a numeric expression which is too complicated for Mathematica to reduce to zero it will return Residue 0, which will be the wrong answer. In any case this behaviour is clearly undesirable. Andrzej Kozlowski On 3 Mar 2005, at 16:46, Andrzej Kozlowski wrote: > I have to admit Mathematica is smarter than I had thought and in fact: > > > Residue[1/Sin[x],{x,Root[8*#1^3-6*#1-1&,3]-Cos[Pi/9]}] > > 1 > > I made a mistake by using Root[8*#1^3-6*#1-1&,1] instead of > Root[8*#1^3-6*#1-1&,3] in the first part of my example below. In fact > Residue deals with this case impressively well. This certainly seems > to reduce the strength of my argument, though I still would prefer to > get an unevaluated input in the non-numerical case. > > Andrzej > > > > On 3 Mar 2005, at 08:47, Andrzej Kozlowski wrote: > >> >> On 3 Mar 2005, at 04:29, Daniel Lichtblau wrote: >> >>> mjumbo wrote: >>> >>>> Hello, >>>> >>>> I would like to compute residues of analytical function, but >>>> Mathematica's built-in function Residue produces extremely strange >>>> results. E.g. >>>> >>>> Residue[1/Sin[z], {z, w}] >>>> >>>> gives 0, I expected it produce some conditional expression, or at >>>> least to leave this expression unevaluated, but 0 is surely >>>> incorrect. >>>> What I am doing wrong? >>>> >>>> MJM >>>> __________ >>>> www.newmail.ru -- óçåë ñâîáîäíûõ êîììóíèêàöèé. >>>> >>>> >>> >>> You are not doing anything wrong but your expectation is not >>> realistic. >>> You would like Residue to encorporate, among other things, a >>> (nonexistent) transcendental solver, and an oracle to determine when >>> the >>> expansion point might be treated as arbitrary. This would also raise >>> serious design issues in terms of how to describe the result. To see >>> what I mean, consider what output you think might be realistic for >>> the >>> following examples. >>> >>> Residue[(z^2-1)/Sin[z*Pi], {z,z0}] >>> Residue[(z^2-1)/Sin[Sin[z*Pi]], {z,z0}] >>> Residue[(z^2-1)/Sin[z*t], {z,z0}] >>> Residue[1/(z-Tan[z]), {z,z0}] >>> Residue[1/(z-t*Tan[z]), {z,z0}] >>> Residue[1/Sin[z], {z,z0-Sqrt[z0^2]}] >>> >>> I can tell you how one might begin to approach this. Use Reduce to >>> find >>> zeros of 1/f[z]. Give up when Reduce fails. Otherwise attempt to use >>> its >>> result as an assumption to Series in order to find information about >>> singular points. >>> >>> Among other issues this assumes that you can in some way recognize >>> what >>> is the "variable" on which you will place assumptions. And that >>> Series >>> can be used to advantage with appropriate assumptions. For example, >>> here >>> we find a pole, as desired. >>> >>> In[19]:= Series[1/Sin[z*Pi], {z,z0,1}, >>> Assumptions->Element[z0,Integers]] >>> >>> Sec[Pi z0] Sec[Pi z0] Tan[Pi z0] >>> Out[19]= ----------- + --------------------- + >>> Pi (z - z0) 2 >>> >>> 2 >>> Pi Sec[Pi z0] Pi Sec[Pi z0] Tan[Pi z0] >>> 2 >>>> (------------- + -------------------------) (z - z0) + O[z - z0] >>> 6 4 >>> >>> Here we are not so fortunate. >>> >>> In[21]:= Series[1/Sin[z], {z,z0,1}, >>> Assumptions->Element[z0/Pi,Integers]] >>> >>> 2 >>> Out[21]= Csc[z0] - Cot[z0] Csc[z0] (z - z0) + O[z - z0] >>> >>> In summary, I see several things standing in the way of this rather >>> vaguely proposed functionality. >>> >>> (1) Lack of a clear design for what it should do, e.g. how to return >>> the >>> result. >>> (2) Lack of capabilities to discern singular points. >>> (3) Lack of an ability to recognize that the expansion point is in >>> some >>> way not bound to a specific "value" (that is to say, how do we know >>> to >>> treat it as being "possibly a singularity"). >>> (4) Lack of an ability to recognize what are the assumptions needed >>> to >>> place us at such points. >>> (5) Lack of a reasonable way to expand series with those assumptions >>> that place us at such points. >>> >>> >>> Daniel Lichtblau >>> Wolfram Research >>> >>> >>> >> >> It seems to me that all the above arguments are reasonable and >> convincing but they still do not justify returning a meanngless 0 >> whenever Mathematica has no idea of what the answer should be rather >> than returning the result unevaluated as is usually done in such >> cases. The current approach is quite useless while the "normal" >> approach has soem uses, since it allows us to use an "inert" result >> for later substitution and evaluation. With the current approach we >> can construct (in Maxim's style ;-)) examples like: >> >> Residue[1/Sin[x], {x, Root[8*#1^3 - 6*#1 - 1 & , 1] - >> Cos[Pi/9]}] >> >> 0 >> >> FullSimplify[Unevaluated[Residue[1/Sin[x], >> {x, Root[8*#1^3 - 6*#1 - 1 & , 3] - Cos[Pi/9]}]]] >> >> 1 >> >> >> It does not appear programistically impossible to change this >> behaviour and it should not cause any serious backward compatibility >> problems. In fact, even a somewhat more ambitious approach might be >> possible: use the method you have indicated to see if you get any >> useful results you can and return an If statement just as definite >> integration with symbolic limits does. Personally I have doubts >> whether this is worth implementing, given that it is not likely to be >> used very frequently and a user that needs it can easily do it >> himself with the help of Reduce, but simply returning 0 seems to me >> to be completely useless and difficult to justify. >> >> Andrzej Kozlowski >> >

**References**:**computing residues***From:*mjumbo <mjumbo@nm.ru>

**Re: computing residues***From:*Daniel Lichtblau <danl@wolfram.com>

**Re: Contexts and DumSave**

**Re: FinFit question**

**Re: computing residues**

**Re: Re: computing residues**