Solving equation with bessel function

조회 수: 15 (최근 30일)
Adam Adam
Adam Adam 2019년 1월 1일
댓글: Paul Safier 2025년 5월 12일
Hello, i am trying to solve this equation for x
besselj(0,0.5*x)*bessely(0,4.5*x) - besselj(0,4.5*x)*bessely(0,0.5*x) ==0;
I tried to use vpasolve but matlab gave me answer only x=0. fzero function didnt work too.
What function should i use for solving this equation?

채택된 답변

Stephan
Stephan 2019년 1월 1일
Hi,
define the area you are interested in and loop through:
syms x
eqn = besselj(0,0.5*x)*bessely(0,4.5*x) - besselj(0,4.5*x)*bessely(0,0.5*x);
fplot(eqn)
fun = matlabFunction(eqn);
x0 = [0.5:1.5:10];
for k = 1:numel(x0)
sol(k) = fsolve(fun,x0(k));
end
sol = sol'
as suggested by John, who was 2 Minutes faster. A good stepwide can be found by looking at the plot.
Best regards
Stephan

추가 답변 (1개)

John D'Errico
John D'Errico 2019년 1월 1일
fun = @(x) besselj(0,0.5*x).*bessely(0,4.5*x) - besselj(0,4.5*x).*bessely(0,0.5*x);
ezplot(fun)
grid on
untitled.jpg
How many of what appear to be infinitely many solutions would you want to find?
An important thing to remember is these solutions tend to be approximately periodic, usually with a period of something like pi/4. That is the case here. In fact, n*pi/4 is a very good approximation to each root, for positive integer n.
So just start fzero out with a starting value of that form, and you will find each root.
x0 = 5*pi/4
x0 =
3.92699081698724
[xloc,fval] = fzero(fun,x0)
xloc =
3.91419012758652
fval =
-1.45716771982052e-16
A simple loop would now suffice.
  댓글 수: 2
Josh Philipson
Josh Philipson 2020년 1월 10일
I just want to thank John D'Errico for his tireless support on such a wide range of details and questions. You will likely never know how many people you have helped and effected. So very much appreciated. Kudos and deep gratitude to you. Thank you.
Paul Safier
Paul Safier 2025년 5월 12일
I agree with this!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Bessel functions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by