MathGroup Archive 2001

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

Search the Archive

Re: FindRoot


It is not a stupid mistake. Just bear in mind that FindRoot has attribute
HoldAll (see Help browser), which means that "all arguments to FindRoot are
to be maintained in an unevaluated form" (cf. ditto). And also, "You can use
Evaluate to evaluate the arguments of a HoldAll function in a controlled
way" (cf. ditto). Try the following:

In[1]:=
f[i_] := x == i

In[2]:=
FindRoot[Evaluate[f[1]], {x, 0}]
Out[2]=
{x -> 1.}

Tomas Garza
Mexico City

----- Original Message -----
From: <Pieter-Jan.DeSmet at fys.kuleuven.ac.be>
To: mathgroup at smc.vnet.net
Subject: [mg31509] [mg31463] FindRoot


> Dear Sir,
>
> Can you clarify the following error message?
>
> In[3]:= f[i_] := x == i
>
> In[5]:= FindRoot[f[1], {x, 0}]
>
> FindRoot::frnum: Function {False} is not a length 1 list of
> numbers at {x} = {0.}.
>
> Out[5]=FindRoot[f[1], {x, 0}]
>
>
> This is a simplified version of an error message I got in a more
> difficult case. I hope that I have not made a stupid mistake.
>
> Thank you very much
>
> Pieter-Jan De Smet
>
>
>
>



  • Prev by Date: Re: FindRoot
  • Next by Date: Re: ListContourPlot Color
  • Previous by thread: FindRoot
  • Next by thread: Re: FindRoot