Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1779 > unrolled thread
| Started by | amelia Jackson <meli.jacson@gmail.com> |
|---|---|
| First post | 2011-04-19 10:56 +0000 |
| Last post | 2011-04-22 09:40 +0000 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
solution amelia Jackson <meli.jacson@gmail.com> - 2011-04-19 10:56 +0000
Re: solution "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-04-20 08:27 +0000
Re: solution Gary Wardall <gwardall@gmail.com> - 2011-04-20 08:29 +0000
Re: solution Peter <petsie@dordos.net> - 2011-04-22 09:40 +0000
| From | amelia Jackson <meli.jacson@gmail.com> |
|---|---|
| Date | 2011-04-19 10:56 +0000 |
| Subject | solution |
| Message-ID | <iojpp7$i52$1@smc.vnet.net> |
Dear MathGroup,
I have a problem. I want to find solution:
r := Table[
k /. FindRoot[BesselJ[0, k] + k BesselJ[1, k] == 0, {k, n}], {n, 1, 100}]
but I get about 30 roots. I need about 100 or more.
I think that "step" "n" tend to Pi
Please for help...
[toc] | [next] | [standalone]
| From | "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> |
|---|---|
| Date | 2011-04-20 08:27 +0000 |
| Message-ID | <iom5e6$t81$1@smc.vnet.net> |
| In reply to | #1779 |
Why don't you increase the number of starting values?
With 100 the number of unique solutions found by Mathematica is 42 (a
magic number in certain circles). If you take 260 instead you'll get
100 roots.
Cheers -- Sjoerd
Fast responses to Mathematica questions at StackOverflow
http://stackoverflow.com/questions/tagged/mathematica
On Apr 19, 12:56 pm, amelia Jackson <meli.jac...@gmail.com> wrote:
> Dear MathGroup,
>
> I have a problem. I want to find solution:
> r := Table[
> k /. FindRoot[BesselJ[0, k] + k BesselJ[1, k] == 0, {k, n}], {n, 1, 1=
00}]
>
> but I get about 30 roots. I need about 100 or more.
> I think that "step" "n" tend to Pi
>
> Please for help...
[toc] | [prev] | [next] | [standalone]
| From | Gary Wardall <gwardall@gmail.com> |
|---|---|
| Date | 2011-04-20 08:29 +0000 |
| Message-ID | <iom5hg$1q$1@smc.vnet.net> |
| In reply to | #1779 |
On Apr 19, 5:56 am, amelia Jackson <meli.jac...@gmail.com> wrote:
> Dear MathGroup,
>
> I have a problem. I want to find solution:
> r := Table[
> k /. FindRoot[BesselJ[0, k] + k BesselJ[1, k] == 0, {k, n}], {n, 1, 100}]
>
> but I get about 30 roots. I need about 100 or more.
> I think that "step" "n" tend to Pi
>
> Please for help...
Ameia,
I have no problem creating that table. I don't know how accurate the
table is but my version of Mathematica does produce the table. I am
using 8.0.1.0 on a mac powerbook.
Good Luck
Gary
[toc] | [prev] | [next] | [standalone]
| From | Peter <petsie@dordos.net> |
|---|---|
| Date | 2011-04-22 09:40 +0000 |
| Message-ID | <iorie2$o4e$1@smc.vnet.net> |
| In reply to | #1779 |
Am 19.04.2011 12:56, schrieb amelia Jackson:
> Dear MathGroup,
>
> I have a problem. I want to find solution:
> r := Table[
> k /. FindRoot[BesselJ[0, k] + k BesselJ[1, k] == 0, {k, n}], {n, 1, 100}]
>
> but I get about 30 roots. I need about 100 or more.
> I think that "step" "n" tend to Pi
>
> Please for help...
Hi Amelia,
FindRoot[f[k]==0,{k,kstart,k0,k1}] looks only in the interval [k0,k1]
for roots. Unfortunately it returns one of the boundaries when no root
is found. So we have to check if in that case the returned value is a
root by chance:
f[k_]=BesselJ[0,k]+k BesselJ[1,k];
Length[zeros=Block[{cnt=0,k0=2.,k},
NestWhileList[
(k0++;
(k /. FindRoot[f[k] == 0, {k, k0 + 1/2, k0, k0 + 1}]) /.
x:(k0 | k0 + 1) /; Chop[f[x]] != 0 :> Unevaluated@Sequence[])&,
{},
Length[{##}] <= 100 &, All]
] // Rest
] // Quiet
You can check if some roots have been left out using:
Plot[f[x]/Sqrt[x], {x, 3, Last[zeros] + .2}, Mesh -> {zeros},
MeshFunctions -> {#1 &}, MeshStyle -> Red, ImageSize -> 1200,
AspectRatio -> 1/10]
Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web