INTEGARTION OF BESSELH function

1 回表示 (過去 30 日間)
george veropoulos
george veropoulos 2024 年 11 月 19 日
コメント済み: Walter Roberson 2024 年 11 月 22 日
Hi
i make a code where i integrate the hankel function besselh(0, 2)
function z = Escat(r,phi)
[f,N,ra,k0,Z0] =parameter();
[Is]=currentMoM()
Phim=zeros(N+1);
FINAL=0;
for jj=1:N
%Phi0(jj)=(jj-1).*(pi./N);
Phi0(jj)=(jj-1).*(2.*pi./N);
FINAL=FINAL-(k0.*Z0./4).*Is(jj).*ra.*integral(@(xx)besselh(0,2,k0.*sqrt(ra.^2+r.^2-2.*r.*ra.*(phi-xx))),Phi0(jj),2*pi/N+Phi0(jj));
end
z=FINAL;
end
when i plot the function in the range φ=0 : 2π with r=const the valus of Escat are extremely big value ...
clear all
clc
[f,N,ra,k0,Z0] = parameter();
%ph_i=pi/2;
rho=10.*ra ;
phi=0:pi/180:2*pi;
Es=zeros(length(phi));
%phi=0:pi/200:pi/3
for jj=1:length(phi)
Es(jj)=abs(Escat(rho,phi(jj)));
end
plot(phi*(180./pi),Es,'b--')
hold on
%plot(phi*(180./pi),abs(integ),'b--')
plot(phi,abs(Escattheory_new(rho,phi)),'r-')
xlabel('$\phi$','Interpreter','latex')
ylabel('$|E_{s}|$','Interpreter','latex' )
%legend('MoM', 'Theory')
hold off
can i check if the the integration is ok ?
the parameter fucntion is
function [f,N,ra,k0,Z0] = parameter()
%UNTITLED Summary of this function goes here
c0=3e8;
Z0=120.*pi;
ra=1;
N=80;
f=300e6;
lambda=c0./f;
k0=2*pi./lambda;
end
thank you
  6 件のコメント
Steven Lord
Steven Lord 2024 年 11 月 20 日
If you're adding information, please put it as a comment rather than a separate answer. Leave the answer for posts that may be a solution to the problem, to make them easier to distinguish from commentary.
Walter Roberson
Walter Roberson 2024 年 11 月 22 日
Note that function e_n leaves y undefined in the case where k is NaN.
If k cannot be NaN then there is no point in using elseif -- just use else

サインインしてコメントする。

採用された回答

David Goodmanson
David Goodmanson 2024 年 11 月 22 日
編集済み: David Goodmanson 2024 年 11 月 22 日
Hi george,
I don't know what the values of your parameters are, but it appears that the problem with Escat is that
besselh(0,2,k0.*sqrt(ra.^2+r.^2-2.*r.*ra.*(phi-xx)))
is missing a cosine factor and should be
besselh(0,2,k0.*sqrt(ra.^2+r.^2-2.*r.*ra.*cos(phi-xx)))
Without the cosine, it's possible for the argument of the sqrt to become negative, which causes the argument of besselh to become imaginary, which leads to very large values in the result.
  1 件のコメント
george veropoulos
george veropoulos 2024 年 11 月 22 日
thank you very much!!! the cos was the problem

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by