Re: ZTarnsform[Sin[4 n],n,z] OK, but ZTransform[Sin[5 n],n,z,] hangs?
- To: mathgroup at smc.vnet.net
- Subject: [mg56804] Re: [mg56772] ZTarnsform[Sin[4 n],n,z] OK, but ZTransform[Sin[5 n],n,z,] hangs?
- From: Devendra Kapadia <dkapadia at wolfram.com>
- Date: Fri, 6 May 2005 03:00:35 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Thu, 5 May 2005, steve wrote: > Hello; > This is Mathematica 5.1 on windows. > > This is a strange one. > > When I start Mathematica and type > > ZTarnsform[Sin[4 n],n,z] > > Then I get the answer. > > but if replace '4' by '5' above, I see Mathematica starts > to consume huge amount of memory untill the PC hangs running > out of virtual RAM. > > ZTarnsform[Sin[5 n],n,z] <---- hangs > ZTarnsform[Sin[4 n],n,z] <---- ok > > any one has any idea what is going on? is this some subtle > mathemtical thing I am overlooking that is causing this? > what is so special about '5' here? > > thanks, > Steve > Hello Steve, Thank you for reporting this problem with ZTransform in Mathematica 5. This appears to have been caused by a hang in Limit (which is used by ZTransform for convergence testing), when we use Sin[5 n] instead of Sin[4 n] in ZTransform, in Mathematica 5. As a workaround, you could try applying TrigToExp in the example that hangs, as shown below. ================================================================ In:= $Version Out= 5.1 for Linux (February 20, 2005) In:= ZTransform[TrigToExp[Sin[5 n]], n, z] // Together//InputForm Out//InputForm= ((I/2)*(-1 + E^(10*I))*z)/(-E^(5*I) + z + E^(10*I)*z - E^(5*I)*z^2) ================================================================ Sorry for the inconvenience caused by this problem. Sincerely, Devendra Kapadia. Wolfram Research, Inc.