Searching list for closest match to p
- To: mathgroup at smc.vnet.net
- Subject: [mg79274] Searching list for closest match to p
- From: chuck009 <dmilioto at comcast.com>
- Date: Mon, 23 Jul 2007 03:41:54 -0400 (EDT)
I'm working on an interesting theorem in Complex Analysis called Jentzsch's Theorem in which the zeros of the partial sums of a Taylor series for an analytic function in the unit disk, all converge to values on the unit disk. So I choose a point on the unit disk, p=Cos[pi/3]+iSin[pi/3], calculate the normal series for f[x]=Log[1+x] for n ranging from 1 to 100, calculate the zeros, then for each polynomial, search the zeros for the one closest to the point. Here's my code. I feel the Table part is messy with the First[First[Position... construct in it. Can anyone recommend a more concise way of searching the zero lists and finding the one closest to p3? Thanks, p3color = Red; p3 = Cos[Pi/3] + I*Sin[Pi/3]; p3mintable = Table[zlist = x /. N[Solve[Normal[Series[Log[1 + x], {x, 0, nval}]] == 0], 6]; minz = zlist[[First[First[Position[mins = (Abs[#1 - p3] & ) /@ zlist, Min[mins]]]]]], {nval, 1, 100}]; p3vals = ({Re[#1], Im[#1]} & ) /@ p3mintable; lp3 = ListPlot[p3vals, PlotRange -> {{-1.4, 1.4}, {-1.4, 1.4}}, AspectRatio -> 1]; Show[{lp3, Graphics[{p3color, PointSize[0.03], Point[{Re[p3], Im[p3]}]}], Graphics[Circle[{0, 0}, 1]]}]
- Follow-Ups:
- Re: Searching list for closest match to p
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: Searching list for closest match to p