MathGroup Archive 2011

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

Search the Archive

Re: FindRoot and replacement rule

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123929] Re: FindRoot and replacement rule
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Fri, 30 Dec 2011 07:09:49 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jdh68h$kjj$1@smc.vnet.net>

On 2011.12.29. 8:52, SamTakoy wrote:
> Hi,
>
> Just wondering why FindRoot and other solvers return substitution
> rules rather than simply a list of solutions. What's the advantage?
>

If you have more than one variable, Mathematica needs a way to tell you 
which value belongs to which variable.

Consider the following from the docs:

sol = Solve[a x + y == 7 && b x - y == 1, {x, y}]

If it simply returned {{8/(a + b), -((a - 7 b)/(a + b))}}, (using the 
order of variables instead of explicit names), this would be a lot more 
work to substitute back to the original equation.

With the current method equation /. sol[[1]] will substitute back the 
first solution easily.

-- 
Szabolcs Horvát
Matheamtica QA site proposal: http://area51.stackexchange.com/proposals/37304



  • Prev by Date: Re: FindRoot and replacement rule
  • Next by Date: Re: DeleteCases
  • Previous by thread: Re: FindRoot and replacement rule
  • Next by thread: Re: FindRoot and replacement rule