Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*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 1999

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

Search the Archive

Re: FindRoot behaving funny?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15822] Re: FindRoot behaving funny?
  • From: "W. K. Bertram" <wkb at ansto.gov.au>
  • Date: Fri, 12 Feb 1999 18:39:43 -0500 (EST)
  • Organization: Australian Nuclear Science and Technology Organisation
  • References: <79ebqo$9u0@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Doug Webb wrote:

> Hello,
>   This is a simplified example of I problem I have run into with
> FindRoot. Does anybody have any idea why it's doing what it is? And if
> so, how I can make it do what I want, or some other work around? Thanks
> for any info. Here's the example:
>
> define a function that takes one input, and outputs two results:
>
> r[x_] := {x, x^2}
>
> It does what's expected:
>
> r[4]
> {4,16}
>
> Now, find a solution using FindRoot:
>
> FindRoot[ r[x] == {5, 25}, {x, 2}]
>
> returns an error (rather than the obvious answer of x->5):
>
> FindRoot::"frnum":
>     "Function {{-3., -21.}} is not a length 1 list of numbers at {x}
> ={2.}."
>

The reason why mathematica can't handle your problem in that way becomes
apparent when you try for example;

         FindRoot[ r[x] == {5, 12}, {x, 2}]

Clearly there is no single x-value that solves this. In fact, in general
the equation r[x] == {r1,r2} has no solution. One way of making your
problem comprehensible to Mathematica is

      FindRoot[{r[x1][[1]]==5, r[x2][[2]]==25},{x1,2},{x2,2}]

Cheers,
    Bill




  • Prev by Date: Beep Only, if Timing Greater Than 10 Seconds
  • Next by Date: Re: Q: Why can't I stop TraditionalForm dismissing Times Attributes ?
  • Previous by thread: Re: FindRoot behaving funny?
  • Next by thread: Options for Cell: Why are some of these System symbols and others not?