Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Solve Feature?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52794] Solve Feature?
  • From: DrBob <drbob at bigfoot.com>
  • Date: Mon, 13 Dec 2004 04:23:04 -0500 (EST)
  • References: <200412100123.UAA18967@smc.vnet.net> <opsir6lsn2iz9bcq@monster.ma.dl.cox.net> <002401c4dfb5$809b6a00$1802a8c0@Pentium4>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

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


  • References:
  • 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?