help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zeros of bessel functions


From: Liam Groener
Subject: Re: zeros of bessel functions
Date: Sat, 16 Jul 2011 12:50:04 -0700

On Jul 16, 2011, at 12:22 PM, john wrote:

> 
> Hi,
> 
> I'm a hobby mathematician and look for the following.
> 
> Zeros of bessel functions.I found this on the internet to compute the zeros
> of bessel functions.
> 
> I tried this in octave but it seems not be working.Can you help me how I
> compute the zeros of bessel
> 
> functions in octave,or change the progams I found.
> 
> Thank you
> 
> Kind regards
> 
> from Belgium
> 
> 
> 
> 
> Find Zeros Bessel Function
> 
> Hi All,
> 
> I want to find out the roots of J0(x) = 0. Not at just one point, but a
> whole list of them. What is the easiest way of implementing this?
> 
> I can put a simple loop around fzero, but that will give me duplicates:
> 
> for i = 1:1000
> f(i) = fzero((x)besselj(0,x),i);
> end
> 
> Do any of you know how to implement this?
> 
> Thank you very much,
> 
> 
> 
> 
> 
> 
> 
> < 3 replies >
> 
> Reply 1 >> Re: Find Zeros Bessel Function
> 
> Why not just use unique on the results?
> 
> Alternatively, you can use my newtzero function. It finds 202 roots, though
> they are not guaranteed to be inclusive between min and max.
> 
> rt = newtzero((x)besselj(0,x),1);
> 
> 
> http://www.mathworks.com/matlabcentral/fileexchange/6924-newtzero
> 
> Reply 2 >> Re: Find Zeros Bessel Function
> 
> Thanks for your response Matt, the unique function would definitely work
> since the point are spaced roughly 'pi' apart.
> 
> However, I found another way of doing this:
> 
> bessj0 = inline('besselj(0,x)');
> for n = 1:n
> z(n) = fzero(bessj0,[(n-1) n]*pi);
> end
> 
> just specify 'n' and it will give you the first n-values of J(z) = 0;
> 
> Thanks for the help!
> 
> Eelco
> 
> Reply 3 >> Re: Find Zeros Bessel Function
> 
> In article &lt;hdt0ak$84r$1fred.mathworks.com&gt;, feijooosgmail.com says...
> Thanks for your response Matt, the unique function would definitely work
> since the point are spaced roughly 'pi' apart.
> 
> However, I found another way of doing this:
> 
> bessj0 = inline('besselj(0,x)');
> for n = 1:n
> z(n) = fzero(bessj0,[(n-1) n]*pi);
> end
> 
> just specify 'n' and it will give you the first n-values of J(z) = 0;
> 
> Thanks for the help!
> 
> Eelco
> 
> 
> You are better off using anonymous functions, if this is your strategy:
> 
> bessj0 = (x) besselj(O,x)
> 
> for n=1:K (shouldn't be n here)
> z(n) = fzero(bessj, etc.
> end

What doesn't work? What version of Octave are you using? I tried this and it 
worked fine in octave 3.4.2:
[1] >> bessj0=@(x)besselj(0,x);
[2] >> for n=1:5
> z(n) = fzero(bessj0,[(n-1) n]*pi);
> end
[3] >> z
z =

    2.4048    5.5201    8.6537   11.7915   14.9309

[4] >> 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]