matlab bessel functions?

Thread Starter

suzuki

Joined Aug 10, 2011
119
Hi all,

I'm trying to implement a bessel function method in Matlab. I am aware of the besselj() function call but I'd like to use the formula to "brute force" the solution for my application.

I tried to implement the Bessel Function of the first kind, as shown here. http://en.wikipedia.org/wiki/Bessel_function#Bessel_functions_of_the_first_kind_:_J.CE.B1

I have written the following code:

Rich (BB code):
beta = 4;
alpha = 1;
iteration = 3;

format long

for m = 1:iteration
    J(m) = (((-1)^m)/(factorial(m)*gamma(m+alpha+1)))*(beta/2)^(2*m+alpha);
end

out = sum(J)
But when i compare my solution to the return of besselj(), its not the same, and I'm completely lost as to where I made a mistake.

Thanks.



update: i made a mistake. All the m's can be replaced with m-1 and this solves the issue
 
Last edited:
Top