Help for solving linear system that involves Bessel and Hankel Functions
3 views (last 30 days)
Show older comments
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1581801/image.png)
I have tried starting with the following but I don't know how to proceed. Also, I don' t know to do it for the case of M different of N.
First I am defining the Bessel and Hankel Functions and their derivatives:
M= 10;
N = M;
scaled = 1; % parameter for Bessel functions (to avoid overflow for large M)
for m = 0:M
J_c(m+1) = besselj(m,k*r,scaled);
H_s(m+1) = besselh(m,2,k*r,scaled);
J_cp(m+1) = m*(besselj(m,k*r,scaled))./(k_c*a_c) - (besselj(m+1,k*r,scaled));
H_sp(m+1) = (1/2)*(besselh(m-1,2,k*r,scaled)-besselh(m+1,2,k*r,scaled));
0 Comments
Answers (1)
Torsten
on 3 Jan 2024
Edited: Torsten
on 3 Jan 2024
What kind of functions are the P_m^n and Q_m^n ?
Fix a finite upper bound N for the loops instead of Inf. Then you have a linear system of equations in A_0,...,A_N,B_0,...,B_N. Set up the coefficient matrix Mat and the right-hand side vector rhs and solve it using \
Use 2*N as the new upper bound for the loops instead of Inf and check whether the solutions of your first computation (with N as upper bound) don't differ much from those of this computation.
Example for solving a linear system in MATLAB:
Mat = [1 3 ; 4 6];
rhs = [-2;5];
sol = Mat\rhs
9 Comments
Torsten
on 18 Jan 2024
Edited: Torsten
on 18 Jan 2024
If you determine the matrices and right-hand sides as shown above, you will end up with the correct problem size - either (N+1) x (N+1) for both A and B if you want to solve for A and B separately or 2*(N+1) x 2*(N+1) if you want to solve for A and B in one go.
See Also
Categories
Find more on Bessel functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!