MATLAB: Solving equation with bessel function

bessel functionMATLABroots

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?

Best Answer

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
Related Question