Solving equation with bessel function
14 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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
0 件のコメント
その他の回答 (1 件)
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

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
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.
参考
カテゴリ
Help Center および File Exchange で Bessel functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!