Re: Help with findroot
- To: mathgroup at smc.vnet.net
 - Subject: [mg9173] Re: [mg9169] Help with findroot
 - From: David Withoff <withoff>
 - Date: Tue, 21 Oct 1997 02:02:47 -0400
 - Sender: owner-wri-mathgroup at wolfram.com
 
> I'm having a problem using findroot to solve an equation.  Perhaps
> someone
>  could shed some light on what's wrong.
>
> FindRoot[Sqrt[x/(1.2 10^ -4)]==-0.1*Tan[Sqrt[x/(1.2*10^
> -4)]],{x,0.1,0.1,2}]
>
> Mathematica 3. returns a value of -0.07 for x which is not anywhere
> close to correct.
>  Further, I've tried several different starting values and min/max
> limits, but
>  a negative answer is always returned.  Eventually I'de like to compile
> a list
>  of all the roots of the equation up to, say, x=1000, but I can't even
> get one
>  right now.
>
> Thanks,
>
> Karl Kevala
One of the more useful ways to understand this type of example is to
look at plots of the functions, such as
Plot[{Sqrt[x/(1.2 10^-4)], -0.1 Tan[Sqrt[x/(1.2 10^-4)]]},
    {x, 0, .01}, PlotRange -> {-5, 15}]
which correctly suggests that this equation has an infinite number of
solutions (as well as some awkward singularities that are likely to
make the problem computationally challenging).  There is a solution
near .0003
In[12]:= FindRoot[Sqrt[x/(1.2 10^ -4)]==-0.1*Tan[Sqrt[x/(1.2*10^-4)]],
                                  {x,.0003}]
Out[12]= {x -> 0.000319609}
and another one near .0027
In[22]:= FindRoot[Sqrt[x/(1.2 10^ -4)]==-0.1*Tan[Sqrt[x/(1.2*10^-4)]],
                               {x,.0027}]
Out[22]= {x -> 0.00268874}
and so forth.  Because of the singularities, you may need to choose
starting values that are rather close to the solution in order for the
algorithm to converge to the solution that you want.  The plots can be
very useful in choosing good starting values.
Dave Withoff
Wolfram Research