Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Two FindRoot questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89887] Re: [mg89872] Two FindRoot questions
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 24 Jun 2008 03:21:05 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Clear[f];

f[k_ /; k <= 0] := 
  x /. FindRoot[x^2 + k, {x, 0, 10}, WorkingPrecision -> 20];

{f[-10], f[10]}

{3.1622776601683793320,f(10)}

Plot[f[SetPrecision[k, 20]], {k, -10, 10}]


Bob Hanlon

---- Aaron Fude <aaronfude at gmail.com> wrote: 
> Hi,
> 
> These are not FindRoot questions, per se...
> 
> Here's a simple example which I want to ask three questions about:
> 
> f[k_] := x /. FindRoot[x^2 + k, {x, 0, 10}];
> f[-10]
> Plot[f[k], {k, -10, 10}]
> 
> First, I want the plot to only show where there exists a root.
> Is the right solution to make f[] return Null?
> How do I make f[] return Null? (Is there a way to "catch" the
> warnings?)
> 
> Finally, I need to solve my equations to 20 digits. How do I do that?
> I've read about Accuracy and Precision but it didn't help.
> 
> Thanks!
> 



  • Prev by Date: Re: Happy Birthday Mathematica!
  • Next by Date: FullSimplify fails for very large numbers and powers
  • Previous by thread: Two FindRoot questions
  • Next by thread: Re: Re: Two FindRoot questions