Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9877 > unrolled thread

Re: Find all roots with FindRoot

Started byMikael Anderson <mikael.anderson.1969@gmail.com>
First post2012-04-29 06:07 +0000
Last post2012-04-29 06:07 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Find all roots with FindRoot Mikael Anderson <mikael.anderson.1969@gmail.com> - 2012-04-29 06:07 +0000

#9877 — Re: Find all roots with FindRoot

FromMikael Anderson <mikael.anderson.1969@gmail.com>
Date2012-04-29 06:07 +0000
SubjectRe: Find all roots with FindRoot
Message-ID<jnilqa$aga$1@smc.vnet.net>
Actually I was using NSolve and was happy with that (see below). Then I
happened to see the post on RootSerach and wanted to test it to see if I
get the same results as NSolve. I got surprised that by increasing the
range I did not get the same answer and hence posted the question.

BTW Andrzej, do you see any advantage in using Reduce compared to NSolve?


In[2]:= NSolve[(Tan[Sqrt[theta]] - 2*Sqrt[theta]/(1 - theta)) == 0 &&
  0 <= theta <= 10000, theta]

Out[2]= {{theta -> 0.}, {theta -> 5.43413}, {theta ->
   35.4046}, {theta -> 84.7952}, {theta -> 153.896}, {theta ->
   242.729}, {theta -> 351.298}, {theta -> 479.605}, {theta ->
   627.65}, {theta -> 795.435}, {theta -> 982.958}, {theta ->
   1190.22}, {theta -> 1417.22}, {theta -> 1663.96}, {theta ->
   1930.44}, {theta -> 2216.66}, {theta -> 2522.62}, {theta ->
   2848.31}, {theta -> 3193.75}, {theta -> 3558.93}, {theta ->
   3943.84}, {theta -> 4348.49}, {theta -> 4772.89}, {theta ->
   5217.02}, {theta -> 5680.89}, {theta -> 6164.5}, {theta ->
   6667.85}, {theta -> 7190.94}, {theta -> 7733.77}, {theta ->
   8296.34}, {theta -> 8878.64}, {theta -> 9480.69}}

/Mikael.



On Sat, Apr 28, 2012 at 11:27 AM, Andrzej Kozlowski <akozlowski@gmail.com>wrote:

>
> Is there any reason why you don't want to use Reduce:
>
> In[166]:=
> Reduce[(Tan[Sqrt[theta]] - 2*Sqrt[theta]/(1 - theta)) == 0 &&
>   0 <= theta <= 10000, theta] // N
>
>
> theta == 0. || theta == 5.43413 || theta == 35.4046 ||
>  theta == 84.7952 || theta == 153.896 || theta == 242.729 ||
>  theta == 351.298 || theta == 479.605 || theta == 627.65 ||
>  theta == 795.435 || theta == 982.958 || theta == 1190.22 ||
>  theta == 1417.22 || theta == 1663.96 || theta == 1930.44 ||
>  theta == 2216.66 || theta == 2522.62 || theta == 2848.31 ||
>  theta == 3193.75 || theta == 3558.93 || theta == 3943.84 ||
>  theta == 4348.49 || theta == 4772.89 || theta == 5217.02 ||
>  theta == 5680.89 || theta == 6164.5 || theta == 6667.85 ||
>  theta == 7190.94 || theta == 7733.77 || theta == 8296.34 ||
>  theta == 8878.64 || theta == 9480.69
>
> It gives you the complete answer (provably so) without the need to fiddle
> with any options and is pretty fast too. Why do you need an external
> package for this sort of thing?
>
> Andrzej Koz=C5=82owski
>
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web