MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Solve Feature?


HELP!! Here are two very simple quadratic equations (circles):

{c1, c5} = {(-50 + x)^2 + (-50 + y)^2 == 156.25,
  (-50.00000000000002 + x)^2 +
    (-37.49999999999999 + y)^2 == 156.25};

If we rationalize before solving, we get accurate solutions:

solution = Solve@Rationalize@{c1, c5}
solution // N
{c1, c5} /. solution
Subtract @@@ {c1, c5} /. solution

{{x -> (25/4)*(8 - Sqrt[3]), y -> 175/4},
     {x -> (25/4)*(8 + Sqrt[3]), y -> 175/4}}
{{x -> 39.17468245269452, y -> 43.75},
   {x -> 60.82531754730548,  y -> 43.75}}
{{True, True}, {True, True}}
{{-4.263256414560601*^-14, 4.973799150320701*^-13},
   {-4.263256414560601*^-14, -4.263256414560601*^-13}}

You can check this visually with ImplicitPlot:

ImplicitPlot[{c1, c5}, {x, -40, 70}]

But if we solve without Rationalize, we get wildly inaccurate results:

solution = Solve@{c1, c5}
{c1, c5} /. solution
Subtract @@@ {c1, c5} /. solution

{{x -> 16., y -> 43.74999999999993},
   {x -> 84., y -> 43.75000000000004}}
{{False, False}, {False, False}}
{{1038.812500000001, 1038.8125000000005},
  {1038.8124999999995, 1038.8124999999993}}

I'm using version 5.1.

Bobby


  • Prev by Date: Re: multiple outputs from a function
  • Next by Date: Re: multiple outputs from a function
  • Previous by thread: Re: Solve bug?
  • Next by thread: Re: Solve Feature?