Re: Problem with circles in complex plane

*To*: mathgroup at smc.vnet.net*Subject*: [mg61114] Re: [mg61095] Problem with circles in complex plane*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Tue, 11 Oct 2005 03:20:07 -0400 (EDT)*References*: <200510100639.CAA26851@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

On 10 Oct 2005, at 15:39, Daniele Lupo wrote: > Hi to all the Mathematica's Masters. > > I've a problem working with circles in the Complex Plane. > > I hope that someone of you can help me. > > I've these values of centers and rays > > CF = G/(1 + Q); > RF = (1/(1 + Q))*Sqrt[Q^2 + Q*(1 - Abs[G]^2)]; > > Cg = (g*Conjugate[P])/(1 - Abs[P]^2*(1 - g)); > Rg = (Sqrt[1 - g]*(1 - Abs[P]^2))/(1 - Abs[P]^2*(1 - g)); > > I want to find the g parameter, to find a circle of the family (Cg,Rg) > that's tangent to the first circle. > > G, P are complexes, with absolute value less than 1, while Q is a > positive > real number. > > To do this, I use this formula: > > tangentray = Abs[CF - Cg] - RF > > to find the ray of the tangent circle that depends of parameter. > Then I use > > sol = Solve[tangentray == Rg, g] > > to find the g value that make these two rays equals. In this way I > should > to find the value of g that identifies the tangent circle, right? I > think > yes, but maybe I'm wrong... Probably it's so, but I don't know why. > > The problem is that Mathematica returns me a list of four values, > that are > complexes, whike I know that there MUST be a real value of g for > which this > tangent circle exist. You can see this example: > > rul = {G -> -0.4608904699810983 + 0.11491290040984217*I, Q -> 0.3, > P -> > -0.8363463602974097 + 0.16256926406081632*I} > > Show[ > Graphics[ > { > (* Family of Circles depending on g *) > Red, Circle[{Re[Cg /. rul], Im[Cg /. rul]}, Rg /. rul] /. {{g > -> .8}, > { > g -> 0.9}, {g -> 0.94}}, > (* Fixed Circle *) > Blue, Circle[{Re[CF /. rul], Im[CF /. rul]}, RF /. rul] > } > ], AspectRatio -> Automatic] > > > In this case you can see that, for a value of g between 0.9 and > 0.94 there > must be a tangent circle. > > Then, I find the g value > > sol = Solve[ray == Rg, g] > > and, with the same values, I obtain > > sol /. rul > > that returns > > {{g -> -0.19317892523624003 + 0.14313227060687864* > I}, {g -> 0.9584729373799866 - > 0.44878073249387535*I}, > {g -> 0.22609724512769427 - 0.07178705469686383* > I}, {g -> -0.36357640440949757 + > 0.07475060907387349*I}} > > As you can see, noone of g values is real, around 0.9. > > So, what's wrong in things that I do? How can I find the correct > value og g > parameter? > > Thanks for your answers > > Daniele > > PS: I'm using Mathematica 5.1 on WinXP Home > > It seems that parts of your message are missign and it is not clear what exactly yopu did. For example you are solving sol = Solve[ray == Rg, g] but you do nto have a definitoon of ray but only of tangentray. Unless you post exactly what you did it is difficult to tell what exaclty went wrong and what should be changed. However, in general, problems of this type are very vulnarable to numerical instability so it may be difficult or impossible to get good asnwers working with machine precision as you are doing. I think in such situations FindRoot is more reliable than Solve or NSolve. Using your definitions I get: tangentray = Abs[CF - Cg] - RF; rul = {G -> -0.4608904699810983 + 0.11491290040984217*I, Q -> 0.3, P -> -0.8363463602974097 + 0.16256926406081632*I} g /. FindRoot[tangentray == Rg /. rul, {g, 1}] 0.9136201771352066 - 5.647974542294245*^-9*I The imaginary part is quite small but still to large to be eliminated by the Chop command. However, with numerical precision numbers there is not much more one can do. If you forcibly rationalize the numbers (there is of course some arbitrariness in doing that) you can make the imaginary part small enough to be eliminated by Chop: g /. FindRoot[Rationalize[tangentray == Rg /. rul,0], {g, 1},WorkingPrecision->20]//Chop 0.91362017540776360129 Andrzej Kozlowski

**References**:**Problem with circles in complex plane***From:*Daniele Lupo <danwolf80_no_spam_@libero.it>