MathGroup Archive 2009

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

Search the Archive

Re: FindRoot and evaluations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97005] Re: [mg96951] FindRoot and evaluations
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 1 Mar 2009 04:59:02 -0500 (EST)
  • Reply-to: hanlonr at cox.net

F[x_?NumericQ] := Module[
   {x0 = x},
   Print[x0];
   SomethingLongAndHeavy[x0]];


Bob Hanlon

---- ventutech at gmail.com wrote: 

=============
Let's say:

F[x_]:=Module[
          {x0=x},
          Print[x0];
          SomethingLongAndHeavy[x0]
];

now I do:

FindRoot[F[x],{x,0}]

and it prints:

x

because it first attempts to evaluate F[x] in a symbolic form.
I don't want this. Because SomethingLongAndHeavy is a recursion set of
relations which generates a polynomial of order... too much. What I
would like to see is:

0.0001
0.0002
...

So that F[x] is treated as a blackbox, and some Newton or Bisection
method is applied on this blackbox.
How to do that?

Thanks!
Davide

PS: Based on previous discussions I already tried to play with
attributes HoldAll and option Evaluated, with no success.




  • Prev by Date: Using Play command and polynomial tia sal2
  • Next by Date: Do Hershey Vector Fonts exist in Mathematica?
  • Previous by thread: Re: Using Play command and polynomial tia sal2
  • Next by thread: Re: FindRoot and evaluations