Solving equation with bessel function
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Adam Adam
el 1 de En. de 2019
Comentada: Paul Safier
el 12 de Mayo de 2025
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 comentarios
Respuesta aceptada
Stephan
el 1 de En. de 2019
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 comentarios
Más respuestas (1)
John D'Errico
el 1 de En. de 2019
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 comentarios
Josh Philipson
el 10 de En. de 2020
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.
Ver también
Categorías
Más información sobre Bessel functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!