0

I'm trying to find the roots (a_n,b_n) of a system involving Bessel functions.

enter image description here

I tried to obtain a list of the n-first roots in mathematics with FindRoot, but I only get one root, how can I get the first n roots (an and bn) with n=20

B=1;
T=10;
K=0.5;
FindRoot[(BesselJ[0,K*a]+b*BesselY[0,K*a])*(1-T*a)-B*a*(BesselJ[1,K*a]+b*BesselY[1,K*a]);
(BesselJ[0,a]+b*BesselY[0,a])*(1-T*a)-B*a*(BesselJ[0,a]+b*BesselY[0,a])  ,{a,b ,20}]

and I have this result

{a->0.230331}  

Any help would be greatly appreciated. Thank you

Michael E2
  • 235,386
  • 17
  • 334
  • 747
  • 1
    The equations in the code are not the same as the LaTeX equations. You cannot use function brackets ([ ]) in place of parentheses. The syntax of the FindRoot is wrong. – Bob Hanlon Aug 09 '22 at 22:47
  • What do you mean by "it doesn't work"? Does it spit out the wrong roots? Not enough roots? Does it return unevaluated? Is there an error message that pops up? (If so, what is it?) Please provide more details. (Not in the comments, though. Please edit your original post with these extra details. Also, make sure to pay attention to the previous comment.) – march Aug 10 '22 at 00:08
  • @ Bob Hanlon. I corrected it but I only got one root. – maryem elferragui Aug 10 '22 at 02:18
  • Why do you have two separate expressions separated by a semicolon in the argument of FindRoot? FindRoot will only search for roots of the second expression. Is that what you want? If so, what is the first expression for? Are you actually searching for where those two expressions are equal to each other? – march Aug 10 '22 at 02:18
  • Related https://mathematica.stackexchange.com/questions/37457/ndsolve-findroot-for-bessel-zeros – Michael E2 Aug 10 '22 at 02:20
  • @march. I have a system, like in the latex equation. with the two expressions, but I don't know how I can do it with FindRoot – maryem elferragui Aug 10 '22 at 02:25
  • 1
    The equations in the code still are not the same as the LaTeX equations. Correct one or the other. The syntax is still not correct for FindRoot. Look in the documentation for the correct syntax for a system of equations. – Bob Hanlon Aug 10 '22 at 03:27

1 Answers1

3

I don't know why you define b if you are solving for it, but I am guessing that this is what you want.

B = 1;
T = 10;
K = 0.5;

fun = {(BesselJ[0, K*a] + bBesselY[0, Ka])(1 - Ta) - Ba(BesselJ[1, K*a] + bBesselY[1, Ka]), (BesselJ[0, a] + bBesselY[0, a])(1 - Ta) - Ba(BesselJ[0, a] + bBesselY[0, a])}

FindRoot[fun, {a, 10}, {b, 10}] ({a -> 12.3465953036785, b -> 0.6207433546592956})

We can also do

FindRoot[fun, {a, 5}, {b, 5}]
(*{a -> 6.043180303897816, b -> 0.5791958099682194}*)

You can also use NSolve

NSolve[fun[[1]] == 0 && fun[[2]] == 0 && 0 <= a <= 20 && 0 <= b <= 20]
{{a -> 6.043180303897824, b -> 0.5791958099682254}, {a->12.3465953036785, 
  b -> 0.6207433546592946}}

With NSolve you can increase the range of a and b to get as many roots as you want, although when I do that, the value of a increases steadily, but the value of b does not change much. Specifying b with two equations, over specifies the problem.

Bill Watts
  • 8,217
  • 1
  • 11
  • 28