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?

采纳的回答

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.

请先登录,再进行评论。

类别

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